From: Ævar Arnfjörð Bjarmason Date: Thu, 23 May 2019 21:54:22 GMT Subject: Re: standalone library/tool to query commit-graph? Message-ID: <87tvdkg7ld.fsf@evledraar.gmail.com> In-Reply-To: <86blztq8ap.fsf@gmail.com> On Thu, May 23 2019, Jakub Narebski wrote: > Derrick Stolee writes: >> On 5/22/2019 2:49 PM, Karl Ostmo wrote: > >>> 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= --is-ancestor " > > It would be nice if such tool could convert commit-graph into other > commonly used augmented graph storage formats, like GEXF (Graph Exchange > XML Format), GraphML, GML (Graph Modelling Language), Pajek format or > Graphviz .dot format. Wouldn't that make more sense as a hypothetical output format for "log --graph" rather than something you'd want to emit from the commit-graph? Presumably you'd want to export in such a format to see the shape of the repo, and since the commit graph doesn't include any commits outside of packs you'd miss any loose commits.