git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: standalone library/tool to query commit-graph?

From
Jakub Narebski <jnareb@gmail.com>
Date
Jun 25, 2019, 18:27 UTC
Message-ID
<86ftnx4j1n.fsf@gmail.com>
In-Reply-To
<87o93sfahj.fsf@evledraar.gmail.com>

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes: [...]

Show 9 quoted lines
> To clarify (and I should have said) I meant it'll include only packed
> commits in the mode Karl Ostmo invoked it in, as Derrick points out.
>
> But yeah, you can of course give it arbitrary starting points, but
> needing to deal with those sorts of caveats makes it rather useless in
> practice for the sort of use-case Jakub mused about, but more
> importantly a full XML dump of the graph isn't going to get much of a
> benefit from the commit graph, it helps with algorithms that want to
> avoid those sorts of full walks.

Actually for an "XML dump" of a graph of revisions (assuming that you can give nodes and edges in arbitrary order in this graph output format) doing it using serialized commit-graph should be faster: you only need to read one file, and convert it to other format (perhaps even in a streaming manner). No need to delta-unpack, decompress and parse commit objects.

Though on the other hand you are right: if "git log --graph" uses serialized commit graph, and it is used for XML / JSON dump, it should also be fast. If there is no serialized commit graph, you still can generate XML dump.

Best, -- Jakub Narębski

Previous: SZEDER Gábor
Message 12 of 12 in “standalone library/tool to query commit-graph?”
  1. Karl OstmoMay 22, 2019
  2. Derrick StoleeMay 22, 2019
  3. Jakub NarebskiMay 23, 2019
  4. Ævar Arnfjörð BjarmasonMay 23, 2019
  5. SZEDER GáborMay 23, 2019
  6. Derrick StoleeMay 23, 2019
  7. SZEDER GáborMay 24, 2019
  8. Ævar Arnfjörð BjarmasonMay 24, 2019
  9. SZEDER GáborMay 24, 2019
  10. Ævar Arnfjörð BjarmasonMay 24, 2019
  11. SZEDER GáborMay 24, 2019
  12. Jakub NarebskiJun 25, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.