* [PATCH 0/2] Make t9200-git-cvsexportcommit.sh pass on MSYS
@ 2012-01-11 9:16 Sebastian Schuberth
2012-01-11 9:20 ` [PATCH 1/2] t9200: On MSYS, do not pass Windows-style paths to CVS Sebastian Schuberth
2012-01-11 9:21 ` [PATCH 2/2] git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS Sebastian Schuberth
0 siblings, 2 replies; 5+ messages in thread
From: Sebastian Schuberth @ 2012-01-11 9:16 UTC (permalink / raw)
To: msysgit; +Cc: git
This tiny series makes the long-pending t9200-git-cvsexportcommit.sh pass on MSYS.
Sebastian Schuberth (2):
t9200: On MSYS, do not pass Windows-style paths to CVS
git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS
git-cvsexportcommit.perl | 7 +++++++
t/t9200-git-cvsexportcommit.sh | 6 +++---
2 files changed, 10 insertions(+), 3 deletions(-)
--
1.7.9.rc0.5096.g30a61
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] t9200: On MSYS, do not pass Windows-style paths to CVS
2012-01-11 9:16 [PATCH 0/2] Make t9200-git-cvsexportcommit.sh pass on MSYS Sebastian Schuberth
@ 2012-01-11 9:20 ` Sebastian Schuberth
2012-01-12 2:06 ` Junio C Hamano
2012-01-11 9:21 ` [PATCH 2/2] git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS Sebastian Schuberth
1 sibling, 1 reply; 5+ messages in thread
From: Sebastian Schuberth @ 2012-01-11 9:20 UTC (permalink / raw)
Cc: msysgit, git
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 <sschuberth@gmail.com>
---
t/t9200-git-cvsexportcommit.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index 41db05c..518358a 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"
--
1.7.9.rc0.5096.g30a61
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS
2012-01-11 9:16 [PATCH 0/2] Make t9200-git-cvsexportcommit.sh pass on MSYS Sebastian Schuberth
2012-01-11 9:20 ` [PATCH 1/2] t9200: On MSYS, do not pass Windows-style paths to CVS Sebastian Schuberth
@ 2012-01-11 9:21 ` Sebastian Schuberth
2012-01-11 11:29 ` [msysGit] " Pat Thoyts
1 sibling, 1 reply; 5+ messages in thread
From: Sebastian Schuberth @ 2012-01-11 9:21 UTC (permalink / raw)
Cc: msysgit, git
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 <sschuberth@gmail.com>
---
git-cvsexportcommit.perl | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index 39a426e..e6bf252 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -30,6 +30,13 @@ if ($opt_w || $opt_W) {
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});
}
--
1.7.9.rc0.5096.g30a61
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [msysGit] [PATCH 2/2] git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS
2012-01-11 9:21 ` [PATCH 2/2] git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS Sebastian Schuberth
@ 2012-01-11 11:29 ` Pat Thoyts
0 siblings, 0 replies; 5+ messages in thread
From: Pat Thoyts @ 2012-01-11 11:29 UTC (permalink / raw)
To: Sebastian Schuberth; +Cc: msysgit, git
On 11 January 2012 09:21, Sebastian Schuberth <sschuberth@gmail.com> wrote:
> 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 <sschuberth@gmail.com>
> ---
> git-cvsexportcommit.perl | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
> index 39a426e..e6bf252 100755
> --- a/git-cvsexportcommit.perl
> +++ b/git-cvsexportcommit.perl
> @@ -30,6 +30,13 @@ if ($opt_w || $opt_W) {
> 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});
> }
> --
> 1.7.9.rc0.5096.g30a61
>
Cool - works for me. I just assumed we didn't support cvsexport.
Tested-by: Pat Thoyts <patthoyts@users.sourceforge.net>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-01-12 2:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11 9:16 [PATCH 0/2] Make t9200-git-cvsexportcommit.sh pass on MSYS Sebastian Schuberth
2012-01-11 9:20 ` [PATCH 1/2] t9200: On MSYS, do not pass Windows-style paths to CVS Sebastian Schuberth
2012-01-12 2:06 ` Junio C Hamano
2012-01-11 9:21 ` [PATCH 2/2] git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS Sebastian Schuberth
2012-01-11 11:29 ` [msysGit] " Pat Thoyts
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).