From 4397c6535ea314b3412d6a0658ecf44241d07df1 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Wed, 11 Jan 2012 10:20:14 +0100 Subject: [PATCH 1/2] t9200: On MSYS, do not pass Windows-style paths to CVS For details, see the commit message of 4114156ae9. Note that while using $PWD as part of GIT_DIR is not required here, it does no harm and it is more consistent. In addition, on MSYS using an environment variable should be slightly faster than spawning an external executable. Signed-off-by: Sebastian Schuberth Signed-off-by: Junio C Hamano --- t/t9200-git-cvsexportcommit.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh index 41db05cb4..518358aa6 100755 --- a/t/t9200-git-cvsexportcommit.sh +++ b/t/t9200-git-cvsexportcommit.sh @@ -19,9 +19,9 @@ then test_done fi -CVSROOT=$(pwd)/cvsroot -CVSWORK=$(pwd)/cvswork -GIT_DIR=$(pwd)/.git +CVSROOT=$PWD/cvsroot +CVSWORK=$PWD/cvswork +GIT_DIR=$PWD/.git export CVSROOT CVSWORK GIT_DIR rm -rf "$CVSROOT" "$CVSWORK" From 37495eef4c6071fa124911753cfca3690ea4bf96 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Wed, 11 Jan 2012 10:21:10 +0100 Subject: [PATCH 2/2] git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS Due to MSYS path mangling GIT_DIR contains a Windows-style path when checked inside a Perl script even if GIT_DIR was previously set to an MSYS-style path in a shell script. So explicitly convert to an MSYS-style path before calling Perl's rel2abs() to make it work. This fix was inspired by a very similar patch in WebKit: http://trac.webkit.org/changeset/76255/trunk/Tools/Scripts/commit-log-editor Signed-off-by: Sebastian Schuberth Tested-by: Pat Thoyts Signed-off-by: Junio C Hamano --- git-cvsexportcommit.perl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl index 39a426e06..e6bf25232 100755 --- a/git-cvsexportcommit.perl +++ b/git-cvsexportcommit.perl @@ -30,6 +30,13 @@ chomp($gd); $ENV{GIT_DIR} = $gd; } + + # On MSYS, convert a Windows-style path to an MSYS-style path + # so that rel2abs() below works correctly. + if ($^O eq 'msys') { + $ENV{GIT_DIR} =~ s#^([[:alpha:]]):/#/$1/#; + } + # Make sure GIT_DIR is absolute $ENV{GIT_DIR} = File::Spec->rel2abs($ENV{GIT_DIR}); }