Hi Mathias, Based on the above, I contacted the git list, and got a response from Jeff: > It sounds like there's a resolve-undo extension in your index that references that blob, but the blob was removed from the repository (probably by a gc prior to 5a5ea141e7, which was trying to prevent this corruption). > > I'd expect that the resolve-undo extension would eventually be dropped once a merge is finished, but I'm not very familiar with that code. Is the repository in question mid-merge, or does it happen all the time? > > If there are no changes you need to keep in the index or working tree, I expect that a workaround would be: > > rm -f .git/index > git reset > git update-index --refresh > > to rewrite the index from scratch. Then the problem should not recur, as you'd be using a version with 5a5ea141e7 from here on out.
I did this, and my problem is now solved. Cheers, Paul On Monday, October 17, 2022 at 7:00:44 PM UTC+2 Paul Wagland wrote: > Hi Mathias, > > I have not figured out a solution yet, I have just pinned my git to 2.37.1 > and continued on, I haven't circled back to look at this yet. > > In the meantime 2.38.0 is also released, and that has the same issue for > me. > > I did some further testing based on your feedback, and building git > locally, I can confirm that git built with dc8c8deaa6 works for me, while > git built with 5a5ea141e7 fails with the aforementioned error. > > Cheers, > Paul > > On Monday, October 17, 2022 at 4:49:58 PM UTC+2 Mathias Rav wrote: > >> On Friday, September 16, 2022 at 12:35:24 AM UTC+2 Paul wrote: >> >>> However, when I upgrade to git 2.37.2, or 2.37.3, git gc suddenly starts >>> to fail: >> >> fatal: unable to read 1d0f34d1c4314efcff527847755e4ccc77d44fb6 >>> >>> fatal: failed to run repack >>> >> How can I work out what reference is causing this hash to be referenced? >>> I would most likely be perfectly happy to drop whatever reference it is, if >>> I could just move to a newer version of git, and continue using git gc. >>> >> >> Hi Paul >> >> I have the same issue - did you figure this out yet? >> >> I suspect that this issue comes from the following commit: >> https://github.com/git/git/commit/5a5ea141e7 ("revision: mark blobs >> needed for resolve-undo as reachable", 2022-06-09) >> >> For me, a similar error message also appears when I simply run `git >> rev-list --objects --indexed-objects`. >> >> Commit 5a5ea141e7 added a function add_resolve_undo_to_pending(), which >> calls lookup_blob() and checks if that returns NULL. However as far as I >> can tell, lookup_blob() almost never returns NULL - it especially doesn't >> return NULL for arbitrary non-existent object ids. >> >> This is as far as I've gotten in my debugging of this error so far - I >> thought I'd share it here. >> >> Kind regards >> Mathias Rav >> > -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/c2704644-91ea-45c4-a6b5-49767532ea43n%40googlegroups.com.
