{"thread":{"id":"55682","subject":"Git pathspecs difference in behavior between linux (wsl) and windows","startedAt":"2021-05-13T06:57:43Z","lastAt":"2021-05-13T21:17:27Z","messageCount":8,"participants":["Alexandre Remy","Johannes Sixt","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"424429","messageId":"CAKToE5BnzXd_2pjhJY13E=e6b1ZgOV=NmXr_WfpCQd+LxXsO3A@mail.gmail.com","threadId":"55682","inReplyTo":null,"subject":"Git pathspecs difference in behavior between linux (wsl) and windows","fromName":"Alexandre Remy","fromEmail":"alexandre.remy.contact@gmail.com","sentAt":"2021-05-13T06:57:28Z","receivedAt":"2021-05-13T06:57:43Z","isPatch":false,"sender":{"key":"alexandre.remy.contact@gmail.com","avatar":null},"body":"Hi,\n\nI do not understand why the same command works on linux and not on\nwindows. Is the pathspecs syntax differ or there is a problem on the\ngit windows version?\n\n* On windows (git version 2.31.1.windows.1)\n\ngit status -- 'src/test.js'\nOn branch master\nnothing to commit, working tree clean\n\n\n* On linux (wsl: git version 2.25.1)\n\ngit status -- 'src/test.js'\nOn branch master\nChanges not staged for commit:\n  (use \"git add <file>...\" to update what will be committed)\n  (use \"git restore <file>...\" to discard changes in working directory)\n        modified:   src/test.js\nA classic git status gives the same result between linux and windows\n(with correct file detected).\n\nRegards,\n"},{"id":"424440","messageId":"81d06db6-fd91-7ec5-6aa5-84f69a227204@kdbg.org","threadId":"55682","inReplyTo":"CAKToE5BnzXd_2pjhJY13E=e6b1ZgOV=NmXr_WfpCQd+LxXsO3A@mail.gmail.com","subject":"Re: Git pathspecs difference in behavior between linux (wsl) and windows","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2021-05-13T07:49:05Z","receivedAt":"2021-05-13T07:49:19Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 13.05.21 um 08:57 schrieb Alexandre Remy:\n> Hi,\n> \n> I do not understand why the same command works on linux and not on\n> windows. Is the pathspecs syntax differ or there is a problem on the\n> git windows version?\n> \n> * On windows (git version 2.31.1.windows.1)\n> \n> git status -- 'src/test.js'\n> On branch master\n> nothing to commit, working tree clean\n> \n> \n> * On linux (wsl: git version 2.25.1)\n> \n> git status -- 'src/test.js'\n> On branch master\n> Changes not staged for commit:\n>   (use \"git add <file>...\" to update what will be committed)\n>   (use \"git restore <file>...\" to discard changes in working directory)\n>         modified:   src/test.js\n> A classic git status gives the same result between linux and windows\n> (with correct file detected).\n\nWhich shell did you use to invoke the Windows version? If it was from\nCMD or PowerShell, then you must not put the name in single-quotes:\n\n   git status -- src/test.js\n\nThe reason is that the single-quote does not have a special meaning for\nCMD and PowerShell like it does for a POSIX shell.\n\n-- Hannes\n"},{"id":"424442","messageId":"CAKToE5DgtW1Kuw4AE5+Am_=9gATN-S=xk1kYXMZUWvtdtNy_PQ@mail.gmail.com","threadId":"55682","inReplyTo":"81d06db6-fd91-7ec5-6aa5-84f69a227204@kdbg.org","subject":"Re: Git pathspecs difference in behavior between linux (wsl) and windows","fromName":"Alexandre Remy","fromEmail":"alexandre.remy.contact@gmail.com","sentAt":"2021-05-13T08:05:10Z","receivedAt":"2021-05-13T08:05:32Z","isPatch":false,"sender":{"key":"alexandre.remy.contact@gmail.com","avatar":null},"body":"Thank you, that was that. I was misled by the doc and the single-quote\nwhich indeed is specific to the linux platform.\n\nThank you again for your prompt reply.\n\nLe jeu. 13 mai 2021 à 09:49, Johannes Sixt <j6t@kdbg.org> a écrit :\n>\n> Am 13.05.21 um 08:57 schrieb Alexandre Remy:\n> > Hi,\n> >\n> > I do not understand why the same command works on linux and not on\n> > windows. Is the pathspecs syntax differ or there is a problem on the\n> > git windows version?\n> >\n> > * On windows (git version 2.31.1.windows.1)\n> >\n> > git status -- 'src/test.js'\n> > On branch master\n> > nothing to commit, working tree clean\n> >\n> >\n> > * On linux (wsl: git version 2.25.1)\n> >\n> > git status -- 'src/test.js'\n> > On branch master\n> > Changes not staged for commit:\n> >   (use \"git add <file>...\" to update what will be committed)\n> >   (use \"git restore <file>...\" to discard changes in working directory)\n> >         modified:   src/test.js\n> > A classic git status gives the same result between linux and windows\n> > (with correct file detected).\n>\n> Which shell did you use to invoke the Windows version? If it was from\n> CMD or PowerShell, then you must not put the name in single-quotes:\n>\n>    git status -- src/test.js\n>\n> The reason is that the single-quote does not have a special meaning for\n> CMD and PowerShell like it does for a POSIX shell.\n>\n> -- Hannes\n"},{"id":"424452","messageId":"CAKToE5DEL1ZFwUbvcC-M3y-3mSVsVgMXDig4G=jcKbc-nJ_GnQ@mail.gmail.com","threadId":"55682","inReplyTo":"CAKToE5DgtW1Kuw4AE5+Am_=9gATN-S=xk1kYXMZUWvtdtNy_PQ@mail.gmail.com","subject":"Re: Git pathspecs difference in behavior between linux (wsl) and windows","fromName":"Alexandre Remy","fromEmail":"alexandre.remy.contact@gmail.com","sentAt":"2021-05-13T09:31:18Z","receivedAt":"2021-05-13T09:31:35Z","isPatch":false,"sender":{"key":"alexandre.remy.contact@gmail.com","avatar":null},"body":"I have an additional question, does double-quotes be safely used in\nboth windows (that's ok) and linux shell  for pathspecs (git status --\n\"src/test.js\") in case of spaces in the path?\n\nLe jeu. 13 mai 2021 à 10:05, Alexandre Remy\n<alexandre.remy.contact@gmail.com> a écrit :\n>\n> Thank you, that was that. I was misled by the doc and the single-quote\n> which indeed is specific to the linux platform.\n>\n> Thank you again for your prompt reply.\n>\n> Le jeu. 13 mai 2021 à 09:49, Johannes Sixt <j6t@kdbg.org> a écrit :\n> >\n> > Am 13.05.21 um 08:57 schrieb Alexandre Remy:\n> > > Hi,\n> > >\n> > > I do not understand why the same command works on linux and not on\n> > > windows. Is the pathspecs syntax differ or there is a problem on the\n> > > git windows version?\n> > >\n> > > * On windows (git version 2.31.1.windows.1)\n> > >\n> > > git status -- 'src/test.js'\n> > > On branch master\n> > > nothing to commit, working tree clean\n> > >\n> > >\n> > > * On linux (wsl: git version 2.25.1)\n> > >\n> > > git status -- 'src/test.js'\n> > > On branch master\n> > > Changes not staged for commit:\n> > >   (use \"git add <file>...\" to update what will be committed)\n> > >   (use \"git restore <file>...\" to discard changes in working directory)\n> > >         modified:   src/test.js\n> > > A classic git status gives the same result between linux and windows\n> > > (with correct file detected).\n> >\n> > Which shell did you use to invoke the Windows version? If it was from\n> > CMD or PowerShell, then you must not put the name in single-quotes:\n> >\n> >    git status -- src/test.js\n> >\n> > The reason is that the single-quote does not have a special meaning for\n> > CMD and PowerShell like it does for a POSIX shell.\n> >\n> > -- Hannes\n"},{"id":"424466","messageId":"68a4ebd3-3c80-8983-9a26-f205debc4b5b@kdbg.org","threadId":"55682","inReplyTo":"CAKToE5DEL1ZFwUbvcC-M3y-3mSVsVgMXDig4G=jcKbc-nJ_GnQ@mail.gmail.com","subject":"Re: Git pathspecs difference in behavior between linux (wsl) and windows","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2021-05-13T13:02:32Z","receivedAt":"2021-05-13T13:02:39Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 13.05.21 um 11:31 schrieb Alexandre Remy:\n> I have an additional question, does double-quotes be safely used in\n> both windows (that's ok) and linux shell  for pathspecs (git status --\n> \"src/test.js\") in case of spaces in the path?\n\nThey can be used in both POSIX shell and Windows CMD and, I would\nassume, also in the PowerShell. Note though, that there are subtle\ndifferences when other special characters occur between double-quotes,\nnotably the backslash. Please use your favorite search engine to learn more.\n\n-- Hannes\n"},{"id":"424500","messageId":"xmqqeeeabdml.fsf@gitster.g","threadId":"55682","inReplyTo":"68a4ebd3-3c80-8983-9a26-f205debc4b5b@kdbg.org","subject":"Re: Git pathspecs difference in behavior between linux (wsl) and windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-05-13T20:08:34Z","receivedAt":"2021-05-13T20:08:37Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> Am 13.05.21 um 11:31 schrieb Alexandre Remy:\n>> I have an additional question, does double-quotes be safely used in\n>> both windows (that's ok) and linux shell  for pathspecs (git status --\n>> \"src/test.js\") in case of spaces in the path?\n>\n> They can be used in both POSIX shell and Windows CMD and, I would\n> assume, also in the PowerShell. Note though, that there are subtle\n> differences when other special characters occur between double-quotes,\n> notably the backslash. Please use your favorite search engine to learn more.\n\nAnd a dollar sign, in addition to the backslash?\n"},{"id":"424511","messageId":"dbf1e10c-c43c-3293-61b7-eff5fceecb84@kdbg.org","threadId":"55682","inReplyTo":"xmqqeeeabdml.fsf@gitster.g","subject":"Re: Git pathspecs difference in behavior between linux (wsl) and windows","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2021-05-13T21:03:55Z","receivedAt":"2021-05-13T21:03:59Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 13.05.21 um 22:08 schrieb Junio C Hamano:\n> Johannes Sixt <j6t@kdbg.org> writes:\n> \n>> Am 13.05.21 um 11:31 schrieb Alexandre Remy:\n>>> I have an additional question, does double-quotes be safely used in\n>>> both windows (that's ok) and linux shell  for pathspecs (git status --\n>>> \"src/test.js\") in case of spaces in the path?\n>>\n>> They can be used in both POSIX shell and Windows CMD and, I would\n>> assume, also in the PowerShell. Note though, that there are subtle\n>> differences when other special characters occur between double-quotes,\n>> notably the backslash. Please use your favorite search engine to learn more.\n> \n> And a dollar sign, in addition to the backslash?\n\nGranted, there's not a subtle, but a big difference how the dollar sign\nis treated ;) but I don't want to write a tutorial here. Hence, my hint\ntowards a search engine.\n\n-- Hannes\n"},{"id":"424513","messageId":"CAKToE5B7xsNiXV2U4gRJeqEke9Y3gPpFfBwAtBPrvBx4jAx3VQ@mail.gmail.com","threadId":"55682","inReplyTo":"dbf1e10c-c43c-3293-61b7-eff5fceecb84@kdbg.org","subject":"Re: Git pathspecs difference in behavior between linux (wsl) and windows","fromName":"Alexandre Remy","fromEmail":"alexandre.remy.contact@gmail.com","sentAt":"2021-05-13T21:17:13Z","receivedAt":"2021-05-13T21:17:27Z","isPatch":false,"sender":{"key":"alexandre.remy.contact@gmail.com","avatar":null},"body":"Yep, I know, no problem. The primary subject is closed. thank you.\n\nLe jeu. 13 mai 2021 à 23:03, Johannes Sixt <j6t@kdbg.org> a écrit :\n>\n> Am 13.05.21 um 22:08 schrieb Junio C Hamano:\n> > Johannes Sixt <j6t@kdbg.org> writes:\n> >\n> >> Am 13.05.21 um 11:31 schrieb Alexandre Remy:\n> >>> I have an additional question, does double-quotes be safely used in\n> >>> both windows (that's ok) and linux shell  for pathspecs (git status --\n> >>> \"src/test.js\") in case of spaces in the path?\n> >>\n> >> They can be used in both POSIX shell and Windows CMD and, I would\n> >> assume, also in the PowerShell. Note though, that there are subtle\n> >> differences when other special characters occur between double-quotes,\n> >> notably the backslash. Please use your favorite search engine to learn more.\n> >\n> > And a dollar sign, in addition to the backslash?\n>\n> Granted, there's not a subtle, but a big difference how the dollar sign\n> is treated ;) but I don't want to write a tutorial here. Hence, my hint\n> towards a search engine.\n>\n> -- Hannes\n"}]}