threads / patch / 28683

patch, 8 partst9001: do not fail only due to CR/LF issues

Subject: [PATCH 3/8] t9001: do not fail only due to CR/LF issues

## tl;dr

21 messages between Oct 14, 2011 and Oct 16, 2011. Diffs are folded; open one to read it.

replies: 20people: 3as markdown or json

Pat Thoyts· Oct 14, 2011, 22:53 UTC · lore

[PATCH 0/8] Some patches from msysGit

This series collects some recent patches required for msysGit applied onto 'next' for upstream application.

Johannes Schindelin (4):
  t1020: disable the pwd test on MinGW
  t1402: Ignore a few cases that must fail due to DOS path expansion
  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              |    9 ++++++++-
 t/t1020-subdirectory.sh     |    2 +-
 t/t1402-check-ref-format.sh |   15 +++++++++------
 t/t9001-send-email.sh       |    1 +
 t/t9300-fast-import.sh      |    8 ++++----
 t/t9901-git-web--browse.sh  |   10 +++++-----
 9 files changed, 45 insertions(+), 25 deletions(-)
-- 
1.7.7.1.gbba15
Pat Thoyts· Oct 14, 2011, 22:53 UTC · re: Pat Thoyts · lore

[PATCH 1/8] t1020: disable the pwd test on MinGW

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(-)
Show changes to t/t1020-subdirectory.sh +1 −1
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
Pat Thoyts· Oct 14, 2011, 22:53 UTC · re: Pat Thoyts · lore

[PATCH 2/8] t1402: Ignore a few cases that must fail due to DOS path expansion

From: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t1402-check-ref-format.sh |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
Show changes to t/t1402-check-ref-format.sh +9 −6
diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh
index 710fcca..1a5e343 100755
--- a/t/t1402-check-ref-format.sh
+++ b/t/t1402-check-ref-format.sh
@@ -36,7 +36,7 @@ invalid_ref 'refs///heads/foo'
 valid_ref 'refs///heads/foo' --normalize
 invalid_ref 'heads/foo/'
 invalid_ref '/heads/foo'
-valid_ref '/heads/foo' --normalize
+test_have_prereq MINGW || valid_ref '/heads/foo' --normalize
 invalid_ref '///heads/foo'
 valid_ref '///heads/foo' --normalize
 invalid_ref './foo'
@@ -120,9 +120,12 @@ invalid_ref "$ref" --allow-onelevel
 invalid_ref "$ref" --refspec-pattern
 invalid_ref "$ref" '--refspec-pattern --allow-onelevel'
 invalid_ref "$ref" --normalize
-valid_ref "$ref" '--allow-onelevel --normalize'
-invalid_ref "$ref" '--refspec-pattern --normalize'
-valid_ref "$ref" '--refspec-pattern --allow-onelevel --normalize'
+if test_have_prereq NOT_MINGW
+then
+	valid_ref "$ref" '--allow-onelevel --normalize'
+	invalid_ref "$ref" '--refspec-pattern --normalize'
+	valid_ref "$ref" '--refspec-pattern --allow-onelevel --normalize'
+fi
 
 test_expect_success "check-ref-format --branch @{-1}" '
 	T=$(git write-tree) &&
@@ -166,10 +169,10 @@ invalid_ref_normalized() {
 
 valid_ref_normalized 'heads/foo' 'heads/foo'
 valid_ref_normalized 'refs///heads/foo' 'refs/heads/foo'
-valid_ref_normalized '/heads/foo' 'heads/foo'
+test_have_prereq MINGW || valid_ref_normalized '/heads/foo' 'heads/foo'
 valid_ref_normalized '///heads/foo' 'heads/foo'
 invalid_ref_normalized 'foo'
-invalid_ref_normalized '/foo'
+test_have_prereq MINGW || invalid_ref_normalized '/foo'
 invalid_ref_normalized 'heads/foo/../bar'
 invalid_ref_normalized 'heads/./foo'
 invalid_ref_normalized 'heads\foo'
-- 
1.7.7.1.gbba15
Junio C Hamano· Oct 15, 2011, 05:36 UTC · re: Pat Thoyts · lore

Re: [PATCH 2/8] t1402: Ignore a few cases that must fail due to DOS path expansion

Pat Thoyts <patthoyts@users.sourceforge.net> writes:
>  t/t1402-check-ref-format.sh |   15 +++++++++------

Didn't we see a different patch that attempts to address the same issue recently on the list from J6t, or is this a fix for a different problem?

Show 44 quoted lines
>  1 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh
> index 710fcca..1a5e343 100755
> --- a/t/t1402-check-ref-format.sh
> +++ b/t/t1402-check-ref-format.sh
> @@ -36,7 +36,7 @@ invalid_ref 'refs///heads/foo'
>  valid_ref 'refs///heads/foo' --normalize
>  invalid_ref 'heads/foo/'
>  invalid_ref '/heads/foo'
> -valid_ref '/heads/foo' --normalize
> +test_have_prereq MINGW || valid_ref '/heads/foo' --normalize
>  invalid_ref '///heads/foo'
>  valid_ref '///heads/foo' --normalize
>  invalid_ref './foo'
> @@ -120,9 +120,12 @@ invalid_ref "$ref" --allow-onelevel
>  invalid_ref "$ref" --refspec-pattern
>  invalid_ref "$ref" '--refspec-pattern --allow-onelevel'
>  invalid_ref "$ref" --normalize
> -valid_ref "$ref" '--allow-onelevel --normalize'
> -invalid_ref "$ref" '--refspec-pattern --normalize'
> -valid_ref "$ref" '--refspec-pattern --allow-onelevel --normalize'
> +if test_have_prereq NOT_MINGW
> +then
> +	valid_ref "$ref" '--allow-onelevel --normalize'
> +	invalid_ref "$ref" '--refspec-pattern --normalize'
> +	valid_ref "$ref" '--refspec-pattern --allow-onelevel --normalize'
> +fi
>  
>  test_expect_success "check-ref-format --branch @{-1}" '
>  	T=$(git write-tree) &&
> @@ -166,10 +169,10 @@ invalid_ref_normalized() {
>  
>  valid_ref_normalized 'heads/foo' 'heads/foo'
>  valid_ref_normalized 'refs///heads/foo' 'refs/heads/foo'
> -valid_ref_normalized '/heads/foo' 'heads/foo'
> +test_have_prereq MINGW || valid_ref_normalized '/heads/foo' 'heads/foo'
>  valid_ref_normalized '///heads/foo' 'heads/foo'
>  invalid_ref_normalized 'foo'
> -invalid_ref_normalized '/foo'
> +test_have_prereq MINGW || invalid_ref_normalized '/foo'
>  invalid_ref_normalized 'heads/foo/../bar'
>  invalid_ref_normalized 'heads/./foo'
>  invalid_ref_normalized 'heads\foo'
Pat Thoyts· Oct 15, 2011, 13:49 UTC · re: Junio C Hamano · lore

Re: [PATCH 2/8] t1402: Ignore a few cases that must fail due to DOS path expansion

Junio C Hamano <gitster@pobox.com> writes:
Show 7 quoted lines
>Pat Thoyts <patthoyts@users.sourceforge.net> writes:
>
>>  t/t1402-check-ref-format.sh |   15 +++++++++------
>
>Didn't we see a different patch that attempts to address the same issue
>recently on the list from J6t, or is this a fix for a different problem?
>

You are correct - I'll leave this out of this series then. j6t's patch is an alternative fix for the same problem.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
Junio C Hamano· Oct 15, 2011, 20:15 UTC · re: Pat Thoyts · lore

Re: [PATCH 2/8] t1402: Ignore a few cases that must fail due to DOS path expansion

Pat Thoyts <patthoyts@users.sourceforge.net> writes:
Show 12 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>>Pat Thoyts <patthoyts@users.sourceforge.net> writes:
>>
>>>  t/t1402-check-ref-format.sh |   15 +++++++++------
>>
>>Didn't we see a different patch that attempts to address the same issue
>>recently on the list from J6t, or is this a fix for a different problem?
>>
>
> You are correct - I'll leave this out of this series then. j6t's patch
> is an alternative fix for the same problem.
Thanks for checking.
Pat Thoyts· Oct 14, 2011, 22:53 UTC · re: Pat Thoyts · lore
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(-)
Show changes to t/t9001-send-email.sh +1 −0
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 579ddb7..7d75738 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
Pat Thoyts· Oct 14, 2011, 22:53 UTC · re: Pat Thoyts · lore

[PATCH 4/8] git-svn: On MSYS, escape and quote SVN_SSH also if set by the user

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(-)
Show changes to git-svn.perl +7 −8
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
Pat Thoyts· Oct 14, 2011, 22:53 UTC · re: Pat Thoyts · lore

[PATCH 5/8] t9901: fix line-ending dependency on windows

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 t/t9901-git-web--browse.sh |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
Show changes to t/t9901-git-web--browse.sh +5 −5
diff --git a/t/t9901-git-web--browse.sh b/t/t9901-git-web--browse.sh
index 7906e5d..1185b42 100755
--- a/t/t9901-git-web--browse.sh
+++ b/t/t9901-git-web--browse.sh
@@ -12,7 +12,7 @@ test_expect_success \
 	echo http://example.com/foo\&bar >expect &&
 	git config browser.custom.cmd echo &&
 	git web--browse --browser=custom \
-		http://example.com/foo\&bar >actual &&
+		http://example.com/foo\&bar | tr -d "\r" >actual &&
 	test_cmp expect actual
 '
 
@@ -21,7 +21,7 @@ test_expect_success \
 	echo http://example.com/foo\;bar >expect &&
 	git config browser.custom.cmd echo &&
 	git web--browse --browser=custom \
-		http://example.com/foo\;bar >actual &&
+		http://example.com/foo\;bar | tr -d "\r" >actual &&
 	test_cmp expect actual
 '
 
@@ -30,7 +30,7 @@ test_expect_success \
 	echo http://example.com/foo#bar >expect &&
 	git config browser.custom.cmd echo &&
 	git web--browse --browser=custom \
-		http://example.com/foo#bar >actual &&
+		http://example.com/foo#bar | tr -d "\r" >actual &&
 	test_cmp expect actual
 '
 
@@ -44,7 +44,7 @@ test_expect_success \
 	chmod +x "fake browser" &&
 	git config browser.w3m.path "`pwd`/fake browser" &&
 	git web--browse --browser=w3m \
-		http://example.com/foo >actual &&
+		http://example.com/foo | tr -d "\r" >actual &&
 	test_cmp expect actual
 '
 
@@ -59,7 +59,7 @@ test_expect_success \
 		}
 		f" &&
 	git web--browse --browser=custom \
-		http://example.com/foo >actual &&
+		http://example.com/foo | tr -d "\r" >actual &&
 	test_cmp expect actual
 '
 
-- 
1.7.7.1.gbba15
Junio C Hamano· Oct 15, 2011, 05:44 UTC · re: Pat Thoyts · lore

Re: [PATCH 5/8] t9901: fix line-ending dependency on windows

Pat Thoyts <patthoyts@users.sourceforge.net> writes:
Show 17 quoted lines
> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
> ---
>  t/t9901-git-web--browse.sh |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/t/t9901-git-web--browse.sh b/t/t9901-git-web--browse.sh
> index 7906e5d..1185b42 100755
> --- a/t/t9901-git-web--browse.sh
> +++ b/t/t9901-git-web--browse.sh
> @@ -12,7 +12,7 @@ test_expect_success \
>  	echo http://example.com/foo\&bar >expect &&
>  	git config browser.custom.cmd echo &&
>  	git web--browse --browser=custom \
> -		http://example.com/foo\&bar >actual &&
> +		http://example.com/foo\&bar | tr -d "\r" >actual &&
>  	test_cmp expect actual
>  '

This is unnice for two reasons. We have web--browse five times in this test script, and you add tr exactly the same way to each and every one of them. And you are losing the error condition from each and every one of these web--browse invocations.

Having to do the same change to all invocations of the same command suggests that perhaps you can and should wrap that pattern into a single helper, perhaps like:

test_web_browse () {
	# browser=$1 url=$2
	git web--browse --browser="$1" "$2" >actual &&
        tr -d '\015' <actual >text &&
        test_cmp expect text
}
or something?
Pat Thoyts· Oct 15, 2011, 12:25 UTC · re: Junio C Hamano · lore

Re: [PATCH 5/8] t9901: fix line-ending dependency on windows

Junio C Hamano <gitster@pobox.com> writes:
Show 37 quoted lines
>Pat Thoyts <patthoyts@users.sourceforge.net> writes:
>
>> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
>> ---
>>  t/t9901-git-web--browse.sh |   10 +++++-----
>>  1 files changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/t/t9901-git-web--browse.sh b/t/t9901-git-web--browse.sh
>> index 7906e5d..1185b42 100755
>> --- a/t/t9901-git-web--browse.sh
>> +++ b/t/t9901-git-web--browse.sh
>> @@ -12,7 +12,7 @@ test_expect_success \
>>  	echo http://example.com/foo\&bar >expect &&
>>  	git config browser.custom.cmd echo &&
>>  	git web--browse --browser=custom \
>> -		http://example.com/foo\&bar >actual &&
>> +		http://example.com/foo\&bar | tr -d "\r" >actual &&
>>  	test_cmp expect actual
>>  '
>
>This is unnice for two reasons. We have web--browse five times in this
>test script, and you add tr exactly the same way to each and every one of
>them. And you are losing the error condition from each and every one of
>these web--browse invocations.
>
>Having to do the same change to all invocations of the same command
>suggests that perhaps you can and should wrap that pattern into a single
>helper, perhaps like:
>
>test_web_browse () {
>	# browser=$1 url=$2
>	git web--browse --browser="$1" "$2" >actual &&
>        tr -d '\015' <actual >text &&
>        test_cmp expect text
>}
>
>or something?
OK - The suggested code works fine so I shall re-roll this one shortly.
-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
Pat Thoyts· Oct 14, 2011, 22:53 UTC · re: Pat Thoyts · lore

[PATCH 6/8] t9300: do not run --cat-blob-fd related tests on MinGW

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(-)
Show changes to t/t9300-fast-import.sh +4 −4
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
Pat Thoyts· Oct 14, 2011, 22:53 UTC · re: Pat Thoyts · lore

[PATCH 7/8] mergetools: use the correct tool for Beyond Compare 3 on Windows

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 |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
Show changes to mergetools/bc3 +8 −1
diff --git a/mergetools/bc3 b/mergetools/bc3
index 27b3dd4..b642bf2 100644
--- a/mergetools/bc3
+++ b/mergetools/bc3
@@ -16,5 +16,12 @@ merge_cmd () {
 }
 
 translate_merge_tool_path() {
-	echo bcompare
+	case $(uname -s) in
+	*MINGW*)
+		echo bcomp
+		;;
+	*)
+		echo bcompare
+		;;
+	esac
 }
-- 
1.7.7.1.gbba15
Junio C Hamano· Oct 15, 2011, 05:50 UTC · re: Pat Thoyts · lore

Re: [PATCH 7/8] mergetools: use the correct tool for Beyond Compare 3 on Windows

Pat Thoyts <patthoyts@users.sourceforge.net> writes:
> 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.

Hmm, does this only apply to Windows, or are there other platforms on which BC3 supplies bcomp for the exact same reason? What I am trying to get at is that it might be nicer if we do not have to check uname, e.g.

	if type bcomp >/dev/null 2>/dev/null
        then
        	echo bcomp
	else
        	echo bcompare
	fi
Show 24 quoted lines
> Reported-by: Werner BEROUX <werner@beroux.com>
> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
> ---
>  mergetools/bc3 |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/mergetools/bc3 b/mergetools/bc3
> index 27b3dd4..b642bf2 100644
> --- a/mergetools/bc3
> +++ b/mergetools/bc3
> @@ -16,5 +16,12 @@ merge_cmd () {
>  }
>  
>  translate_merge_tool_path() {
> -	echo bcompare
> +	case $(uname -s) in
> +	*MINGW*)
> +		echo bcomp
> +		;;
> +	*)
> +		echo bcompare
> +		;;
> +	esac
>  }
Sebastian Schuberth· Oct 15, 2011, 10:27 UTC · re: Junio C Hamano · lore

Re: [PATCH 7/8] mergetools: use the correct tool for Beyond Compare 3 on Windows

On 15.10.2011 07:50, Junio C Hamano wrote:
> Hmm, does this only apply to Windows, or are there other platforms on
> which BC3 supplies bcomp for the exact same reason? What I am trying to

BC3 is only available for Linux and Windows, so it only applies to Windows currently.

-- 
Sebastian Schuberth
Pat Thoyts· Oct 15, 2011, 12:39 UTC · re: Sebastian Schuberth · lore

Re: [PATCH 7/8] mergetools: use the correct tool for Beyond Compare 3 on Windows

Sebastian Schuberth <sschuberth@gmail.com> writes:
Show 7 quoted lines
>On 15.10.2011 07:50, Junio C Hamano wrote:
>
>> Hmm, does this only apply to Windows, or are there other platforms on
>> which BC3 supplies bcomp for the exact same reason? What I am trying to
>
>BC3 is only available for Linux and Windows, so it only applies to
>Windows currently.

And checking the linux distribution shows only a bcompare executable so testing for the presence of 'bcomp' will be fine.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
Sebastian Schuberth· Oct 16, 2011, 10:12 UTC · re: Pat Thoyts · lore

Re: [PATCH 7/8] mergetools: use the correct tool for Beyond Compare 3 on Windows

On Sat, Oct 15, 2011 at 14:39, Pat Thoyts <patthoyts@users.sourceforge.net> wrote:

> And checking the linux distribution shows only a bcompare executable so
> testing for the presence of 'bcomp' will be fine.

That's what I was implying, sorry for not being more clear. I also checked the Linux version of BC3 to verify that it only contains a "bcompare" executable.

-- 
Sebastian Schuberth
Sebastian Schuberth· Oct 16, 2011, 10:21 UTC · re: Pat Thoyts · lore

Re: [PATCH 7/8] mergetools: use the correct tool for Beyond Compare 3 on Windows

On Sat, Oct 15, 2011 at 14:39, Pat Thoyts <patthoyts@users.sourceforge.net> wrote:

> And checking the linux distribution shows only a bcompare executable so
> testing for the presence of 'bcomp' will be fine.

I was meaning to say the same thing, sorry for not being more clear. I also checked the Linux version of BC3 and verified that there's only a "bcompare" executable.

-- 
Sebastian Schuberth
Junio C Hamano· Oct 15, 2011, 20:14 UTC · re: Sebastian Schuberth · lore

Re: [PATCH 7/8] mergetools: use the correct tool for Beyond Compare 3 on Windows

Sebastian Schuberth <sschuberth@gmail.com> writes:
Show 7 quoted lines
> On 15.10.2011 07:50, Junio C Hamano wrote:
>
>> Hmm, does this only apply to Windows, or are there other platforms on
>> which BC3 supplies bcomp for the exact same reason? What I am trying to
>
> BC3 is only available for Linux and Windows, so it only applies to
> Windows currently.
Who asked anything about "currently"?
Sebastian Schuberth· Oct 16, 2011, 10:11 UTC · re: Junio C Hamano · lore

Re: [PATCH 7/8] mergetools: use the correct tool for Beyond Compare 3 on Windows

On Sat, Oct 15, 2011 at 22:14, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
>>> Hmm, does this only apply to Windows, or are there other platforms on
>>> which BC3 supplies bcomp for the exact same reason? What I am trying to
>>
>> BC3 is only available for Linux and Windows, so it only applies to
>> Windows currently.
>
> Who asked anything about "currently"?

Heh, no one. But obviously I cannot predict the future, that's why I explicitly said "currently".

Here's what I was meaning to say in more long-winded words: Although BC3 only supports Linux and Windows currently, IMHO it is unlikely that future support for other platforms will suffer from the same issue as Windows and will require a different executable than "bcompare". And even if it was the case, that could be fixed then. For now the proposed patch covers all cases and works well, and although your suggestion would be more generic, it's not necessary, and the discussion about whether or not to use your more generic approach is starting to outweigh the time that was required to write this patch as well as the time that would be required for a future patch.

-- 
Sebastian Schuberth
Pat Thoyts· Oct 14, 2011, 22:53 UTC · re: Pat Thoyts · lore

[PATCH 8/8] mingw: ensure sockets are initialized before calling gethostname

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(-)
Show changes to 2 files +10 −0

compat/mingw.c, compat/mingw.h

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

← back to recent threads