git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug: stash save -u removes (some) ignored files
@ 2015-11-03 22:37 Felipe Sateler
  2015-11-04  6:23 ` Atousa Duprat
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Sateler @ 2015-11-03 22:37 UTC (permalink / raw)
  To: git

I have seen the following problem:

felipe@felipe:testgit% cat .gitignore
**/notrack/*
!**/notrack/track/
notrackfile**

felipe@felipe:testgit% find *
newfile
notrack
notrack/1
notrackfile1

felipe@felipe:testgit% git status --porcelain
?? newfile

felipe@felipe:testgit% git stash save -u
Saved working directory and index state WIP on master: 523cb39 Initial commit
HEAD is now at 523cb39 Initial commit

felipe@felipe:testgit% find *
notrackfile1

So, after a stash save, git decided to keep the untracked file in the
current directory, but not the ones inside the untracked directory.
However, the files were "correctly" ignored and did not appear on the stash:

felipe@felipe:testgit% git stash pop
Already up-to-date!
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        newfile

nothing added to commit but untracked files present (use "git add" to track)
Dropped refs/stash@{0} (e6508f345af1dd207557ad0291e7e3bce8a89b1e)

felipe@felipe:testgit% find *
newfile
notrackfile1

I think the correct behaviour should be to left the ignored files
untouched in both scenarios.

This is with git 2.6.1 (from debian).

I note that if I add a file inside the notrack/track directory, it is
correctly kept, but the files in notrack/ are still deleted.

-- 

Saludos,
Felipe Sateler

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-04 12:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-03 22:37 Bug: stash save -u removes (some) ignored files Felipe Sateler
2015-11-04  6:23 ` Atousa Duprat
2015-11-04 12:27   ` Felipe Sateler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).