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

Git stash pop with untracked files doesn't unpack untracked if a conflict happens

From
AAAnastasios Andronidis <anastasios.andronidis@gmail.com>
Date
Dec 5, 2021, 19:03 UTC
Message-ID
<52179A8B-CAA8-4729-9BD6-C297CD00BF08@gmail.com>
Dear team,
I want to report some weird behaviour regarding git stash pop and untracked files committed with git stash -u. See the git report below:

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)
1) Created an empty git repo: `git init`
2) Created 1 commit with a single file: `echo "test" >test.txt && git commit -a -m "init"`
3) Made some changes in the file i committed + created a new file: `echo "test2" >test.txt && echo "test2" >test2.txt`
4) Used stash -u to save my changes: `git stash -u`
5) Created a second commit with a different change on the existing file in order to force a conflict: `echo "test3" >test.txt && git commit -a -m "2"`
6) I git stash pop to create a conflict between the second commit and my stash from my first commit: `git stash pop`
What did you expect to happen? (Expected behavior)
I was expecting to have 1 file in conflict stage and the untracked file to be created in my current working directory.
What happened instead? (Actual behavior)
The untracked file is missing.
What's different between what you expected and what actually happened?
The untracked file is missing.
Anything else you want to add:
N/A

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.34.1 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64 x86_64 compiler info: clang: 13.0.0 (clang-1300.0.29.3) libc info: no libc information available $SHELL (typically, interactive shell): /bin/zsh

[Enabled Hooks]

Kindly, Anastasios Andronidis

Message 1 of 1 in “Git stash pop with untracked files doesn't unpack untracked if a conflict happens”
  1. Anastasios AndronidisDec 5, 2021

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.