git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git gc error with git 2.37.2? (Introduced in 5a5ea141e7)
       [not found] <ebb035c1-d313-4f8e-b850-a6e11eeb374bn@googlegroups.com>
@ 2022-10-17 17:10 ` Paul Wagland
  2022-10-17 17:42   ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Wagland @ 2022-10-17 17:10 UTC (permalink / raw)
  To: git

Hi all,

On git-users, I started a discussion(*) about a git gc error that I was getting that started with git 2.37.2. After some followup from Mathias on that list, I have determined that the issues that I a having started with the following commit:  https://github.com/git/git/commit/5a5ea141e7 ("revision: mark blobs needed for resolve-undo as reachable", 2022-06-09)

When I compile git locally with:
   git checkout dc8c8deaa6
   make
   git rev-list --objects --indexed-objects

Then it works.

   git checkout 5a5ea141e7
   make
   git rev-list --objects --indexed-objects

Then I get the error:
   fatal: missing blob object ‘1d0f34d1c4314efcff527847755e4ccc77d44fb6'

How can I further diagnose how to fix this?

Cheers,
Paul

(*) discussion on git-users: https://groups.google.com/g/git-users/c/MKpmgpSC7xw/m/R5rLYDxJAgAJ

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

* Re: git gc error with git 2.37.2? (Introduced in 5a5ea141e7)
  2022-10-17 17:10 ` git gc error with git 2.37.2? (Introduced in 5a5ea141e7) Paul Wagland
@ 2022-10-17 17:42   ` Jeff King
  2022-10-17 18:25     ` Paul Wagland
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2022-10-17 17:42 UTC (permalink / raw)
  To: Paul Wagland; +Cc: git

On Mon, Oct 17, 2022 at 07:10:44PM +0200, Paul Wagland wrote:

> On git-users, I started a discussion(*) about a git gc error that I was getting that started with git 2.37.2. After some followup from Mathias on that list, I have determined that the issues that I a having started with the following commit:  https://github.com/git/git/commit/5a5ea141e7 ("revision: mark blobs needed for resolve-undo as reachable", 2022-06-09)
> 
> When I compile git locally with:
>    git checkout dc8c8deaa6
>    make
>    git rev-list --objects --indexed-objects
> 
> Then it works.
> 
>    git checkout 5a5ea141e7
>    make
>    git rev-list --objects --indexed-objects
> 
> Then I get the error:
>    fatal: missing blob object ‘1d0f34d1c4314efcff527847755e4ccc77d44fb6'
> 
> How can I further diagnose how to fix this?

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.

-Peff

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

* Re: git gc error with git 2.37.2? (Introduced in 5a5ea141e7)
  2022-10-17 17:42   ` Jeff King
@ 2022-10-17 18:25     ` Paul Wagland
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Wagland @ 2022-10-17 18:25 UTC (permalink / raw)
  To: Jeff King; +Cc: git

Hi Peff,

> 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.

Thanks! This did the trick for me! I suspect that the problem happened at some point in the past, when I was doing a git merge and git gc concurrently. A whole whack of stuff required recovering at that point in time, and it all appeared to work with the old version. But probably something was still left in the index that referred to, indirectly, 1d0f34d1c.

My problem is now solved, I’ll also feed this back to git-users. Thanks!

Cheers,
Paul

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

end of thread, other threads:[~2022-10-17 18:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <ebb035c1-d313-4f8e-b850-a6e11eeb374bn@googlegroups.com>
2022-10-17 17:10 ` git gc error with git 2.37.2? (Introduced in 5a5ea141e7) Paul Wagland
2022-10-17 17:42   ` Jeff King
2022-10-17 18:25     ` Paul Wagland

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).