{"thread":{"id":"66131","subject":"[BUG] \"commit graph is likely corrupt\" on git rebase","startedAt":"2026-08-06T19:44:28Z","lastAt":"2026-08-06T19:44:28Z","messageCount":1,"participants":["Philippe Blain"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"549879","messageId":"4983BE1D-4099-4CAF-9374-459F7913982A@gmail.com","threadId":"66131","inReplyTo":null,"subject":"[BUG] \"commit graph is likely corrupt\" on git rebase","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2026-08-06T19:44:25Z","receivedAt":"2026-08-06T19:44:28Z","isPatch":false,"body":"Hi Florian,\n\nFlorian Schmidt <flosch@nutanix.com> wrote:\n> Hiya,\n> \n> Hitting an issue during git rebase. I am starting to suspect git is \n> possibly getting confused between main and submodule repos. I noticed \n> this with a self-compiled git 2.54, but I compiled git v2.55 just now, \n> and seem to hit the same issue still. Full bisect at the end of the message.\n> \n> The first-order issue, trying to rebase a work/foo branch which is \n> tracking origin/master.  There's only one commit difference, a commit \n> that changes two submodule pointers:\n> \n>> devvm:~/gitrepo[git:work/foo *%|u+1-116]$ git show --format=\"\" -p\n>> diff --git a/rpmsrc/kernel b/rpmsrc/kernel\n>> index d8d411244..17006b605 160000\n>> --- a/rpmsrc/kernel\n>> +++ b/rpmsrc/kernel\n>> @@ -1 +1 @@\n>> -Subproject commit d8d411244cfb3463ce09b9577970f7955073ed14\n>> +Subproject commit 17006b605eaed1820ae1c717d4782728b9afc6d3\n>> diff --git a/rpmsrc/qemu-kvm b/rpmsrc/qemu-kvm\n>> index e7d525d0f..8bf4019df 160000\n>> --- a/rpmsrc/qemu-kvm\n>> +++ b/rpmsrc/qemu-kvm\n>> @@ -1 +1 @@\n>> -Subproject commit e7d525d0fdc42fca65c2b70bb5f56adc5aa1d7b1\n>> +Subproject commit 8bf4019dfcb320108a0f014d92d926320a4c8058\n>> \n>> devvm:~/gitrepo[git:work/foo *%|u+1-116]$ git rebase\n>> error: Could not read 157b7492624beac3ac667dd3a84de9969377866b\n>> fatal: invalid commit position. commit-graph is likely corrupt\n>> \n>> devvm:~/gitrepo[git:work/foo *%|u+1-116]$ git cat-file -t 157b7492624beac3ac667dd3a84de9969377866b\n>> fatal: git cat-file: could not get object info\n> \n> git fsck reported no corruption, just a bunch of dangling \n> commits/trees/blobs, no warnings about \n> 157b7492624beac3ac667dd3a84de9969377866b\n> \n> Now, hint 1: the rebase *does* work when disabling commit-graphs:\n> \n>> devvm:~/gitrepo[git:work/foo *%|u+1-116]$ git -c core.commitGraph=false rebase origin/master\n>> Rebasing (1/1)\n>> [... thinking thinking thinking for a long time ...]\n>> Failed to merge submodule rpmsrc/kernel\n>> CONFLICT (submodule): Merge conflict in rpmsrc/kernel\n>> Failed to merge submodule rpmsrc/qemu-kvm\n>> CONFLICT (submodule): Merge conflict in rpmsrc/qemu-kvm\n>> [...]\n> \n> which is fair enough, the submodule pointers moved.\n> And hint 2:\n> \n>> $ git cat-file -t 157b7492624beac3ac667dd3a84de9969377866b\n>> fatal: git cat-file: could not get object info\n>> $ git -C rpmsrc/kernel cat-file -t 157b7492624beac3ac667dd3a84de9969377866b\n>> fatal: git cat-file: could not get object info\n>> $ git -C rpmsrc/qemu-kvm cat-file -t 157b7492624beac3ac667dd3a84de9969377866b\n>> commit\n> \n> So it tries to identify something on the submodule? Maybe it gets \n> confused between submodule and main repo(?)\n> \n> For good measure, I did a git fsck --full on rpmsrc/qemu-kvm, but again \n> only a few dangling warnings, and no change to the issue.\n> So I went to bisect and noticed the issue appeared somewhere between \n> v2.53 and v2.54. v2.53 also complains, but then continues:\n> \n>> $ ~/upstream/git/git rebase\n>> error: Could not read 157b7492624beac3ac667dd3a84de9969377866b\n>> error: Could not read 95d676ad199191d81a000761733ea25c17172d8b\n>> Failed to merge submodule rpmsrc/kernel (commits don't follow merge-base)\n>> CONFLICT (submodule): Merge conflict in rpmsrc/kernel\n>> Failed to merge submodule rpmsrc/qemu-kvm (commits don't follow merge-base)\n>> CONFLICT (submodule): Merge conflict in rpmsrc/qemu-kvm\n>> [...]\n> \n> In any case, to figure out the cause, I bisected it down to commit \n> bb5da75d61 (\"commit: use commit graph in \n> `lookup_commit_reference_gently()`\"), which makes sense in the context \n> of \"it works with commit-graph disabled\".\n\nIt’s usually a good idea to CC the commit author when you bisect a regression (I’ve CC’d Patrick)\n\n\n> At this point, I wonder what the best next step is. I notice that there \n> are two errors listed even when the \"git rebase\" works on v2.53.0, which \n> are not there in the commitGraph=false case. I wonder whether that's a \n> sign that something deeper is not as it should be. I'm happy to provide \n> more details as needed, but I didn't want to touch the repo at this \n> point and possibly lose the repro.\n\nA good next step would be to try to write a from-scratch reproducer :)\n\nCheers,\n\nPhilippe. "}]}