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

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

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
May 24, 2019, 11:37 UTC
Message-ID
<20190524113710.GG951@szeder.dev>
In-Reply-To
<87k1egf7pz.fsf@evledraar.gmail.com>
On Fri, May 24, 2019 at 12:49:12PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 40 quoted lines
> >> > On Thu, May 23, 2019 at 07:48:33PM -0400, Derrick Stolee wrote:
> >> >> On 5/23/2019 6:20 PM, SZEDER Gábor wrote:
> >> >> > On Thu, May 23, 2019 at 11:54:22PM +0200, Ævar Arnfjörð Bjarmason wrote:
> >> >
> >> >> >> and since the commit graph doesn't include any commits outside of
> >> >> >> packs you'd miss any loose commits.
> >> >> >
> >> >> > No, the commit-graph includes loose commits as well.
> >> >>
> >> >> Depends on how you build the commit-graph.
> >> >
> >> > Yeah; I just didn't want to go into details, hoping that this short
> >> > reply will be enough to jog Ævar's memory to recall our earlier
> >> > discussion about this :)
> >>
> >> 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.
> >
> > No, even in that mode it will include loose objects as well, if it has
> > to; that's what the "and closes under reachability" part of Derrick's
> > reply means and that's what I showed in our earlier discussion at:
> >
> >   https://public-inbox.org/git/20190322154943.GF22459@szeder.dev/
> 
> I should have said "include any commits outside of packs [to seed the
> revision walk]".
> 
> As you correctly point out there *are* caveats to that, e.g. it's
> possible to have packs & loose commits but you include everything
> because of reachability.
> 
> For the purposes of the discussion Jakub started upthread the
> not-quite-correct-but-close-enough mental model that we generally tend
> to accumulate loose objects that later coalesce into packs is close
> enough.
> 
> I.e. for that reason for most users a "git commit-graph write" won't
> produce a graph with all reachable commits, e.g. try cloning git.git,
> "git am"-ing a patch on top, and generate it again, it'll be the same
> (unless you picked a humongous patch).
Ok, with this I finally understand what you meant.

And it just reinforces my long-held belief that '--reachable' should be the default for 'git commit-graph write'...

Previous: Ævar Arnfjörð BjarmasonNext: Jakub Narebski
Message 11 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.