{"thread":{"id":"40720","subject":"Bug: stash save -u removes (some) ignored files","startedAt":"2015-11-03T22:37:33Z","lastAt":"2015-11-04T12:27:24Z","messageCount":3,"participants":["Felipe Sateler","Atousa Duprat"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"272863","messageId":"CAAfdZj8=pqWDB9U3=bPeKXGzsZvzns2xX8WxEzQAy08wgSm=ZQ@mail.gmail.com","threadId":"40720","inReplyTo":null,"subject":"Bug: stash save -u removes (some) ignored files","fromName":"Felipe Sateler","fromEmail":"fsateler@debian.org","sentAt":"2015-11-03T22:37:33Z","receivedAt":"2015-11-03T22:37:33Z","isPatch":false,"sender":{"key":"fsateler@debian.org","avatar":null},"body":"I have seen the following problem:\n\nfelipe@felipe:testgit% cat .gitignore\n**/notrack/*\n!**/notrack/track/\nnotrackfile**\n\nfelipe@felipe:testgit% find *\nnewfile\nnotrack\nnotrack/1\nnotrackfile1\n\nfelipe@felipe:testgit% git status --porcelain\n?? newfile\n\nfelipe@felipe:testgit% git stash save -u\nSaved working directory and index state WIP on master: 523cb39 Initial commit\nHEAD is now at 523cb39 Initial commit\n\nfelipe@felipe:testgit% find *\nnotrackfile1\n\nSo, after a stash save, git decided to keep the untracked file in the\ncurrent directory, but not the ones inside the untracked directory.\nHowever, the files were \"correctly\" ignored and did not appear on the stash:\n\nfelipe@felipe:testgit% git stash pop\nAlready up-to-date!\nOn branch master\nUntracked files:\n  (use \"git add <file>...\" to include in what will be committed)\n\n        newfile\n\nnothing added to commit but untracked files present (use \"git add\" to track)\nDropped refs/stash@{0} (e6508f345af1dd207557ad0291e7e3bce8a89b1e)\n\nfelipe@felipe:testgit% find *\nnewfile\nnotrackfile1\n\nI think the correct behaviour should be to left the ignored files\nuntouched in both scenarios.\n\nThis is with git 2.6.1 (from debian).\n\nI note that if I add a file inside the notrack/track directory, it is\ncorrectly kept, but the files in notrack/ are still deleted.\n\n-- \n\nSaludos,\nFelipe Sateler\n"},{"id":"272886","messageId":"CA+izobsNJ+Aj6JwFTtZVD_+8m9uXV-iiM7Z2aYWNCnWXFd82Dg@mail.gmail.com","threadId":"40720","inReplyTo":"CAAfdZj8=pqWDB9U3=bPeKXGzsZvzns2xX8WxEzQAy08wgSm=ZQ@mail.gmail.com","subject":"Re: Bug: stash save -u removes (some) ignored files","fromName":"Atousa Duprat","fromEmail":"atousa.p@gmail.com","sentAt":"2015-11-04T06:23:41Z","receivedAt":"2015-11-04T06:23:41Z","isPatch":false,"sender":{"key":"atousa.p@gmail.com","avatar":"https://gravatar.com/avatar/b5b7b70553497c4ce08a835c156ff3b245366eba956fbceff99553b1ccdc4e42?d=mp&s=160"},"body":"> felipe@felipe:testgit% git stash save -u\n\nThis does the following:\n$ GIT_TRACE=1 git stash save -u\n[...]\n21:59:10.606094 git.c:348               trace: built-in: git 'clean'\n'--force' '--quiet' '-d'\n\ngit-clean -d removes untracked directories in addition to untracked files.\nShould 'git stash save -u' issue a 'git clean -d' or simply a 'git clean'?\n\nAtousa\n\nOn Tue, Nov 3, 2015 at 2:37 PM, Felipe Sateler <fsateler@debian.org> wrote:\n> I have seen the following problem:\n>\n> felipe@felipe:testgit% cat .gitignore\n> **/notrack/*\n> !**/notrack/track/\n> notrackfile**\n>\n> felipe@felipe:testgit% find *\n> newfile\n> notrack\n> notrack/1\n> notrackfile1\n>\n> felipe@felipe:testgit% git status --porcelain\n> ?? newfile\n>\n> felipe@felipe:testgit% git stash save -u\n> Saved working directory and index state WIP on master: 523cb39 Initial commit\n> HEAD is now at 523cb39 Initial commit\n>\n> felipe@felipe:testgit% find *\n> notrackfile1\n>\n> So, after a stash save, git decided to keep the untracked file in the\n> current directory, but not the ones inside the untracked directory.\n> However, the files were \"correctly\" ignored and did not appear on the stash:\n>\n> felipe@felipe:testgit% git stash pop\n> Already up-to-date!\n> On branch master\n> Untracked files:\n>   (use \"git add <file>...\" to include in what will be committed)\n>\n>         newfile\n>\n> nothing added to commit but untracked files present (use \"git add\" to track)\n> Dropped refs/stash@{0} (e6508f345af1dd207557ad0291e7e3bce8a89b1e)\n>\n> felipe@felipe:testgit% find *\n> newfile\n> notrackfile1\n>\n> I think the correct behaviour should be to left the ignored files\n> untouched in both scenarios.\n>\n> This is with git 2.6.1 (from debian).\n>\n> I note that if I add a file inside the notrack/track directory, it is\n> correctly kept, but the files in notrack/ are still deleted.\n>\n> --\n>\n> Saludos,\n> Felipe Sateler\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n\n\n-- \nAtousa Pahlevan, PhD\nM.Math. University of Waterloo, Canada\nPh.D. Department of Computer Science, University of Victoria, Canada\nVoice: 415-341-6206\nEmail: apahlevan@ieee.org\nWebsite: www.apahlevan.org\n"},{"id":"272892","messageId":"CAAfdZj_t86AuhU7dgx81-MXFp7Fe=TCZ0uzRu37+FUp80mvy5Q@mail.gmail.com","threadId":"40720","inReplyTo":"CA+izobsNJ+Aj6JwFTtZVD_+8m9uXV-iiM7Z2aYWNCnWXFd82Dg@mail.gmail.com","subject":"Re: Bug: stash save -u removes (some) ignored files","fromName":"Felipe Sateler","fromEmail":"fsateler@debian.org","sentAt":"2015-11-04T12:27:24Z","receivedAt":"2015-11-04T12:27:24Z","isPatch":false,"sender":{"key":"fsateler@debian.org","avatar":null},"body":"On 4 November 2015 at 03:23, Atousa Duprat <atousa.p@gmail.com> wrote:\n>> felipe@felipe:testgit% git stash save -u\n>\n> This does the following:\n> $ GIT_TRACE=1 git stash save -u\n> [...]\n> 21:59:10.606094 git.c:348               trace: built-in: git 'clean'\n> '--force' '--quiet' '-d'\n>\n> git-clean -d removes untracked directories in addition to untracked files.\n> Should 'git stash save -u' issue a 'git clean -d' or simply a 'git clean'?\n\nIt appears to be intentionally done[1]. Maybe the problem is that\ngit-clean -d should not remove untracked directories that contain\nignored files?\n\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/180214\n\n-- \n\nSaludos,\nFelipe Sateler\n"}]}