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

Re: Strange behavior of git rev-list

From
Jeff King <peff@peff.net>
Date
Sep 8, 2017, 03:17 UTC
Message-ID
<20170908031705.5zqs7jhamzgda47t@sigill.intra.peff.net>
In-Reply-To
<CAGZ79kaubRDXnetj+EXawnr50LMo4tGObz+-Bd-=KerndLfSaA@mail.gmail.com>
On Thu, Sep 07, 2017 at 12:24:02PM -0700, Stefan Beller wrote:
Show 10 quoted lines
> > We've discussed storing true generation numbers in the past, which would
> > make this optimization more robust, as well as allow us to speed up many
> > other traversals (e.g., the "tag --contains"). It's something I'd like
> > to revisit, but it's not at the top of the pile.
> 
> (We just had an office discussion if this is part of the hash transition plan,
> i.e. have a field in the commit object to contain its generation number.
> and as I think the generation numbers would lead to fast and correct
> behavior unlike the current heuristic which is only fast, I would try
> to make a strong point actual generation numbers inside commit objects)

I'm still moderately against storing generation numbers inside the objects. They're redundant with the existing parent pointers, which means it's an opportunity for the two sets of data to disagree. And as we've seen, once errors are cemented in history it's very hard to fix them, because you break any history built on top.

I'm much more in favor of building a local cache of generation numbers (either on the fly or during repacks, where we can piggy-back on the existing pack .idx for indexing).

-Peff
Previous: Stefan BellerNext: Junio C Hamano
Message 6 of 8 in “Strange behavior of git rev-list”
  1. Paweł MarczewskiSep 7, 2017
  2. Jeff KingSep 7, 2017
  3. Paweł MarczewskiSep 7, 2017
  4. Jeff KingSep 7, 2017
  5. Stefan BellerSep 7, 2017
  6. Jeff KingSep 8, 2017
  7. Junio C HamanoSep 8, 2017
  8. Jeff KingSep 8, 2017

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.