Re: commit-graph overflow generation chicken and egg
From: Jeff King <hidden>
Date: 2022-06-09 15:26:13
On Thu, Jun 09, 2022 at 09:49:15AM +0200, Ævar Arnfjörð Bjarmason wrote:
It's certainly interesting to see *how* we got to this state, but just so we're on the same page: I fundimentally don't think it matters to the *real* bug here. Which is that at the very least f90fca638e9 (commit-graph: consolidate fill_commit_graph_info, 2021-01-16) and e8b63005c48 (commit-graph: implement generation data chunk, 2021-01-16) (CC'd author) have a bad regression on earlier fixes that read-only operations of the commit-graph *must not die*. I.e. the "parse" and "verify" paths of the commit-graph.c code shouldn't call exit(), die() etc.
Yeah, I'd agree that this is a good philosophy to follow. The commit-graph data is meant to be an optimization, and we can always continue without it.
If you replace your graph with Jeff's corrupt one and run "git status",
"git log" etc. it's still emitting one verbose complaint, but it no
longer does so in loops (at least for these paths, but e.g. "git gc" is
still doing that).
But it does get us to where we can run "git gc", and while complaining
too much along the way will write out a new & valid commit graph at the
end ("[... comments are mine"):Yeah, getting through "git gc" is the key thing here. Then the problem solves itself, sometimes even automatically (via auto-gc). -Peff