git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] Some patches from msysGit (round 2)
@ 2011-10-15 14:05 Pat Thoyts
  2011-10-15 14:05 ` [PATCH 1/7] t1020: disable the pwd test on MinGW Pat Thoyts
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Pat Thoyts @ 2011-10-15 14:05 UTC (permalink / raw)
  To: Git; +Cc: Junio C Hamano, msysGit, Pat Thoyts

This collects some recent patches from the msysGit tree that clear up
test issues on Windows.

This second version incorporates suggestions received from round 1 to:
  avoid duplicating code in t9901 web-browse tests
  drop the t1402 changes in favour of another change from J6t (on pu)
  test for the presence of 'bcomp' in bc3 mergetool

Johannes Schindelin (3):
  t1020: disable the pwd test on MinGW
  t9001: do not fail only due to CR/LF issues
  t9300: do not run --cat-blob-fd related tests on MinGW

Pat Thoyts (3):
  t9901: fix line-ending dependency on windows
  mergetools: use the correct tool for Beyond Compare 3 on Windows
  mingw: ensure sockets are initialized before calling gethostname

Sebastian Schuberth (1):
  git-svn: On MSYS, escape and quote SVN_SSH also if set by the user

 compat/mingw.c             |    7 +++++++
 compat/mingw.h             |    3 +++
 git-svn.perl               |   15 +++++++--------
 mergetools/bc3             |    7 ++++++-
 t/t1020-subdirectory.sh    |    2 +-
 t/t9001-send-email.sh      |    1 +
 t/t9300-fast-import.sh     |    8 ++++----
 t/t9901-git-web--browse.sh |   32 +++++++++++++++++---------------
 8 files changed, 46 insertions(+), 29 deletions(-)

-- 
1.7.7.1.gbba15

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/7] t1020: disable the pwd test on MinGW
  2011-10-15 14:05 [PATCH 0/7] Some patches from msysGit (round 2) Pat Thoyts
@ 2011-10-15 14:05 ` Pat Thoyts
  2011-10-15 14:05 ` [PATCH 2/7] t9001: do not fail only due to CR/LF issues Pat Thoyts
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Pat Thoyts @ 2011-10-15 14:05 UTC (permalink / raw)
  To: Git; +Cc: Junio C Hamano, msysGit, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

It fails both for line ending and for DOS path reasons.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t1020-subdirectory.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh
index 3b1b985..e23ac0e 100755
--- a/t/t1020-subdirectory.sh
+++ b/t/t1020-subdirectory.sh
@@ -118,7 +118,7 @@ test_expect_success 'alias expansion' '
 	)
 '
 
-test_expect_success '!alias expansion' '
+test_expect_success NOT_MINGW '!alias expansion' '
 	pwd >expect &&
 	(
 		git config alias.test !pwd &&
-- 
1.7.7.1.gbba15

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/7] t9001: do not fail only due to CR/LF issues
  2011-10-15 14:05 [PATCH 0/7] Some patches from msysGit (round 2) Pat Thoyts
  2011-10-15 14:05 ` [PATCH 1/7] t1020: disable the pwd test on MinGW Pat Thoyts
@ 2011-10-15 14:05 ` Pat Thoyts
  2011-10-15 14:05 ` [PATCH 3/7] git-svn: On MSYS, escape and quote SVN_SSH also if set by the user Pat Thoyts
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Pat Thoyts @ 2011-10-15 14:05 UTC (permalink / raw)
  To: Git; +Cc: Junio C Hamano, msysGit, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t9001-send-email.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 87b4acc..8c12c65 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -23,6 +23,7 @@ test_expect_success $PREREQ \
       echo do
       echo "  echo \"!\$a!\""
       echo "done >commandline\$output"
+      test_have_prereq MINGW && echo "dos2unix commandline\$output"
       echo "cat > msgtxt\$output"
       ) >fake.sendmail &&
      chmod +x ./fake.sendmail &&
-- 
1.7.7.1.gbba15

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/7] git-svn: On MSYS, escape and quote SVN_SSH also if set by the user
  2011-10-15 14:05 [PATCH 0/7] Some patches from msysGit (round 2) Pat Thoyts
  2011-10-15 14:05 ` [PATCH 1/7] t1020: disable the pwd test on MinGW Pat Thoyts
  2011-10-15 14:05 ` [PATCH 2/7] t9001: do not fail only due to CR/LF issues Pat Thoyts
@ 2011-10-15 14:05 ` Pat Thoyts
  2011-10-15 14:05 ` [PATCH 4/7] t9901: fix line-ending dependency on windows Pat Thoyts
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Pat Thoyts @ 2011-10-15 14:05 UTC (permalink / raw)
  To: Git; +Cc: Junio C Hamano, msysGit, Sebastian Schuberth

From: Sebastian Schuberth <sschuberth@gmail.com>

While GIT_SSH does not require any escaping / quoting (e.g. for paths
containing spaces), SVN_SSH requires it due to its use in a Perl script.

Previously, SVN_SSH has only been escaped and quoted automatically if it
was unset and thus derived from GIT_SSH. For user convenience, do the
escaping and quoting also for a SVN_SSH set by the user. This way, the
user is able to use the same unescaped and unquoted syntax for GIT_SSH
and SVN_SSH.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
 git-svn.perl |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index a0410f0..3b33379 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -22,14 +22,13 @@ $Git::SVN::default_ref_id = $ENV{GIT_SVN_ID} || 'git-svn';
 $Git::SVN::Ra::_log_window_size = 100;
 $Git::SVN::_minimize_url = 'unset';
 
-if (! exists $ENV{SVN_SSH}) {
-	if (exists $ENV{GIT_SSH}) {
-		$ENV{SVN_SSH} = $ENV{GIT_SSH};
-		if ($^O eq 'msys') {
-			$ENV{SVN_SSH} =~ s/\\/\\\\/g;
-			$ENV{SVN_SSH} =~ s/(.*)/"$1"/;
-		}
-	}
+if (! exists $ENV{SVN_SSH} && exists $ENV{GIT_SSH}) {
+	$ENV{SVN_SSH} = $ENV{GIT_SSH};
+}
+
+if (exists $ENV{SVN_SSH} && $^O eq 'msys') {
+	$ENV{SVN_SSH} =~ s/\\/\\\\/g;
+	$ENV{SVN_SSH} =~ s/(.*)/"$1"/;
 }
 
 $Git::SVN::Log::TZ = $ENV{TZ};
-- 
1.7.7.1.gbba15

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/7] t9901: fix line-ending dependency on windows
  2011-10-15 14:05 [PATCH 0/7] Some patches from msysGit (round 2) Pat Thoyts
                   ` (2 preceding siblings ...)
  2011-10-15 14:05 ` [PATCH 3/7] git-svn: On MSYS, escape and quote SVN_SSH also if set by the user Pat Thoyts
@ 2011-10-15 14:05 ` Pat Thoyts
  2011-10-15 14:05 ` [PATCH 5/7] t9300: do not run --cat-blob-fd related tests on MinGW Pat Thoyts
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Pat Thoyts @ 2011-10-15 14:05 UTC (permalink / raw)
  To: Git; +Cc: Junio C Hamano, msysGit, Pat Thoyts

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 t/t9901-git-web--browse.sh |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/t/t9901-git-web--browse.sh b/t/t9901-git-web--browse.sh
index 7906e5d..69513f1 100755
--- a/t/t9901-git-web--browse.sh
+++ b/t/t9901-git-web--browse.sh
@@ -7,31 +7,35 @@ This test checks that git web--browse can handle various valid URLs.'
 
 . ./test-lib.sh
 
+test_web_browse () {
+	# browser=$1 url=$2
+	git web--browse --browser="$1" "$2" >actual &&
+	tr -d '\015' <actual >text &&
+	test_cmp expect text
+}
+
 test_expect_success \
 	'URL with an ampersand in it' '
 	echo http://example.com/foo\&bar >expect &&
 	git config browser.custom.cmd echo &&
-	git web--browse --browser=custom \
-		http://example.com/foo\&bar >actual &&
-	test_cmp expect actual
+	test_web_browse custom \
+		http://example.com/foo\&bar
 '
 
 test_expect_success \
 	'URL with a semi-colon in it' '
 	echo http://example.com/foo\;bar >expect &&
 	git config browser.custom.cmd echo &&
-	git web--browse --browser=custom \
-		http://example.com/foo\;bar >actual &&
-	test_cmp expect actual
+	test_web_browse custom \
+		http://example.com/foo\;bar
 '
 
 test_expect_success \
 	'URL with a hash in it' '
 	echo http://example.com/foo#bar >expect &&
 	git config browser.custom.cmd echo &&
-	git web--browse --browser=custom \
-		http://example.com/foo#bar >actual &&
-	test_cmp expect actual
+	test_web_browse custom \
+		http://example.com/foo#bar
 '
 
 test_expect_success \
@@ -43,9 +47,8 @@ test_expect_success \
 	EOF
 	chmod +x "fake browser" &&
 	git config browser.w3m.path "`pwd`/fake browser" &&
-	git web--browse --browser=w3m \
-		http://example.com/foo >actual &&
-	test_cmp expect actual
+	test_web_browse w3m \
+		http://example.com/foo
 '
 
 test_expect_success \
@@ -58,9 +61,8 @@ test_expect_success \
 			done
 		}
 		f" &&
-	git web--browse --browser=custom \
-		http://example.com/foo >actual &&
-	test_cmp expect actual
+	test_web_browse custom \
+		http://example.com/foo
 '
 
 test_done
-- 
1.7.7.1.gbba15

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/7] t9300: do not run --cat-blob-fd related tests on MinGW
  2011-10-15 14:05 [PATCH 0/7] Some patches from msysGit (round 2) Pat Thoyts
                   ` (3 preceding siblings ...)
  2011-10-15 14:05 ` [PATCH 4/7] t9901: fix line-ending dependency on windows Pat Thoyts
@ 2011-10-15 14:05 ` Pat Thoyts
  2011-10-15 14:05 ` [PATCH 6/7] mergetools: use the correct tool for Beyond Compare 3 on Windows Pat Thoyts
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Pat Thoyts @ 2011-10-15 14:05 UTC (permalink / raw)
  To: Git; +Cc: Junio C Hamano, msysGit, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

As diagnosed by Johannes Sixt, msys.dll does not hand through file
descriptors > 2 to child processes, so these test cases cannot passes when
run through an MSys bash.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t9300-fast-import.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index bd32b91..438aaf6 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -2237,7 +2237,7 @@ test_expect_success 'R: cat-blob-fd must be a nonnegative integer' '
 	test_must_fail git fast-import --cat-blob-fd=-1 </dev/null
 '
 
-test_expect_success 'R: print old blob' '
+test_expect_success NOT_MINGW 'R: print old blob' '
 	blob=$(echo "yes it can" | git hash-object -w --stdin) &&
 	cat >expect <<-EOF &&
 	${blob} blob 11
@@ -2249,7 +2249,7 @@ test_expect_success 'R: print old blob' '
 	test_cmp expect actual
 '
 
-test_expect_success 'R: in-stream cat-blob-fd not respected' '
+test_expect_success NOT_MINGW 'R: in-stream cat-blob-fd not respected' '
 	echo hello >greeting &&
 	blob=$(git hash-object -w greeting) &&
 	cat >expect <<-EOF &&
@@ -2270,7 +2270,7 @@ test_expect_success 'R: in-stream cat-blob-fd not respected' '
 	test_cmp expect actual.1
 '
 
-test_expect_success 'R: print new blob' '
+test_expect_success NOT_MINGW 'R: print new blob' '
 	blob=$(echo "yep yep yep" | git hash-object --stdin) &&
 	cat >expect <<-EOF &&
 	${blob} blob 12
@@ -2288,7 +2288,7 @@ test_expect_success 'R: print new blob' '
 	test_cmp expect actual
 '
 
-test_expect_success 'R: print new blob by sha1' '
+test_expect_success NOT_MINGW 'R: print new blob by sha1' '
 	blob=$(echo "a new blob named by sha1" | git hash-object --stdin) &&
 	cat >expect <<-EOF &&
 	${blob} blob 25
-- 
1.7.7.1.gbba15

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/7] mergetools: use the correct tool for Beyond Compare 3 on Windows
  2011-10-15 14:05 [PATCH 0/7] Some patches from msysGit (round 2) Pat Thoyts
                   ` (4 preceding siblings ...)
  2011-10-15 14:05 ` [PATCH 5/7] t9300: do not run --cat-blob-fd related tests on MinGW Pat Thoyts
@ 2011-10-15 14:05 ` Pat Thoyts
  2011-10-15 14:05 ` [PATCH 7/7] mingw: ensure sockets are initialized before calling gethostname Pat Thoyts
  2011-10-16  5:17 ` [PATCH 0/7] Some patches from msysGit (round 2) Junio C Hamano
  7 siblings, 0 replies; 9+ messages in thread
From: Pat Thoyts @ 2011-10-15 14:05 UTC (permalink / raw)
  To: Git; +Cc: Junio C Hamano, msysGit, Pat Thoyts

On Windows the bcompare tool launches a graphical program and does
not wait for it to terminate. A separate 'bcomp' tool is provided which
will wait for the view to exit so we use this instead.

Reported-by: Werner BEROUX <werner@beroux.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 mergetools/bc3 |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/mergetools/bc3 b/mergetools/bc3
index 27b3dd4..b6319d2 100644
--- a/mergetools/bc3
+++ b/mergetools/bc3
@@ -16,5 +16,10 @@ merge_cmd () {
 }
 
 translate_merge_tool_path() {
-	echo bcompare
+	if type bcomp >/dev/null 2>/dev/null
+	then
+		echo bcomp
+	else
+		echo bcompare
+	fi
 }
-- 
1.7.7.1.gbba15

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 7/7] mingw: ensure sockets are initialized before calling gethostname
  2011-10-15 14:05 [PATCH 0/7] Some patches from msysGit (round 2) Pat Thoyts
                   ` (5 preceding siblings ...)
  2011-10-15 14:05 ` [PATCH 6/7] mergetools: use the correct tool for Beyond Compare 3 on Windows Pat Thoyts
@ 2011-10-15 14:05 ` Pat Thoyts
  2011-10-16  5:17 ` [PATCH 0/7] Some patches from msysGit (round 2) Junio C Hamano
  7 siblings, 0 replies; 9+ messages in thread
From: Pat Thoyts @ 2011-10-15 14:05 UTC (permalink / raw)
  To: Git; +Cc: Junio C Hamano, msysGit, Pat Thoyts

If the Windows sockets subsystem has not been initialized yet then an
attempt to get the hostname returns an error and prints a warning to the
console. This solves this issue for msysGit as seen with 'git fetch'.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 compat/mingw.c |    7 +++++++
 compat/mingw.h |    3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/compat/mingw.c b/compat/mingw.c
index 8947418..efdc703 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1321,6 +1321,13 @@ static void ensure_socket_initialization(void)
 	initialized = 1;
 }
 
+#undef gethostname
+int mingw_gethostname(char *name, int namelen)
+{
+    ensure_socket_initialization();
+    return gethostname(name, namelen);
+}
+
 #undef gethostbyname
 struct hostent *mingw_gethostbyname(const char *host)
 {
diff --git a/compat/mingw.h b/compat/mingw.h
index ce9dd98..fecf0d0 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -190,6 +190,9 @@ char *mingw_getcwd(char *pointer, int len);
 char *mingw_getenv(const char *name);
 #define getenv mingw_getenv
 
+int mingw_gethostname(char *host, int namelen);
+#define gethostname mingw_gethostname
+
 struct hostent *mingw_gethostbyname(const char *host);
 #define gethostbyname mingw_gethostbyname
 
-- 
1.7.7.1.gbba15

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/7] Some patches from msysGit (round 2)
  2011-10-15 14:05 [PATCH 0/7] Some patches from msysGit (round 2) Pat Thoyts
                   ` (6 preceding siblings ...)
  2011-10-15 14:05 ` [PATCH 7/7] mingw: ensure sockets are initialized before calling gethostname Pat Thoyts
@ 2011-10-16  5:17 ` Junio C Hamano
  7 siblings, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2011-10-16  5:17 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: Git, msysGit

Pat Thoyts <patthoyts@users.sourceforge.net> writes:

> This collects some recent patches from the msysGit tree that clear up
> test issues on Windows.
>
> This second version incorporates suggestions received from round 1 to:
>   avoid duplicating code in t9901 web-browse tests
>   drop the t1402 changes in favour of another change from J6t (on pu)
>   test for the presence of 'bcomp' in bc3 mergetool

Thanks.

Will replace the previous patches with these and advance them to 'next'
shortly.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-10-16  5:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-15 14:05 [PATCH 0/7] Some patches from msysGit (round 2) Pat Thoyts
2011-10-15 14:05 ` [PATCH 1/7] t1020: disable the pwd test on MinGW Pat Thoyts
2011-10-15 14:05 ` [PATCH 2/7] t9001: do not fail only due to CR/LF issues Pat Thoyts
2011-10-15 14:05 ` [PATCH 3/7] git-svn: On MSYS, escape and quote SVN_SSH also if set by the user Pat Thoyts
2011-10-15 14:05 ` [PATCH 4/7] t9901: fix line-ending dependency on windows Pat Thoyts
2011-10-15 14:05 ` [PATCH 5/7] t9300: do not run --cat-blob-fd related tests on MinGW Pat Thoyts
2011-10-15 14:05 ` [PATCH 6/7] mergetools: use the correct tool for Beyond Compare 3 on Windows Pat Thoyts
2011-10-15 14:05 ` [PATCH 7/7] mingw: ensure sockets are initialized before calling gethostname Pat Thoyts
2011-10-16  5:17 ` [PATCH 0/7] Some patches from msysGit (round 2) Junio C Hamano

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).