git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* commit-graph overflow generation chicken and egg
@ 2022-06-08 19:33 Jeff King
  2022-06-08 20:08 ` Derrick Stolee
  0 siblings, 1 reply; 13+ messages in thread
From: Jeff King @ 2022-06-08 19:33 UTC (permalink / raw)
  To: git; +Cc: Derrick Stolee

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-07-06  9:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 19:33 commit-graph overflow generation chicken and egg Jeff King
2022-06-08 20:08 ` Derrick Stolee
2022-06-08 23:17   ` Jeff King
2022-07-01 12:06     ` Patrick Steinhardt
2022-07-04 10:46       ` Patrick Steinhardt
2022-07-04 20:50         ` Derrick Stolee
2022-07-05 21:03           ` Will Chandler
2022-07-05 22:28             ` Taylor Blau
2022-07-06  8:52               ` Jeff King
2022-07-06  9:11           ` Jeff King
2022-06-09  7:49   ` Ævar Arnfjörð Bjarmason
2022-06-09 15:26     ` Jeff King
2022-06-09 15:39       ` Derrick Stolee

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).