Re: [PATCH 2/2] fsck: report errors if reflog entries point at invalid objects
- From
Jeff King <peff@peff.net>
- Date
- Jun 8, 2015, 16:56 UTC
- Message-ID
- <20150608165643.GA6863@peff.net>
- In-Reply-To
- <c5720357601be135485ef546cae7ffdb@www.dscho.org>
On Mon, Jun 08, 2015 at 06:00:09PM +0200, Johannes Schindelin wrote:
Show 11 quoted lines
> >> I like the idea, but I am a bit uncertain whether it would constitute > >> "too backwards-incompatible" a change to make this an error. I think > >> it could be argued both ways: it *is* an improvement, but it could > >> also possibly disrupt scripts that work pretty nicely at the moment. > > > > What kind of script are you worried about? > > I was concerned about scripts that work on repositories whose reflogs > become inconsistent for whatever reason (that happened a lot to me in > the past, IIRC it had something to do with bare repositories and/or > shared object databases).
I think these repositories are already broken. You cannot run `git gc` in such a repository, as it will barf when trying to walk the reflog tips during `git repack`.
We run into this exact situation at GitHub because of our shared object databases. Our per-fork repack code basically has to do:
if ! git repack ...; then
git reflog expire --expire-unreachable=all --all &&
git repack ... ||
die "ok, it really is broken"
fi-Peff