Subject: Please use distinct messages for "unable to read" errors (with corrupt repo after "git stash -k")

From: Daniel Hahler <[email-masked]>
Date: Wed, 18 Feb 2015 20:56:06 +0100

Hi,

I've just experienced an issue, where the system hung after "git stash -k",
and I've had to use Alt-SysRq-REISUB to reboot.

Afterwards "git diff" and "git status" failed with:

"fatal: unable to read 7eaa1fb32551b16198924bfb8b9d3674fed2a59a"

When looking at Git's source I've found several places that use the same call
to `die`:

    die(_("unable to read %s")

I think it would be more helpful to have distinct messages for each of them,
which would at least make it easier to find out where it is failing.

As for the issue at hand, I could not find the reference `7eaa1fb3` anywhere,
except for it being an empty object in .git/objects, which I've deleted then.

It looked like 7eaa1fb should have become the new stash reference, but then
the system crash happened before it has been finished/done.

But where did Git pick it from after reboot / with the corrupt repo?

I could fix it by cloning the repository locally again, and then
copying/merging the configuration, stash references etc.

I was using Git v2.3.0 when this happened.

Regards,
Daniel.

-- 
http://daniel.hahler.de/