Re: Help with "fatal: unable to read ...." error during GC?
- From
Paul Smith <paul@mad-scientist.net>
- Date
- Aug 8, 2018, 17:35 UTC
- Message-ID
- <b247434b62ccd30f32adbebb83fa6ea12b51b6ff.camel@mad-scientist.net>
- In-Reply-To
- <20180808160612.GC1607@sigill.intra.peff.net>
On Wed, 2018-08-08 at 12:06 -0400, Jeff King wrote:
Show 16 quoted lines
> I'd have expected fsck to find it, too. However, looking at the code, > I'm not convinced that fsck is actually considering detached worktree > heads properly, either. Try: > > git rev-list --all --reflog --objects >/dev/null > > which I know checks worktrees correctly. I'd expect that to fail. > > If it does, then we need to narrow down which worktree is corrupt. > Perhaps something like: > > git worktree list | > while read worktree head junk; do > git rev-list --objects $head >/dev/null || > echo "$worktree seems corrupt" > done
Thanks for the note! Unhappily for me none of these operations seem to find any actionable problems...
$ git rev-list --all --reflog --objects >/dev/null warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits warning: reflog of 'HEAD' references pruned commits $ echo $? 0
$ git worktree list | while read wt head junk; do \ git rev-list --objects $head >/dev/null || echo "$wt seems corrupt"; \ done $
Just to be sure I updated the loop above to echo $wt and $head and they were correct. I also re-ran git gc after the above and still got the original error output so it didn't magically fix itself :).