From: Philippe Blain <levraiphilippeblain@gmail.com>
To: flosch@nutanix.com
Cc: Patrick Steinhardt <ps@pks.im>, Git mailing list <git@vger.kernel.org>
Subject: [BUG] "commit graph is likely corrupt" on git rebase
Date: Thu, 6 Aug 2026 15:44:25 -0400 [thread overview]
Message-ID: <4983BE1D-4099-4CAF-9374-459F7913982A@gmail.com> (raw)
Hi Florian,
Florian Schmidt <flosch@nutanix.com> wrote:
> Hiya,
>
> Hitting an issue during git rebase. I am starting to suspect git is
> possibly getting confused between main and submodule repos. I noticed
> this with a self-compiled git 2.54, but I compiled git v2.55 just now,
> and seem to hit the same issue still. Full bisect at the end of the message.
>
> The first-order issue, trying to rebase a work/foo branch which is
> tracking origin/master. There's only one commit difference, a commit
> that changes two submodule pointers:
>
>> devvm:~/gitrepo[git:work/foo *%|u+1-116]$ git show --format="" -p
>> diff --git a/rpmsrc/kernel b/rpmsrc/kernel
>> index d8d411244..17006b605 160000
>> --- a/rpmsrc/kernel
>> +++ b/rpmsrc/kernel
>> @@ -1 +1 @@
>> -Subproject commit d8d411244cfb3463ce09b9577970f7955073ed14
>> +Subproject commit 17006b605eaed1820ae1c717d4782728b9afc6d3
>> diff --git a/rpmsrc/qemu-kvm b/rpmsrc/qemu-kvm
>> index e7d525d0f..8bf4019df 160000
>> --- a/rpmsrc/qemu-kvm
>> +++ b/rpmsrc/qemu-kvm
>> @@ -1 +1 @@
>> -Subproject commit e7d525d0fdc42fca65c2b70bb5f56adc5aa1d7b1
>> +Subproject commit 8bf4019dfcb320108a0f014d92d926320a4c8058
>>
>> devvm:~/gitrepo[git:work/foo *%|u+1-116]$ git rebase
>> error: Could not read 157b7492624beac3ac667dd3a84de9969377866b
>> fatal: invalid commit position. commit-graph is likely corrupt
>>
>> devvm:~/gitrepo[git:work/foo *%|u+1-116]$ git cat-file -t 157b7492624beac3ac667dd3a84de9969377866b
>> fatal: git cat-file: could not get object info
>
> git fsck reported no corruption, just a bunch of dangling
> commits/trees/blobs, no warnings about
> 157b7492624beac3ac667dd3a84de9969377866b
>
> Now, hint 1: the rebase *does* work when disabling commit-graphs:
>
>> devvm:~/gitrepo[git:work/foo *%|u+1-116]$ git -c core.commitGraph=false rebase origin/master
>> Rebasing (1/1)
>> [... thinking thinking thinking for a long time ...]
>> Failed to merge submodule rpmsrc/kernel
>> CONFLICT (submodule): Merge conflict in rpmsrc/kernel
>> Failed to merge submodule rpmsrc/qemu-kvm
>> CONFLICT (submodule): Merge conflict in rpmsrc/qemu-kvm
>> [...]
>
> which is fair enough, the submodule pointers moved.
> And hint 2:
>
>> $ git cat-file -t 157b7492624beac3ac667dd3a84de9969377866b
>> fatal: git cat-file: could not get object info
>> $ git -C rpmsrc/kernel cat-file -t 157b7492624beac3ac667dd3a84de9969377866b
>> fatal: git cat-file: could not get object info
>> $ git -C rpmsrc/qemu-kvm cat-file -t 157b7492624beac3ac667dd3a84de9969377866b
>> commit
>
> So it tries to identify something on the submodule? Maybe it gets
> confused between submodule and main repo(?)
>
> For good measure, I did a git fsck --full on rpmsrc/qemu-kvm, but again
> only a few dangling warnings, and no change to the issue.
> So I went to bisect and noticed the issue appeared somewhere between
> v2.53 and v2.54. v2.53 also complains, but then continues:
>
>> $ ~/upstream/git/git rebase
>> error: Could not read 157b7492624beac3ac667dd3a84de9969377866b
>> error: Could not read 95d676ad199191d81a000761733ea25c17172d8b
>> Failed to merge submodule rpmsrc/kernel (commits don't follow merge-base)
>> CONFLICT (submodule): Merge conflict in rpmsrc/kernel
>> Failed to merge submodule rpmsrc/qemu-kvm (commits don't follow merge-base)
>> CONFLICT (submodule): Merge conflict in rpmsrc/qemu-kvm
>> [...]
>
> In any case, to figure out the cause, I bisected it down to commit
> bb5da75d61 ("commit: use commit graph in
> `lookup_commit_reference_gently()`"), which makes sense in the context
> of "it works with commit-graph disabled".
It’s usually a good idea to CC the commit author when you bisect a regression (I’ve CC’d Patrick)
> At this point, I wonder what the best next step is. I notice that there
> are two errors listed even when the "git rebase" works on v2.53.0, which
> are not there in the commitGraph=false case. I wonder whether that's a
> sign that something deeper is not as it should be. I'm happy to provide
> more details as needed, but I didn't want to touch the repo at this
> point and possibly lose the repro.
A good next step would be to try to write a from-scratch reproducer :)
Cheers,
Philippe.
next reply other threads:[~2026-08-06 19:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 19:44 Philippe Blain [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-07-31 9:05 [BUG] "commit graph is likely corrupt" on git rebase Florian Schmidt
2026-08-10 13:43 ` Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4983BE1D-4099-4CAF-9374-459F7913982A@gmail.com \
--to=levraiphilippeblain@gmail.com \
--cc=flosch@nutanix.com \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.