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

Re: [RFC][GSoC] Implement Generation Number v2

From
Abhishek Kumar <abhishekkumar8222@gmail.com>
Date
Mar 23, 2020, 11:32 UTC
Message-ID
<20200323113231.GA22065@Abhishek-Arch>
In-Reply-To
<xmqq369z7i1b.fsf@gitster.c.googlers.com>
On Sun, Mar 22, 2020 at 10:32:32PM -0700, Junio C Hamano wrote:
Show 24 quoted lines
> Abhishek Kumar <abhishekkumar8222@gmail.com> writes:
> 
> >> Unfortunately for the time being we cannot use commit-graph format
> >> version; the idea that was proposed on the mailing list (when we found
> >> about the bug in handling commit-graph versioning, during incremental
> >> commit-graph implementation), was to create and use metadata chunk or
> >> versioning chunk (the final version of incremental format do not use
> >> this mechanism).  This could be used by gen2 compatibile Git to
> >> distinguish between situation where old commit-graph file to be updated
> >> uses generation number v1, and when it uses v2.
> >> 
> >> If you have a better idea, please say so.
> >
> > We could also use a flag file. Here's how it works:
> >
> > If the file `.git/info/generation-number-v2` exists, use gen2.
> > Otherwise use gen1.
> 
> If the file is lost then we will try to read the other file that has
> the commit-graph data as if it were in old format?  And if such a
> file was created (say, with "touch .git/info/generation-number-v2"),
> a file in the original format will be read as if it is in new
> format?  If that is the case, it is likely that we'd see a segfault;
> sounds too brittle to me.
Agreed. Flag file has too many issues to be pursued further.
Show 8 quoted lines
> 
> It appears that the format of "CDAT", and the fact that generation
> is represented as higher 30-bit of a be32 integer, is very much
> hardcoded in the design and is hard to change, but your new version
> of graph file can be designed not to use "CDAT" chunk at all, and
> instead have the commit data with new version of generation numbers
> stored in a different chunk (say "CDA2") to force older version of
> Git not to use the new graph file---would that work?

A commit-graph without "CDAT" chunk will hard fail on older versions of Git. verify_commit_graph_lite() errors out if chunk_commit_data is null.

Metadata chunk seems the way to go.

Regards Abhishek

Previous: Junio C HamanoNext: Jakub Narebski
Message 5 of 12 in “[RFC][GSoC] Implement Generation Number v2”
  1. Abhishek KumarMar 22, 2020
  2. Jakub NarebskiMar 22, 2020
  3. Abhishek KumarMar 23, 2020
  4. Junio C HamanoMar 23, 2020
  5. Abhishek KumarMar 23, 2020
  6. Jakub NarebskiMar 23, 2020
  7. Derrick StoleeMar 23, 2020
  8. Jakub NarebskiMar 24, 2020
  9. Junio C HamanoMar 23, 2020
  10. Jakub NarebskiMar 24, 2020
  11. Junio C HamanoMar 24, 2020
  12. [GSoC][Proposal v2] Implement Generation Number v2Abhishek Kumar, Mar 26, 2020

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.