{"thread":{"id":"47081","subject":"[PATCH] t5580: add Cygwin support","startedAt":"2017-10-31T13:19:23Z","lastAt":"2017-11-01T10:17:16Z","messageCount":4,"participants":["Adam Dinwoodie","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"331472","messageId":"20171031131903.10496-1-adam@dinwoodie.org","threadId":"47081","inReplyTo":null,"subject":"[PATCH] t5580: add Cygwin support","fromName":"Adam Dinwoodie","fromEmail":"adam@dinwoodie.org","sentAt":"2017-10-31T13:19:03Z","receivedAt":"2017-10-31T13:19:23Z","isPatch":true,"sender":{"key":"adam@dinwoodie.org","avatar":"https://avatars.githubusercontent.com/u/1397507?v=4"},"body":"t5580 tests that specifying Windows UNC paths works with Git.  Cygwin\nsupports UNC paths, albeit only using forward slashes, not backslashes,\nso run the compatible tests on Cygwin as well as MinGW.\n\nThe only complication is Cygwin's `pwd`, which returns a *nix-style\npath, and that's not suitable for calculating the UNC path to the\ncurrent directory.  Instead use Cygwin's `cygpath` utility to get the\nWindows-style path.\n\nSigned-off-by: Adam Dinwoodie <adam@dinwoodie.org>\n---\n t/t5580-clone-push-unc.sh | 12 ++++++++----\n 1 file changed, 8 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t5580-clone-push-unc.sh b/t/t5580-clone-push-unc.sh\nindex b322c2f72..47a9a7cda 100755\n--- a/t/t5580-clone-push-unc.sh\n+++ b/t/t5580-clone-push-unc.sh\n@@ -3,12 +3,16 @@\n test_description='various Windows-only path tests'\n . ./test-lib.sh\n \n-if ! test_have_prereq MINGW; then\n+if test_have_prereq CYGWIN; then\n+\talias winpwd='cygpath -aw .'\n+elif test_have_prereq MINGW; then\n+\talias winpwd=pwd\n+else\n \tskip_all='skipping Windows-only path tests'\n \ttest_done\n fi\n \n-UNCPATH=\"$(pwd)\"\n+UNCPATH=\"$(winpwd)\"\n case \"$UNCPATH\" in\n [A-Z]:*)\n \t# Use administrative share e.g. \\\\localhost\\C$\\git-sdk-64\\usr\\src\\git\n@@ -45,8 +49,8 @@ test_expect_success push '\n \ttest \"$rev\" = \"$(git rev-parse --verify refs/heads/to-push)\"\n '\n \n-test_expect_success 'remote nick cannot contain backslashes' '\n-\tBACKSLASHED=\"$(pwd | tr / \\\\\\\\)\" &&\n+test_expect_success MINGW 'remote nick cannot contain backslashes' '\n+\tBACKSLASHED=\"$(winpwd | tr / \\\\\\\\)\" &&\n \tgit ls-remote \"$BACKSLASHED\" >out 2>err &&\n \ttest_i18ngrep ! \"unable to access\" err\n '\n-- \n2.14.3\n\n"},{"id":"331490","messageId":"alpine.DEB.2.21.1.1710311839340.6482@virtualbox","threadId":"47081","inReplyTo":"20171031131903.10496-1-adam@dinwoodie.org","subject":"Re: [PATCH] t5580: add Cygwin support","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-10-31T17:39:54Z","receivedAt":"2017-10-31T17:40:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Adam,\n\nOn Tue, 31 Oct 2017, Adam Dinwoodie wrote:\n\n> t5580 tests that specifying Windows UNC paths works with Git.  Cygwin\n> supports UNC paths, albeit only using forward slashes, not backslashes,\n> so run the compatible tests on Cygwin as well as MinGW.\n> \n> The only complication is Cygwin's `pwd`, which returns a *nix-style\n> path, and that's not suitable for calculating the UNC path to the\n> current directory.  Instead use Cygwin's `cygpath` utility to get the\n> Windows-style path.\n\nLooks good!\n\nThank you,\nDscho\n"},{"id":"331532","messageId":"xmqq1sliydqh.fsf@gitster.mtv.corp.google.com","threadId":"47081","inReplyTo":"20171031131903.10496-1-adam@dinwoodie.org","subject":"Re: [PATCH] t5580: add Cygwin support","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-11-01T01:44:22Z","receivedAt":"2017-11-01T01:44:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Adam Dinwoodie <adam@dinwoodie.org> writes:\n\n> t5580 tests that specifying Windows UNC paths works with Git.  Cygwin\n> supports UNC paths, albeit only using forward slashes, not backslashes,\n> so run the compatible tests on Cygwin as well as MinGW.\n>\n> The only complication is Cygwin's `pwd`, which returns a *nix-style\n> path, and that's not suitable for calculating the UNC path to the\n> current directory.  Instead use Cygwin's `cygpath` utility to get the\n> Windows-style path.\n>\n> Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org>\n> ---\n>  t/t5580-clone-push-unc.sh | 12 ++++++++----\n>  1 file changed, 8 insertions(+), 4 deletions(-)\n>\n> diff --git a/t/t5580-clone-push-unc.sh b/t/t5580-clone-push-unc.sh\n> index b322c2f72..47a9a7cda 100755\n> --- a/t/t5580-clone-push-unc.sh\n> +++ b/t/t5580-clone-push-unc.sh\n> @@ -3,12 +3,16 @@\n>  test_description='various Windows-only path tests'\n>  . ./test-lib.sh\n>  \n> -if ! test_have_prereq MINGW; then\n> +if test_have_prereq CYGWIN; then\n> +\talias winpwd='cygpath -aw .'\n> +elif test_have_prereq MINGW; then\n> +\talias winpwd=pwd\n> +else\n>  \tskip_all='skipping Windows-only path tests'\n>  \ttest_done\n>  fi\n\nThe fact that UNCPATH matters only on windows-related platforms\njustifies the name used for this alias, I guess ;-)\n\n>  \n> -UNCPATH=\"$(pwd)\"\n> +UNCPATH=\"$(winpwd)\"\n>  case \"$UNCPATH\" in\n>  [A-Z]:*)\n>  \t# Use administrative share e.g. \\\\localhost\\C$\\git-sdk-64\\usr\\src\\git\n> @@ -45,8 +49,8 @@ test_expect_success push '\n>  \ttest \"$rev\" = \"$(git rev-parse --verify refs/heads/to-push)\"\n>  '\n>  \n> -test_expect_success 'remote nick cannot contain backslashes' '\n> -\tBACKSLASHED=\"$(pwd | tr / \\\\\\\\)\" &&\n> +test_expect_success MINGW 'remote nick cannot contain backslashes' '\n> +\tBACKSLASHED=\"$(winpwd | tr / \\\\\\\\)\" &&\n>  \tgit ls-remote \"$BACKSLASHED\" >out 2>err &&\n>  \ttest_i18ngrep ! \"unable to access\" err\n>  '\n"},{"id":"331554","messageId":"20171101101707.GD20681@dinwoodie.org","threadId":"47081","inReplyTo":"xmqq1sliydqh.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] t5580: add Cygwin support","fromName":"Adam Dinwoodie","fromEmail":"adam@dinwoodie.org","sentAt":"2017-11-01T10:17:07Z","receivedAt":"2017-11-01T10:17:16Z","isPatch":true,"sender":{"key":"adam@dinwoodie.org","avatar":"https://avatars.githubusercontent.com/u/1397507?v=4"},"body":"On Wed, Nov 01, 2017 at 10:44:22AM +0900, Junio C Hamano wrote:\n> Adam Dinwoodie <adam@dinwoodie.org> writes:\n> \n> > t5580 tests that specifying Windows UNC paths works with Git.  Cygwin\n> > supports UNC paths, albeit only using forward slashes, not backslashes,\n> > so run the compatible tests on Cygwin as well as MinGW.\n> >\n> > The only complication is Cygwin's `pwd`, which returns a *nix-style\n> > path, and that's not suitable for calculating the UNC path to the\n> > current directory.  Instead use Cygwin's `cygpath` utility to get the\n> > Windows-style path.\n> >\n> > Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org>\n> > ---\n> >  t/t5580-clone-push-unc.sh | 12 ++++++++----\n> >  1 file changed, 8 insertions(+), 4 deletions(-)\n> >\n> > diff --git a/t/t5580-clone-push-unc.sh b/t/t5580-clone-push-unc.sh\n> > index b322c2f72..47a9a7cda 100755\n> > --- a/t/t5580-clone-push-unc.sh\n> > +++ b/t/t5580-clone-push-unc.sh\n> > @@ -3,12 +3,16 @@\n> >  test_description='various Windows-only path tests'\n> >  . ./test-lib.sh\n> >  \n> > -if ! test_have_prereq MINGW; then\n> > +if test_have_prereq CYGWIN; then\n> > +\talias winpwd='cygpath -aw .'\n> > +elif test_have_prereq MINGW; then\n> > +\talias winpwd=pwd\n> > +else\n> >  \tskip_all='skipping Windows-only path tests'\n> >  \ttest_done\n> >  fi\n> \n> The fact that UNCPATH matters only on windows-related platforms\n> justifies the name used for this alias, I guess ;-)\n\nI think I was going for \"Windows-style pwd\" or similar, given in both\ncases the alias produces something that looks like \"C:\\path\\to\\dir\".\n"}]}