All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Jeff King <peff@peff.net>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, git@vger.kernel.org
Subject: Re: `git gc` says "unable to read" but `git fsck` happy
Date: Thu, 01 Jun 2023 14:04:45 +0200	[thread overview]
Message-ID: <mvm4jnr9yn6.fsf@suse.de> (raw)
In-Reply-To: <20230330181716.GA3286761@coredump.intra.peff.net> (Jeff King's message of "Thu, 30 Mar 2023 14:17:16 -0400")

On Mär 30 2023, Jeff King wrote:

> On Thu, Mar 30, 2023 at 09:01:39AM -0400, Stefan Monnier wrote:
>
>> > If it is the same problem (which would be a blob or maybe cached tree
>> > missing in one of the worktree's index files), then probably you'd
>> > either:
>> >
>> >   1. Accept the loss and blow away that worktree's index file (or
>> >      perhaps even the whole worktree, and just recreate it).
>> 
>> Hmm... the problem is "that": I have about a hundred worktrees for
>> this repository.
>> But yes, I can just throw away all those `index` files, I guess.
>
> If you try "git fsck" from the tip of master, it should identify the
> worktree index that is the source of the problem, I think. You might
> need to pass "--name-objects".

I had the same problem, and after Junio refreshed my memory by pointing
me to this thread, I updated to the brand new git 2.41 and re-ran git
fsck.  That duely identified problems in two of the worktree indexes
(invalid sha1 pointer in resolve-undo).  After recreating those indexes
there were no more complaints from git gc.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

      reply	other threads:[~2023-06-01 12:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29 22:05 `git gc` says "unable to read" but `git fsck` happy Stefan Monnier
2023-03-29 23:37 ` Jeff King
2023-03-30 13:01   ` Stefan Monnier
2023-03-30 18:17     ` Jeff King
2023-06-01 12:04       ` Andreas Schwab [this message]

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=mvm4jnr9yn6.fsf@suse.de \
    --to=schwab@suse.de \
    --cc=git@vger.kernel.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=peff@peff.net \
    /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.