{"thread":{"id":"29341","subject":"[PATCH 0/2] Make t9200-git-cvsexportcommit.sh pass on MSYS","startedAt":"2012-01-11T09:16:23Z","lastAt":"2012-01-12T02:06:01Z","messageCount":5,"participants":["Sebastian Schuberth","Pat Thoyts","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"182331","messageId":"4F0D5367.1000506@gmail.com","threadId":"29341","inReplyTo":null,"subject":"[PATCH 0/2] Make t9200-git-cvsexportcommit.sh pass on MSYS","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2012-01-11T09:16:23Z","receivedAt":"2012-01-11T09:16:23Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"This tiny series makes the long-pending t9200-git-cvsexportcommit.sh pass on MSYS.\n\nSebastian Schuberth (2):\n  t9200: On MSYS, do not pass Windows-style paths to CVS\n  git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS\n\n git-cvsexportcommit.perl       |    7 +++++++\n t/t9200-git-cvsexportcommit.sh |    6 +++---\n 2 files changed, 10 insertions(+), 3 deletions(-)\n\n-- \n1.7.9.rc0.5096.g30a61\n"},{"id":"182332","messageId":"4F0D544E.6010105@gmail.com","threadId":"29341","inReplyTo":"4F0D5367.1000506@gmail.com","subject":"[PATCH 1/2] t9200: On MSYS, do not pass Windows-style paths to CVS","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2012-01-11T09:20:14Z","receivedAt":"2012-01-11T09:20:14Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"For details, see the commit message of 4114156ae9. Note that while using\n$PWD as part of GIT_DIR is not required here, it does no harm and it is\nmore consistent. In addition, on MSYS using an environment variable should\nbe slightly faster than spawning an external executable.\n\nSigned-off-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n t/t9200-git-cvsexportcommit.sh |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh\nindex 41db05c..518358a 100755\n--- a/t/t9200-git-cvsexportcommit.sh\n+++ b/t/t9200-git-cvsexportcommit.sh\n@@ -19,9 +19,9 @@ then\n     test_done\n fi\n \n-CVSROOT=$(pwd)/cvsroot\n-CVSWORK=$(pwd)/cvswork\n-GIT_DIR=$(pwd)/.git\n+CVSROOT=$PWD/cvsroot\n+CVSWORK=$PWD/cvswork\n+GIT_DIR=$PWD/.git\n export CVSROOT CVSWORK GIT_DIR\n \n rm -rf \"$CVSROOT\" \"$CVSWORK\"\n-- \n1.7.9.rc0.5096.g30a61\n"},{"id":"182334","messageId":"4F0D5486.7020707@gmail.com","threadId":"29341","inReplyTo":"4F0D5367.1000506@gmail.com","subject":"[PATCH 2/2] git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2012-01-11T09:21:10Z","receivedAt":"2012-01-11T09:21:10Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"Due to MSYS path mangling GIT_DIR contains a Windows-style path when\nchecked inside a Perl script even if GIT_DIR was previously set to an\nMSYS-style path in a shell script. So explicitly convert to an MSYS-style\npath before calling Perl's rel2abs() to make it work.\n\nThis fix was inspired by a very similar patch in WebKit:\n\nhttp://trac.webkit.org/changeset/76255/trunk/Tools/Scripts/commit-log-editor\n\nSigned-off-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n git-cvsexportcommit.perl |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl\nindex 39a426e..e6bf252 100755\n--- a/git-cvsexportcommit.perl\n+++ b/git-cvsexportcommit.perl\n@@ -30,6 +30,13 @@ if ($opt_w || $opt_W) {\n \t\tchomp($gd);\n \t\t$ENV{GIT_DIR} = $gd;\n \t}\n+\n+\t# On MSYS, convert a Windows-style path to an MSYS-style path\n+\t# so that rel2abs() below works correctly.\n+\tif ($^O eq 'msys') {\n+\t\t$ENV{GIT_DIR} =~ s#^([[:alpha:]]):/#/$1/#;\n+\t}\n+\n \t# Make sure GIT_DIR is absolute\n \t$ENV{GIT_DIR} = File::Spec->rel2abs($ENV{GIT_DIR});\n }\n-- \n1.7.9.rc0.5096.g30a61\n"},{"id":"182342","messageId":"CABNJ2GKRD-v85zA8dgoQUn66FcFp1ZsqxnOrJOYeaf+QCdDkSQ@mail.gmail.com","threadId":"29341","inReplyTo":"4F0D5486.7020707@gmail.com","subject":"Re: [msysGit] [PATCH 2/2] git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS","fromName":"Pat Thoyts","fromEmail":"patthoyts@gmail.com","sentAt":"2012-01-11T11:29:53Z","receivedAt":"2012-01-11T11:29:53Z","isPatch":true,"sender":{"key":"patthoyts@gmail.com","avatar":"https://gravatar.com/avatar/bee887a777c790bd241f398217723fbe4b854428671db83db32216a28654cb25?d=mp&s=160"},"body":"On 11 January 2012 09:21, Sebastian Schuberth <sschuberth@gmail.com> wrote:\n> Due to MSYS path mangling GIT_DIR contains a Windows-style path when\n> checked inside a Perl script even if GIT_DIR was previously set to an\n> MSYS-style path in a shell script. So explicitly convert to an MSYS-style\n> path before calling Perl's rel2abs() to make it work.\n>\n> This fix was inspired by a very similar patch in WebKit:\n>\n> http://trac.webkit.org/changeset/76255/trunk/Tools/Scripts/commit-log-editor\n>\n> Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>\n> ---\n>  git-cvsexportcommit.perl |    7 +++++++\n>  1 files changed, 7 insertions(+), 0 deletions(-)\n>\n> diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl\n> index 39a426e..e6bf252 100755\n> --- a/git-cvsexportcommit.perl\n> +++ b/git-cvsexportcommit.perl\n> @@ -30,6 +30,13 @@ if ($opt_w || $opt_W) {\n>                chomp($gd);\n>                $ENV{GIT_DIR} = $gd;\n>        }\n> +\n> +       # On MSYS, convert a Windows-style path to an MSYS-style path\n> +       # so that rel2abs() below works correctly.\n> +       if ($^O eq 'msys') {\n> +               $ENV{GIT_DIR} =~ s#^([[:alpha:]]):/#/$1/#;\n> +       }\n> +\n>        # Make sure GIT_DIR is absolute\n>        $ENV{GIT_DIR} = File::Spec->rel2abs($ENV{GIT_DIR});\n>  }\n> --\n> 1.7.9.rc0.5096.g30a61\n>\n\nCool - works for me. I just assumed we didn't support cvsexport.\n\nTested-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n"},{"id":"182399","messageId":"7vvcoh4quu.fsf@alter.siamese.dyndns.org","threadId":"29341","inReplyTo":"4F0D544E.6010105@gmail.com","subject":"Re: [PATCH 1/2] t9200: On MSYS, do not pass Windows-style paths to CVS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-01-12T02:06:01Z","receivedAt":"2012-01-12T02:06:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sebastian Schuberth <sschuberth@gmail.com> writes:\n\n> For details, see the commit message of 4114156ae9. Note that while using\n> $PWD as part of GIT_DIR is not required here, it does no harm and it is\n> more consistent. In addition, on MSYS using an environment variable should\n> be slightly faster than spawning an external executable.\n\nThanks. It seems that the \"Dos and Dont's\" from t/README needs to be\nstressed a bit more strongly.\n"}]}