{"thread":{"id":"47231","subject":"Is it not bug git stash -- <pathspec> does not work at non-root directory?","startedAt":"2017-11-18T03:37:07Z","lastAt":"2017-11-18T11:36:41Z","messageCount":6,"participants":["小川恭史","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"332787","messageId":"CAC2Jkr+brEKLy-z45WwP2iqssA14na9xpaCoKrNKbPcTvtUxJA@mail.gmail.com","threadId":"47231","inReplyTo":null,"subject":"Is it not bug git stash -- <pathspec> does not work at non-root directory?","fromName":"小川恭史","fromEmail":"aiueogawa217@gmail.com","sentAt":"2017-11-18T03:37:01Z","receivedAt":"2017-11-18T03:37:07Z","isPatch":false,"sender":{"key":"aiueogawa217@gmail.com","avatar":null},"body":"Is it not bug git stash -- <pathspec> does not work at non-root directory?\n"},{"id":"332790","messageId":"xmqqzi7kp7j2.fsf@gitster.mtv.corp.google.com","threadId":"47231","inReplyTo":"CAC2Jkr+brEKLy-z45WwP2iqssA14na9xpaCoKrNKbPcTvtUxJA@mail.gmail.com","subject":"Re: Is it not bug git stash -- <pathspec> does not work at non-root directory?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-18T03:53:05Z","receivedAt":"2017-11-18T03:53:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"小川恭史 <aiueogawa217@gmail.com> writes:\n\n> Is it not bug git stash -- <pathspec> does not work at non-root directory?\n\nPlease make it a habit (not limited to when interacting with _this_\nproject) to state a bit more than \"does not work\"; instead, say \"it\nis expected to do X, but instead it does Y, and the difference\nbetween X and Y I perceive is Z\".\n\nIf you mean\n\n\tcd sub && git stash -- Makefile\n\ndoes not make a stash for only sub/Makefile and instead makes (or\nattempts to make) a stash for only Makefile at the top-level, then\nI think it is a bug, whose likely cause is that the implementation\nforgets to prepend the $prefix to the pathspec it got from the\ncommand line.  But I am writing this without looking at the\nimplementation and with your unclear description of the issue, so\nI may be completely off the mark ;-)\n\nThanks.\n"},{"id":"332792","messageId":"CAC2JkrLWVEHvV7tf24bPmVEDpgnrKTFtHR5UHMh+kC8v_fWumA@mail.gmail.com","threadId":"47231","inReplyTo":"xmqqzi7kp7j2.fsf@gitster.mtv.corp.google.com","subject":"Re: Is it not bug git stash -- <pathspec> does not work at non-root directory?","fromName":"小川恭史","fromEmail":"aiueogawa217@gmail.com","sentAt":"2017-11-18T04:12:29Z","receivedAt":"2017-11-18T04:12:34Z","isPatch":false,"sender":{"key":"aiueogawa217@gmail.com","avatar":null},"body":"> Please make it a habit (not limited to when interacting with _this_\nproject) to state a bit more than \"does not work\"; instead, say \"it\nis expected to do X, but instead it does Y, and the difference\nbetween X and Y I perceive is Z\".\n\nThanks. I'll rewrite the issue.\n\nAssuming that we have sub/something and something is not included anywhere else,\n\n        cd sub && git stash -- something\n\n is expected to make a stash for sub/something but instead returns error like\n\n        error: pathspec 'something' did not match any file(s) known to git.\n        Did you forget to 'git add'?\n\n.\n\nI don't know what I should write about 'the difference between X and Y is Z'.\n\n2017-11-18 12:53 GMT+09:00 Junio C Hamano <gitster@pobox.com>:\n> 小川恭史 <aiueogawa217@gmail.com> writes:\n>\n>> Is it not bug git stash -- <pathspec> does not work at non-root directory?\n>\n> Please make it a habit (not limited to when interacting with _this_\n> project) to state a bit more than \"does not work\"; instead, say \"it\n> is expected to do X, but instead it does Y, and the difference\n> between X and Y I perceive is Z\".\n>\n> If you mean\n>\n>         cd sub && git stash -- Makefile\n>\n> does not make a stash for only sub/Makefile and instead makes (or\n> attempts to make) a stash for only Makefile at the top-level, then\n> I think it is a bug, whose likely cause is that the implementation\n> forgets to prepend the $prefix to the pathspec it got from the\n> command line.  But I am writing this without looking at the\n> implementation and with your unclear description of the issue, so\n> I may be completely off the mark ;-)\n>\n> Thanks.\n"},{"id":"332793","messageId":"xmqqmv3kow92.fsf@gitster.mtv.corp.google.com","threadId":"47231","inReplyTo":"CAC2JkrLWVEHvV7tf24bPmVEDpgnrKTFtHR5UHMh+kC8v_fWumA@mail.gmail.com","subject":"Re: Is it not bug git stash -- <pathspec> does not work at non-root directory?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-18T07:56:41Z","receivedAt":"2017-11-18T07:56:50Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"小川恭史 <aiueogawa217@gmail.com> writes:\n\n>> Please make it a habit (not limited to when interacting with\n>> _this_ project) to state a bit more than \"does not work\";\n>> instead, say \"it is expected to do X, but instead it does Y, and\n>> the difference between X and Y I perceive is Z\".\n>\n> Thanks. I'll rewrite the issue.\n>\n> Assuming that we have sub/something and something is not included anywhere else,\n>\n>         cd sub && git stash -- something\n>\n>  is expected to make a stash for sub/something but instead returns error like\n>\n>         error: pathspec 'something' did not match any file(s) known to git.\n>         Did you forget to 'git add'?\n>\n> .\n>\n> I don't know what I should write about 'the difference between X and Y is Z'.\n\nIf the difference between X and Y is obvious there is no need.  \n\nI just tried it and I do not see the command is broken in the way\nyou describe.\n\nTrial #1 -- the command fully spelled out.\n\n    $ git.git/master: cd Documentation\n    $ Documentation/master: echo >>Makefile\n    $ Documentation/master: git stash push -m \"doc-make\" -- Makefile\n    Saved working directory and index state On master: doc-make\n    $ Documentation/master: git stash show --stat \n     Documentation/Makefile | 1 +\n     1 file changed, 1 insertion(+:\n\nTrial #2 -- lazily issue the command without subcommand.\n\n    $ git.git/master: cd Documentation\n    $ Documentation/master: echo >>Makefile\n    $ Documentation/master: git stash -- Makefile\n    Saved working directory and index state WIP on master: 89ea799ffc Sync with maint\n    $ Documentation/master: git stash show --stat \n     Documentation/Makefile | 1 +\n     1 file changed, 1 insertion(+:\n\nTrial #3 -- make sure having files with the same name is not hiding any bug.\n\n    $ git.git/master: cd Documentation\n    $ Documentation/master: echo >>CodingGuidelines\n    $ Documentation/master: git stash -- CodingGuidelines\n    Saved working directory and index state WIP on master: 89ea799ffc\n    $ Documentation/master: git stash show --stat\n     Documentation/CodingGuidelines | 1 +\n      1 file changed, 1 insertion(+)\n\nTrial #4 -- simulate a PEBKAC\n\n    $ git.git/master: cd Documentation\n    $ Documentation/master: echo >>no-such-file\n    $ Documentation/master: git stash -- no-such-file\n    error: pathspec 'Documentation/no-such-file' did not match any file(s) known to git.\n    Did you forget to 'git add'?\n\nThe last one is an expected result---the pathspec given to the\ncommand does not match anything tracked, so without first adding the\nfile, there is nothing for the command to do.\n\n"},{"id":"332795","messageId":"CAC2Jkr+TkqnZ+rZVxZNv80rpJHf-BBNZqXZqW+hBVZ8hRrPRSw@mail.gmail.com","threadId":"47231","inReplyTo":"xmqqmv3kow92.fsf@gitster.mtv.corp.google.com","subject":"Re: Is it not bug git stash -- <pathspec> does not work at non-root directory?","fromName":"小川恭史","fromEmail":"aiueogawa217@gmail.com","sentAt":"2017-11-18T09:08:37Z","receivedAt":"2017-11-18T09:08:49Z","isPatch":false,"sender":{"key":"aiueogawa217@gmail.com","avatar":null},"body":"I upgraded the version of git from 2.13.1 to 2.15.0 on Mac and fixed my issue.\nThanks.\n\n2017-11-18 16:56 GMT+09:00 Junio C Hamano <gitster@pobox.com>:\n> 小川恭史 <aiueogawa217@gmail.com> writes:\n>\n>>> Please make it a habit (not limited to when interacting with\n>>> _this_ project) to state a bit more than \"does not work\";\n>>> instead, say \"it is expected to do X, but instead it does Y, and\n>>> the difference between X and Y I perceive is Z\".\n>>\n>> Thanks. I'll rewrite the issue.\n>>\n>> Assuming that we have sub/something and something is not included anywhere else,\n>>\n>>         cd sub && git stash -- something\n>>\n>>  is expected to make a stash for sub/something but instead returns error like\n>>\n>>         error: pathspec 'something' did not match any file(s) known to git.\n>>         Did you forget to 'git add'?\n>>\n>> .\n>>\n>> I don't know what I should write about 'the difference between X and Y is Z'.\n>\n> If the difference between X and Y is obvious there is no need.\n>\n> I just tried it and I do not see the command is broken in the way\n> you describe.\n>\n> Trial #1 -- the command fully spelled out.\n>\n>     $ git.git/master: cd Documentation\n>     $ Documentation/master: echo >>Makefile\n>     $ Documentation/master: git stash push -m \"doc-make\" -- Makefile\n>     Saved working directory and index state On master: doc-make\n>     $ Documentation/master: git stash show --stat\n>      Documentation/Makefile | 1 +\n>      1 file changed, 1 insertion(+:\n>\n> Trial #2 -- lazily issue the command without subcommand.\n>\n>     $ git.git/master: cd Documentation\n>     $ Documentation/master: echo >>Makefile\n>     $ Documentation/master: git stash -- Makefile\n>     Saved working directory and index state WIP on master: 89ea799ffc Sync with maint\n>     $ Documentation/master: git stash show --stat\n>      Documentation/Makefile | 1 +\n>      1 file changed, 1 insertion(+:\n>\n> Trial #3 -- make sure having files with the same name is not hiding any bug.\n>\n>     $ git.git/master: cd Documentation\n>     $ Documentation/master: echo >>CodingGuidelines\n>     $ Documentation/master: git stash -- CodingGuidelines\n>     Saved working directory and index state WIP on master: 89ea799ffc\n>     $ Documentation/master: git stash show --stat\n>      Documentation/CodingGuidelines | 1 +\n>       1 file changed, 1 insertion(+)\n>\n> Trial #4 -- simulate a PEBKAC\n>\n>     $ git.git/master: cd Documentation\n>     $ Documentation/master: echo >>no-such-file\n>     $ Documentation/master: git stash -- no-such-file\n>     error: pathspec 'Documentation/no-such-file' did not match any file(s) known to git.\n>     Did you forget to 'git add'?\n>\n> The last one is an expected result---the pathspec given to the\n> command does not match anything tracked, so without first adding the\n> file, there is nothing for the command to do.\n>\n"},{"id":"332799","messageId":"xmqqine7q0n3.fsf@gitster.mtv.corp.google.com","threadId":"47231","inReplyTo":"CAC2Jkr+TkqnZ+rZVxZNv80rpJHf-BBNZqXZqW+hBVZ8hRrPRSw@mail.gmail.com","subject":"Re: Is it not bug git stash -- <pathspec> does not work at non-root directory?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-18T11:36:32Z","receivedAt":"2017-11-18T11:36:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"小川恭史 <aiueogawa217@gmail.com> writes:\n\n> I upgraded the version of git from 2.13.1 to 2.15.0 on Mac and fixed my issue.\n> Thanks.\n\nAh, yes, that bug was fixed in the 2.14.0 timeframe but was\nbackported to 2.13.2 and onwards (it was a bug in 2.13.0, I think).\n\n"}]}