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

Left with empty files after "git stash pop" when system hung

From
DHDaniel Hahler <genml+git-2016@thequod.de>
Date
Sep 13, 2016, 21:39 UTC
Message-ID
<5b203a8e-faa8-9f6e-8cdd-1024194e74a3@thequod.de>

I have used "git stash --include-untracked", checked out another branch, went back, and "git stash pop"ed the changes. Then my system crashed/hung (music that was playing was repeated in a loop). I have waited for some minutes, and then turned it off.

Afterwards, the repository in question was in a state where all files contained in the stash were empty. "git status" looked good on first sight: all the untracked and modified files were listed there; but they were empty.

  % git fsck --lost-found
  error: object file .git/objects/04/1e659b5dbfd3f0be351a782b54743692875aec is empty
  error: object file .git/objects/04/1e659b5dbfd3f0be351a782b54743692875aec is empty
  fatal: loose object 041e659b5dbfd3f0be351a782b54743692875aec (stored in .git/objects/04/1e659b5dbfd3f0be351a782b54743692875aec) is corrupt
  % find .git/objects -size 0|wc -l
  12

I would have assumed that the "stash pop" operation would be "atomic", i.e. it should not remove the stash object before other objects have been written successfully.

The filesystem in question is ext4, and I am using Arch Linux.

I have removed all empty files in .git/objects and tried to find the previous stash with `gitk --all $( git fsck | awk '{print $3}' )` then, but it appears to have disappeared.

Please CC me in replies.

Cheers, Daniel.

-- 
http://daniel.hahler.de/
Next: Jeff King
Message 1 of 2 in “Left with empty files after "git stash pop" when system hung”
  1. Daniel HahlerSep 13, 2016
  2. Jeff KingSep 14, 2016

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.