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

Re: Bug report: git stash

From
JSJohn Sockwell <john@plasticcircus.com>
Date
Nov 20, 2019, 17:26 UTC
Message-ID
<B173575D-E845-498A-A3E4-5AF894215475@plasticcircus.com>
In-Reply-To
<DB3F5927-76A4-43F1-8A09-EEB7D0B6F720@plasticcircus.com>
Show 43 quoted lines
> On 2019.11.20, at 12:20, John Sockwell <John@plasticcircus.com> wrote:
> 
> 
> Hello,
> 
> I’ve encountered unexpected behavior using the `git stash pop —quiet` after the pop the all the files in the repo are untracked.
> 
> My software versions: 
>> macOS Catalina 10.15.1
>> zsh 5.7.1
>> git 2.24.0
> 
> Steps to reproduce:
>> Create an empty repo: `mkdir /tmp/git; cd /tmp/git; git init`
>> Commit an empty file: `touch sample-file; git add sample-file; git commit --message "Initial commit”`
>> Modify the sample file: `echo "modification" > sample-file`
>> Stash the dirty tree: `git stash push`
>> Pop the stash: `git stash pop` — working tree returned to dirty state with modified: sample file
>> Stash the dirty tree again: `git stash push`
>> Pop the stash using the —quiet option: `git stash pop —quiet`
> 
> Expected result: Same behavior as without the —quiet option. Working tree to again be returned to dirty state with modified: sample-file
>> `git status`
>> On branch master
>> Changes not staged for commit:
>>   (use "git add <file>..." to update what will be committed)
>>   (use "git restore <file>..." to discard changes in working directory)
>> 	modified:   sample-file
>> 
>> no changes added to commit (use "git add" and/or "git commit -a”)
>> 
> Actual result: working tree is dirty with a different set of changes deleted: sample-file, untracked files: sample-file
>> `git status`
>> On branch master
>> Changes to be committed:
>>   (use "git restore --staged <file>..." to unstage)
>> 	deleted:    sample-file
>> 
>> Untracked files:
>>   (use "git add <file>..." to include in what will be committed)
>> 	sample-file
> 
> 
Next: SZEDER Gábor
Message 1 of 2 in “Re: Bug report: git stash”
  1. John SockwellNov 20, 2019
  2. SZEDER GáborNov 20, 2019

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.