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

Bug: stash staged file move loses original file deletion

From
MPMatthew Patey <matthew.patey2167@gmail.com>
Date
Dec 5, 2016, 14:37 UTC
Message-ID
<CAFQpxxKbn4vBMzVcLZgBVvuL2fsOGNMHR1WC+aTOG_RAWkZ_Gg@mail.gmail.com>
Git version 2.8.0 (sorry can't update to more recent on my machine) on Ubuntu.

After moving a file, if the new file is in the index but the deletion of the old file is not staged, git stash loses the deletion operation. Repro:

1. git mv a b
This will have both the "deletion" and the "file added" in the index
2. git stash; git stash pop
Now file a is still in the index, but file b deletion is not staged.
3. git stash; git stash show -v
This will show that the deletion operation is not in the stash
4. git stash pop
Again confirms the issue, file a is in the index, but file b is
present and unmodified in the working directory.
Next: Jeff King
Message 1 of 13 in “Bug: stash staged file move loses original file deletion”
  1. Matthew PateyDec 5, 2016
  2. Jeff KingDec 6, 2016
  3. Jeff KingDec 6, 2016
  4. stash: disable renames when calling git-diffJeff King, Dec 6, 2016
  5. Junio C HamanoDec 6, 2016
  6. Jeff KingDec 6, 2016
  7. Junio C HamanoDec 6, 2016
  8. Jeff KingDec 6, 2016
  9. Junio C HamanoDec 6, 2016
  10. Jeff KingDec 6, 2016
  11. Junio C HamanoDec 6, 2016
  12. Jeff KingDec 6, 2016
  13. Junio C HamanoDec 6, 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.