Move vendoring to a separate page in the manual

pull/261/head
Wilfred Hughes 2022-04-15 09:33:20 +07:00
parent 97870a3402
commit dbed43e5e4
3 changed files with 24 additions and 4 deletions

@ -7,6 +7,7 @@
- [Mercurial](./mercurial.md)
- [Parsing](./parsing.md)
- [Upstream Parsers](./upstream_parsers.md)
- [Vendoring](./parser_vendoring.md)
- [Adding A Parser](./adding_a_parser.md)
- [Diffing](./diffing.md)
- [Tricky Cases](./tricky_cases.md)

@ -10,10 +10,6 @@ parsers](https://tree-sitter.github.io/tree-sitter/#available-parsers).
## Add the source code
Tree-sitter parsers are sometimes packaged on npm, sometimes packaged
on crates.io, and have different release frequencies. Difftastic uses
git subtrees (not git submodules) to track parsers.
Once you've found a parser, add it as a git subtree to
`vendor/`. We'll use
[tree-sitter-json](https://github.com/tree-sitter/tree-sitter-json) as

@ -0,0 +1,23 @@
# Vendoring
## Git Subtrees
Tree-sitter parsers are sometimes packaged on npm, sometimes packaged
on crates.io, and have different release frequencies. Difftastic uses
git subtrees (not git submodules) to track parsers.
## Updating a parser
To update a parser, pull commits from the upstream git repository. For
example, the following command will update the Java parser:
```
$ git subtree pull --prefix=vendor/tree-sitter-java git@github.com:tree-sitter/tree-sitter-java.git master
```
To see when each parser was last updated, use the following shell
command:
```
$ for d in $(git log | grep git-subtree-dir | tr -d ' ' | cut -d ":" -f2 | sort); do echo "$d"; git log --pretty=" %cs" -n 1 $d; done
```