"Johannes Schindelin via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: > From: Johannes Schindelin <johannes.schindelin@xxxxxx> > > Whenever a user runs `git reflog expire --stale-fix`, the most likely > reason is that their repository is at least _somewhat_ corrupt. Which > means that it is more than just possible that some objects are missing. > > If that is the case, that can currently let the command abort through > the phase where it tries to mark all reachable objects. > > Instead of adding insult to injury, let's be gentle and continue as best > as we can in such a scenario, simply by ignoring the missing objects and > moving on. > > Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx> > --- I am of two minds. I appreciate an effort of making it looser and less likely to get in trouble when running in a corrupt repository, but --stale-fix is a bit special and should probably be removed. The only reason the option was added was because we needed to have an easy way to recover from a specific kind of reflog corruption that would have resulted by a (then known) bug in "git reflog" in the released version of Git that came immediately before the version of Git that added the "fix" option, while the root cause of the corruption got fixed. Back when 1389d9dd (reflog expire --fix-stale, 2007-01-06) was written, it was very useful to have a way to recover from the corruption likely to have happened with the version of Git that came before it. But it no longer is relevant after this many years. There may be other ways to break the reflog entries, but --stale-fix was never designed to deal with anything but a specific way the reflog gets corrupted (namely, by the old version of Git that corrupted reflog in a specific way), so keeping it would not be very useful.