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

Bug in git-stash

From
FSFilip Skogstjärna <f.skogstjarna@gmail.com>
Date
Apr 11, 2025, 12:27 UTC
Message-ID
<AE8657E8-D68A-4B86-9644-B57AEE743794@gmail.com>

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
edit a file
`git add <file>`
edit the same line again
`git stash -k`

What did you expect to happen? (Expected behavior) I expect the stash to contain the diff between the staged file and the unstaged file

What happened instead? (Actual behavior) The stash contains the diff between HEAD and the unstaged file

What's different between what you expected and what actually happened? The difference is that `git stash pop` will result in a merge conflict, even though no files has been changed between stashing and unstashing.

Anything else you want to add:

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.39.5 (Apple Git-154) cpu: arm64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon uname: Darwin 23.6.0 Darwin Kernel Version 23.6.0: Fri Nov 15 15:11:49 PST 2024; root:xnu-10063.141.1.702.7~1/RELEASE_ARM64_T6020 arm64 compiler info: clang: 16.0.0 (clang-1600.0.26.6) libc info: no libc information available $SHELL (typically, interactive shell): /bin/zsh

Next: D. Ben Knoble
Message 1 of 3 in “Bug in git-stash”
  1. Filip SkogstjärnaApr 11, 2025
  2. D. Ben KnobleApr 11, 2025
  3. Lucas Seiki OshiroApr 12, 2025

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.