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

commit-graph overflow generation chicken and egg

From
Jeff King <peff@peff.net>
Date
Jun 8, 2022, 19:33 UTC
Message-ID
<YqD5dgalb9EPnz85@coredump.intra.peff.net>

I hadn't touched my git.git repository for a while, so I upgraded to the most recent version of Git (v2.36.1) and was met with this:

  $ git rev-list --all
  fatal: commit-graph requires overflow generation data but has none

Not very friendly, but OK, maybe my commit graph is out of date. Let's regenerate it:

  $ git gc
  fatal: commit-graph requires overflow generation data but has none
  fatal: failed to run repack

OK, we can't get far enough in the gc to rebuild the commit graph. Let's try doing it manually:

  $ git commit-graph write --reachable
  fatal: commit-graph requires overflow generation data but has none
  $ git commit-graph write
  fatal: commit-graph requires overflow generation data but has none
Yikes. Here's where it happens within the write process:
  $ GIT_PROGRESS_DELAY=0 git commit-graph write
  Finding commits for commit graph among packed objects: 100% (360229/360229), done.
  Loading known commits in commit graph: 100% (78366/78366), done.
  Expanding reachable commits in commit graph: 78366, done.
  Clearing commit marks in commit graph: 100% (78366/78366), done.
  Finding extra edges in commit graph: 100% (78366/78366), done.
  Computing commit graph topological levels: 100% (78366/78366), done.
  Computing commit graph generation numbers: 100% (78366/78366), done.
  fatal: commit-graph requires overflow generation data but has none

Now being the enterprising fellow that I am, I was able to get out of it like this:

  $ rm -f objects/info/commit-graph
  $ git gc

But I wonder if this is a foot-gun waiting for some other user. I'm not sure how I got into the broken state exactly. The repo was last touched in December using a version of Git running 'next'. It worked fine with versions of Git prior to 6dbf4b8172 (commit-graph: declare bankruptcy on GDAT chunks, 2022-03-02). It's entirely possible that the bad state was generated by a version of Git that wasn't ever released, and this isn't a problem that normal humans would ever run into. It does feel a bit unfriendly that neither gc nor commit-graph could unstick things, though. Especially because 6dbf4b8172 says:

  [...]a previous version of Git wrote possibly erroneous data in these
  chunks with the IDs "GDAT" and "GDOV". By changing the IDs, newer
  versions of Git will silently ignore those older chunks[...]

Presumably we _are_ ignoring those chunks, but some other part of the commit-graph file has a dependency on them (and of course we don't have the new GDA2/GDO2 chunks to read in their place). If that's true, then the solution may be a more graceful "we can't use this commit graph" error return rather than the "fatal:" message seen above.

I have a copy of the broken repo state if anybody would care to look at it.

-Peff
Next: Derrick Stolee
Message 1 of 13 in “commit-graph overflow generation chicken and egg”
  1. Jeff KingJun 8, 2022
  2. Derrick StoleeJun 8, 2022
  3. Jeff KingJun 8, 2022
  4. Patrick SteinhardtJul 1, 2022
  5. Patrick SteinhardtJul 4, 2022
  6. Derrick StoleeJul 4, 2022
  7. Will ChandlerJul 5, 2022
  8. Taylor BlauJul 5, 2022
  9. Jeff KingJul 6, 2022
  10. Jeff KingJul 6, 2022
  11. Ævar Arnfjörð BjarmasonJun 9, 2022
  12. Jeff KingJun 9, 2022
  13. Derrick StoleeJun 9, 2022

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.