git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
DHDaniel Hahler <genml+git-2014@thequod.de>
Date
Feb 18, 2015, 19:56 UTC
Message-ID
<54E4EE56.3080703@thequod.de>
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/
Message 1 of 1 in “Please use distinct messages for "unable to read" errors (with corrupt repo after "git stash -k")”
  1. Daniel HahlerFeb 18, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.