Re: standalone library/tool to query commit-graph?
- From
Derrick Stolee <stolee@gmail.com>
- Date
- May 22, 2019, 18:59 UTC
- Message-ID
- <be719a37-ffa0-26d3-eb9c-0f5ccde52e7f@gmail.com>
- In-Reply-To
- <CAECbv94KF9MhzZqa8BR-RL93mh0NuD3vA69pAT-sY5O74e_duQ@mail.gmail.com>
On 5/22/2019 2:49 PM, Karl Ostmo wrote:
Show 5 quoted lines
> After producing the file ".git/objects/info/commit-graph" with the > command "git commit-graph write", is there a way to answer queries > like "git merge-base --is-ancestor" without having a .git directory? > E.g. is there a library that will operate on the "commit-graph" file > all by itself?
You could certainly build such a tool, assuming your merge-base parameters are full-length commit ids. If you try to start at ref names, you'll need the .git directory.
I would not expect such a tool to ever exist in the Git codebase. Instead, you would need a new project, say "graph-analyzer --graph=<path> --is-ancestor <id1> <id2>"
Thanks, -Stolee