Re: fatal: unable to read <hash>

From: Warner Losh <imp_at_bsdimp.com>
Date: Wed, 02 Aug 2023 21:43:09 UTC
On Sun, Jul 30, 2023 at 7:23 PM Bjoern A. Zeeb <
bzeeb-lists@lists.zabbadoz.net> wrote:

> On Tue, 25 Jul 2023, Warner Losh wrote:
>
> > Have you tried cloning the repo?
>
> % git clone freebsd-src freebsd-src.x
> Cloning into 'freebsd-src.x'...
> done.
> Updating files: 100% (94839/94839), done.
> %
>
> Seems to run through without trouble like that.  Are you suggesting that
> I might just change my .git/config on the new one to point in the right
> diretions again and use the cloned one (also re-establishing the
> worktrees)?
>

I'm saying that if Marc and you can't work out why things are bad, cloning
should preserve all the branches and you won't lose any work. You could
script recreating the work trees, though that's a lot of disk and gets
tricky
if you like to stash changes...

Worst case, though, is you'd have to clone the upstream repo and the fetch
branches one at a time until you found the one causing the error (well,
you'd
fetch the rest, but then you'd know the problem child at least).

I suspect it's a dangling reference somewhere that didn't get GC'd quite
right
and that it's an edge case in cleanup, but fixing botched repos is way above
my pay grade.

Good luck and hope it all works out. And if there's anything I can do to
help
further, please let me know.

Warner