[PATCH 0/5] miscellaneous test suite fixes

STALE3736d

31 messages, 8 authors, 2016-06-15 · open the first message on its own page

[PATCH 0/5] miscellaneous test suite fixes

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:53

Identified by testing on IRIX 6.5, Solaris 5.7, and 5.10

Brandon Casey (5):
  t/t5800: skip if python version is older than 2.5
  git-request-pull.sh: remove -e switch to shell interpreter which
    breaks ksh
  t/t5150: remove space from sed script
  t/t7006: ignore return status of shell's unset builtin
  t/aggregate-results: accomodate systems with small max argument list
    length

 git-request-pull.sh       |    2 +-
 t/Makefile                |    4 +++-
 t/aggregate-results.sh    |    2 +-
 t/t5150-request-pull.sh   |    4 ++--
 t/t5800-remote-helpers.sh |    4 ++--
 t/t7006-pager.sh          |   10 +++++-----
 t/test-lib.sh             |    9 +++++++++
 7 files changed, 23 insertions(+), 12 deletions(-)

[PATCH 4/5] t/t7006: ignore return status of shell's unset builtin

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:53

From: Brandon Casey <redacted>

The unset builtin of Solaris's xpg4/sh returns non-zero if it is passed a
variable name which was not previously set.  Since the unset is not likely
to fail, ignore it's return status.

Signed-off-by: Brandon Casey <redacted>
---
 t/t7006-pager.sh |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 3bc7a2a..a82bfb1 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -40,7 +40,7 @@ else
 fi
 
 test_expect_success 'setup' '
-	unset GIT_PAGER GIT_PAGER_IN_USE &&
+	unset GIT_PAGER GIT_PAGER_IN_USE
 	test_might_fail git config --unset core.pager &&
 
 	PAGER="cat >paginated.out" &&
@@ -159,7 +159,7 @@ test_expect_success 'color when writing to a file intended for a pager' '
 '
 
 test_expect_success 'determine default pager' '
-	unset PAGER GIT_PAGER &&
+	unset PAGER GIT_PAGER
 	test_might_fail git config --unset core.pager ||
 	cleanup_fail &&
 
@@ -173,7 +173,7 @@ then
 fi
 
 test_expect_success SIMPLEPAGER 'default pager is used by default' '
-	unset PAGER GIT_PAGER &&
+	unset PAGER GIT_PAGER
 	test_might_fail git config --unset core.pager &&
 	rm -f default_pager_used ||
 	cleanup_fail &&
@@ -192,7 +192,7 @@ test_expect_success SIMPLEPAGER 'default pager is used by default' '
 '
 
 test_expect_success TTY 'PAGER overrides default pager' '
-	unset GIT_PAGER &&
+	unset GIT_PAGER
 	test_might_fail git config --unset core.pager &&
 	rm -f PAGER_used ||
 	cleanup_fail &&
@@ -204,7 +204,7 @@ test_expect_success TTY 'PAGER overrides default pager' '
 '
 
 test_expect_success TTY 'core.pager overrides PAGER' '
-	unset GIT_PAGER &&
+	unset GIT_PAGER
 	rm -f core.pager_used ||
 	cleanup_fail &&
 
-- 
1.6.6.2

[PATCH 3/5] t/t5150: remove space from sed script

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:53

From: Brandon Casey <redacted>

Solaris's xpg4/sed and IRIX's sed fail to parse these negated matching
expressions when the '!' is separated from the command that follows.

Signed-off-by: Brandon Casey <redacted>
---
 t/t5150-request-pull.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh
index 169d3ea..9cc0a42 100755
--- a/t/t5150-request-pull.sh
+++ b/t/t5150-request-pull.sh
@@ -67,7 +67,7 @@ test_expect_success 'setup: two scripts for reading pull requests' '
 
 	cat <<-\EOT >read-request.sed &&
 	#!/bin/sed -nf
-	/ in the git repository at:$/! d
+	/ in the git repository at:$/!d
 	n
 	/^$/ n
 	s/^[ 	]*\(.*\) \([^ ]*\)/please pull\
@@ -102,7 +102,7 @@ test_expect_success 'setup: two scripts for reading pull requests' '
 	/^        [a-zA-Z]/ n
 	/^[a-zA-Z]* ([0-9]*):\$/ n
 	/^\$/ N
-	/^\n[a-zA-Z]* ([0-9]*):\$/! {
+	/^\n[a-zA-Z]* ([0-9]*):\$/!{
 		a\\
 	SHORTLOG
 		D
-- 
1.6.6.2

[PATCH 2/5] git-request-pull.sh: remove -e switch to shell interpreter which breaks ksh

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:53

From: Brandon Casey <redacted>

The -e option causes the shell to exit immediately when a command exits
with a non-zero exit status.  This does not seem to cause a problem for
Bash, but it does cause a problem for the Korn shell, like Solaris's
xpg4/sh, whose unset utility returns non-zero if it is passed a variable
name which was not previously set.  When using xpg4/sh, git-request-pull
exits while sourcing git-sh-setup since git-sh-setup tries to unset the
CDPATH environment variable.

When git-request-pull was originally written, it did not do any error
checking and it used this shell feature to exit when an error occurred.
This script now performs proper error checking and provides useful error
messages, so this -e option appears to be merely a historical artifact and
can be removed.

Kudos to Jonathan Nieder for introducing t5150 which exercises the
request-pull code path.

Signed-off-by: Brandon Casey <redacted>
---
 git-request-pull.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-request-pull.sh b/git-request-pull.sh
index 74238b0..6dfb885 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/sh
 # Copyright 2005, Ryan Anderson <ryan@michonline.com>
 #
 # This file is licensed under the GPL v2, or a later version
-- 
1.6.6.2

[PATCH 1/5] t/t5800: skip if python version is older than 2.5

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:53

From: Brandon Casey <redacted>

This test script depends on the git-remote-testgit python script.  This
python script makes use of the hashlib module which was released in python
version 2.5.  So, add a new pre-requisite named PYTHON_2_5_OR_NEWER to
test-lib.sh and check for it in t5800.

Signed-off-by: Brandon Casey <redacted>
---
 t/t5800-remote-helpers.sh |    4 ++--
 t/test-lib.sh             |    9 +++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/t/t5800-remote-helpers.sh b/t/t5800-remote-helpers.sh
index 75a0163..58f60ab 100755
--- a/t/t5800-remote-helpers.sh
+++ b/t/t5800-remote-helpers.sh
@@ -7,9 +7,9 @@ test_description='Test remote-helper import and export commands'
 
 . ./test-lib.sh
 
-if ! test_have_prereq PYTHON
+if ! test_have_prereq PYTHON_2_5_OR_NEWER
 then
-	say 'skipping git remote-testgit tests: requires Python support'
+	say 'skipping git remote-testgit tests: requires Python 2.5 or newer'
 	test_done
 fi
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 454880a..ce56e1c 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -846,6 +846,15 @@ esac
 test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PYTHON" && test_set_prereq PYTHON
 
+if test_have_prereq PYTHON && "$PYTHON_PATH" -c '
+import sys
+if sys.hexversion < 0x02050000:
+    sys.exit(1)
+'
+then
+	test_set_prereq PYTHON_2_5_OR_NEWER
+fi
+
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
 rm -f y
-- 
1.6.6.2

[PATCH 5/5] t/aggregate-results: accomodate systems with small max argument list length

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:53

From: Brandon Casey <redacted>

IRIX 6.5 has a default maximum argument list length of 20480.  The file
glob that is passed to aggregate-results currently exceeds this length, and
so the script cannot run successfully.  Work around this issue by passing
the file names in via the standard input rather than the argument list.

Signed-off-by: Brandon Casey <redacted>
---
 t/Makefile             |    4 +++-
 t/aggregate-results.sh |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/t/Makefile b/t/Makefile
index 25c559b..cd008a3 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -35,7 +35,9 @@ aggregate-results-and-cleanup: $(T)
 	$(MAKE) clean
 
 aggregate-results:
-	'$(SHELL_PATH_SQ)' ./aggregate-results.sh test-results/t*-*
+	for f in test-results/t*-*; do \
+		echo "$$f"; \
+	done | '$(SHELL_PATH_SQ)' ./aggregate-results.sh
 
 # we can test NO_OPTIMIZE_COMMITS independently of LC_ALL
 full-svn-test:
diff --git a/t/aggregate-results.sh b/t/aggregate-results.sh
index d5bab75..d206b7c 100755
--- a/t/aggregate-results.sh
+++ b/t/aggregate-results.sh
@@ -6,7 +6,7 @@ failed=0
 broken=0
 total=0
 
-for file
+while read file
 do
 	while read type value
 	do
-- 
1.6.6.2

Re: [PATCH 3/5] t/t5150: remove space from sed script

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:48:53

Brandon Casey wrote:
Solaris's xpg4/sed and IRIX's sed fail to parse these negated matching
expressions when the '!' is separated from the command that follows.

Signed-off-by: Brandon Casey <redacted>
Good catch, thanks.

Acked-by: Jonathan Nieder <redacted>

Re: [PATCH 2/5] git-request-pull.sh: remove -e switch to shell interpreter which breaks ksh

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:48:53

Brandon Casey wrote:
When git-request-pull was originally written, it did not do any error
checking and it used this shell feature to exit when an error occurred.
This script now performs proper error checking and provides useful error
messages, so this -e option appears to be merely a historical artifact and
can be removed.
Also, the MinGW port ignores -e on a #! line, so we should not rely on it.
quoted hunk
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/sh
To maintain the old behavior, I think we would need something like
this:

-- 8< --
Subject: request-pull: more explicit error handling

git request-pull includes -e on its #! line to catch miscellaneous
errors, but most of the body of the script explicitly handles
errors.  Finish the job so we can remove the -e.

Suggested-by: Brandon Casey <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
diff --git a/git-request-pull.sh b/git-request-pull.sh
index 6dfb885..6fdea39 100755
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -70,10 +70,10 @@ git show -s --format='The following changes since commit %H:
 
   %s (%ci)
 
-are available in the git repository at:' $baserev
-echo "  $url $branch"
-echo
+are available in the git repository at:' $baserev &&
+echo "  $url $branch" &&
+echo &&
 
-git shortlog ^$baserev $headrev
-git diff -M --stat --summary $patch $merge_base..$headrev
+git shortlog ^$baserev $headrev &&
+git diff -M --stat --summary $patch $merge_base..$headrev || exit
 exit $status

Re: [PATCH 4/5] t/t7006: ignore return status of shell's unset builtin

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:48:53

Brandon Casey wrote:
The unset builtin of Solaris's xpg4/sh returns non-zero if it is passed a
variable name which was not previously set.
This is historical ksh behavior (only changed in 2009-01-14) even if
it violates SUSv2.  It probably comes up on a lot of platforms.
Thanks.

Acked-by: Jonathan Nieder <redacted>

Re: [PATCH 1/5] t/t5800: skip if python version is older than 2.5

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:48:54

Heya,

On Wed, Jun 2, 2010 at 02:13, Brandon Casey [off-list ref] wrote:
This test script depends on the git-remote-testgit python script.  This
python script makes use of the hashlib module which was released in python
version 2.5.  So, add a new pre-requisite named PYTHON_2_5_OR_NEWER to
test-lib.sh and check for it in t5800.
Perhaps instead we can change git-remote-testgit to do:

"try:
import hashlib
except ImportError:
import ?? as hashlib
"

Otoh, python 2.5 has been out for a while (and is in fact only
downloadable as a source-only release these days). To be exact, it was
released on September 19, 2006.


-- 
Cheers,

Sverre Rabbelier

Re: [PATCH 1/5] t/t5800: skip if python version is older than 2.5

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:48:54

Am 6/2/2010 2:13, schrieb Brandon Casey:
+if ! test_have_prereq PYTHON_2_5_OR_NEWER
 then
+	say 'skipping git remote-testgit tests: requires Python 2.5 or newer'
...
quoted hunk
+++ b/t/test-lib.sh
+if test_have_prereq PYTHON && "$PYTHON_PATH" -c '
+import sys
+if sys.hexversion < 0x02050000:
+    sys.exit(1)
+'
+then
+	test_set_prereq PYTHON_2_5_OR_NEWER
+fi
Please don't burden all test script invocations with this check when the
result is used in only one place.

-- Hannes

Re: [PATCH 4/5] t/t7006: ignore return status of shell's unset builtin

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:48:54

Am 6/2/2010 2:13, schrieb Brandon Casey:
 test_expect_success 'setup' '
-	unset GIT_PAGER GIT_PAGER_IN_USE &&
+	unset GIT_PAGER GIT_PAGER_IN_USE
Maybe we should terminate the line with ';' to document that it is a
deliberate choice that there is no '&&'?

Just an idea...

-- Hannes

Re: [PATCH 1/5] t/t5800: skip if python version is older than 2.5

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:48:54

On Wed, Jun 2, 2010 at 06:21, Sverre Rabbelier [off-list ref] wrote:
Otoh, python 2.5 has been out for a while (and is in fact only
downloadable as a source-only release these days). To be exact, it was
released on September 19, 2006.
As a trivia: most of our Perl code is still 5.6 compatible. That'd be
like supporting Python 1.6 (or actually, 1.5.2, 1.6 came out half a
year after Perl 5.6).

Anyway, dying in the program as you suggest seems like a better idea.

Re: [PATCH 2/5] git-request-pull.sh: remove -e switch to shell interpreter which breaks ksh

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:54

On 06/01/2010 11:30 PM, Jonathan Nieder wrote:
Brandon Casey wrote:
quoted
When git-request-pull was originally written, it did not do any error
checking and it used this shell feature to exit when an error occurred.
This script now performs proper error checking and provides useful error
messages, so this -e option appears to be merely a historical artifact and
can be removed.
Also, the MinGW port ignores -e on a #! line, so we should not rely on it.
quoted
--- a/git-request-pull.sh
+++ b/git-request-pull.sh
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/sh
To maintain the old behavior, I think we would need something like
this:

-- 8< --
Subject: request-pull: more explicit error handling
works for me.

Re: [PATCH 4/5] t/t7006: ignore return status of shell's unset builtin

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:54

On 06/02/2010 01:41 AM, Johannes Sixt wrote:
Am 6/2/2010 2:13, schrieb Brandon Casey:
quoted
 test_expect_success 'setup' '
-	unset GIT_PAGER GIT_PAGER_IN_USE &&
+	unset GIT_PAGER GIT_PAGER_IN_USE
Maybe we should terminate the line with ';' to document that it is a
deliberate choice that there is no '&&'?

Just an idea...
I like it.

Re: [PATCH 1/5] t/t5800: skip if python version is older than 2.5

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:54

On 06/02/2010 01:37 AM, Johannes Sixt wrote:
Am 6/2/2010 2:13, schrieb Brandon Casey:
quoted
+if ! test_have_prereq PYTHON_2_5_OR_NEWER
 then
+	say 'skipping git remote-testgit tests: requires Python 2.5 or newer'
...
quoted
+++ b/t/test-lib.sh
+if test_have_prereq PYTHON && "$PYTHON_PATH" -c '
+import sys
+if sys.hexversion < 0x02050000:
+    sys.exit(1)
+'
+then
+	test_set_prereq PYTHON_2_5_OR_NEWER
+fi
Please don't burden all test script invocations with this check when the
result is used in only one place.
Very good point.

Re: [PATCH 1/5] t/t5800: skip if python version is older than 2.5

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:54

On 06/02/2010 01:21 AM, Sverre Rabbelier wrote:
Heya,

On Wed, Jun 2, 2010 at 02:13, Brandon Casey [off-list ref] wrote:
quoted
This test script depends on the git-remote-testgit python script.  This
python script makes use of the hashlib module which was released in python
version 2.5.  So, add a new pre-requisite named PYTHON_2_5_OR_NEWER to
test-lib.sh and check for it in t5800.
Perhaps instead we can change git-remote-testgit to do:

"try:
import hashlib
except ImportError:
import ?? as hashlib
"
I can only guess at what that does. :)
Otoh, python 2.5 has been out for a while (and is in fact only
downloadable as a source-only release these days). To be exact, it was
released on September 19, 2006.
That's only long in python years. :)

RedHat's latest operating system still has version 2.4.3.

-brandon

Re: [PATCH 1/5] t/t5800: skip if python version is older than 2.5

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:54

On 06/02/2010 09:44 AM, Brandon Casey wrote:
On 06/02/2010 01:21 AM, Sverre Rabbelier wrote:
quoted
Heya,

On Wed, Jun 2, 2010 at 02:13, Brandon Casey [off-list ref] wrote:
quoted
This test script depends on the git-remote-testgit python script.  This
python script makes use of the hashlib module which was released in python
version 2.5.  So, add a new pre-requisite named PYTHON_2_5_OR_NEWER to
test-lib.sh and check for it in t5800.
Perhaps instead we can change git-remote-testgit to do:

"try:
import hashlib
except ImportError:
import ?? as hashlib
"
I can only guess at what that does. :)
Correction, I have no idea what that does.

Here's the patch:
diff --git a/git-remote-testgit.py b/git-remote-testgit.py
index 9253922..1371497 100644
--- a/git-remote-testgit.py
+++ b/git-remote-testgit.py
@@ -1,6 +1,9 @@
 #!/usr/bin/env python
 
-import hashlib
+try:
+    import hashlib
+except ImportError:
+    import ?? as hashlib
 import sys
 import os
 sys.path.insert(0, os.getenv("GITPYTHONLIB","."))


I get:

  File "<snip>/git-remote-testgit", line 6
    import ?? as hashlib
           ^
SyntaxError: invalid syntax

[PATCH 4/5 v2] t/t7006: ignore return status of shell's unset builtin

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:54

From: Brandon Casey <redacted>

The unset builtin of Solaris's xpg4/sh returns non-zero if it is passed a
variable name which was not previously set.  Since the unset is not likely
to fail, ignore its return status, but add a semicolon as a clue that the
'&&' was deliberately left off.

Signed-off-by: Brandon Casey <redacted>
---
 t/t7006-pager.sh |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 3bc7a2a..a6f3677 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -40,7 +40,7 @@ else
 fi
 
 test_expect_success 'setup' '
-	unset GIT_PAGER GIT_PAGER_IN_USE &&
+	unset GIT_PAGER GIT_PAGER_IN_USE;
 	test_might_fail git config --unset core.pager &&
 
 	PAGER="cat >paginated.out" &&
@@ -159,7 +159,7 @@ test_expect_success 'color when writing to a file intended for a pager' '
 '
 
 test_expect_success 'determine default pager' '
-	unset PAGER GIT_PAGER &&
+	unset PAGER GIT_PAGER;
 	test_might_fail git config --unset core.pager ||
 	cleanup_fail &&
 
@@ -173,7 +173,7 @@ then
 fi
 
 test_expect_success SIMPLEPAGER 'default pager is used by default' '
-	unset PAGER GIT_PAGER &&
+	unset PAGER GIT_PAGER;
 	test_might_fail git config --unset core.pager &&
 	rm -f default_pager_used ||
 	cleanup_fail &&
@@ -192,7 +192,7 @@ test_expect_success SIMPLEPAGER 'default pager is used by default' '
 '
 
 test_expect_success TTY 'PAGER overrides default pager' '
-	unset GIT_PAGER &&
+	unset GIT_PAGER;
 	test_might_fail git config --unset core.pager &&
 	rm -f PAGER_used ||
 	cleanup_fail &&
@@ -204,7 +204,7 @@ test_expect_success TTY 'PAGER overrides default pager' '
 '
 
 test_expect_success TTY 'core.pager overrides PAGER' '
-	unset GIT_PAGER &&
+	unset GIT_PAGER;
 	rm -f core.pager_used ||
 	cleanup_fail &&
 
-- 
1.6.6.2

Re: [PATCH 1/5] t/t5800: skip if python version is older than 2.5

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:48:54

Heya,

On Wed, Jun 2, 2010 at 17:15, Brandon Casey
[off-list ref] wrote:
Here's the patch:
That was not meant as a concrete suggestion :P. I meant that I did not
know what package is available in 2.4.x, so substitute it on the ??'s
:P. The ? does not mean anything.

-- 
Cheers,

Sverre Rabbelier

Re: [PATCH 1/5] t/t5800: skip if python version is older than 2.5

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:54

On 06/02/2010 11:38 AM, Sverre Rabbelier wrote:
Heya,

On Wed, Jun 2, 2010 at 17:15, Brandon Casey
[off-list ref] wrote:
quoted
Here's the patch:
That was not meant as a concrete suggestion :P. I meant that I did not
know what package is available in 2.4.x, so substitute it on the ??'s
:P. The ? does not mean anything.
Ha! That shows you how much python I know!

Hand, meet forehead.

-b

test suite work-around for python 2.5 requirement

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:54

On 06/02/2010 01:21 AM, Sverre Rabbelier wrote:
Heya,

On Wed, Jun 2, 2010 at 02:13, Brandon Casey [off-list ref] wrote:
quoted
This test script depends on the git-remote-testgit python script.  This
python script makes use of the hashlib module which was released in python
version 2.5.  So, add a new pre-requisite named PYTHON_2_5_OR_NEWER to
test-lib.sh and check for it in t5800.
Perhaps instead we can change git-remote-testgit to do:

"try:
import hashlib
except ImportError:
import ?? as hashlib
"
Here's a work-around for the test suite until we figure out
what ?? should be.

[PATCH 1/2] Makefile: add PYTHON_PATH to GIT-BUILD-OPTIONS
[PATCH 2/2] t/t5800: skip if python version is older than 2.5

[PATCH 1/2] Makefile: add PYTHON_PATH to GIT-BUILD-OPTIONS

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:54

From: Brandon Casey <redacted>

This allows the correct python to be used by the test suite.

Signed-off-by: Brandon Casey <redacted>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index d5d6565..7b5de0c 100644
--- a/Makefile
+++ b/Makefile
@@ -1885,6 +1885,7 @@ GIT-CFLAGS: FORCE
 GIT-BUILD-OPTIONS: FORCE
 	@echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
 	@echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@
+	@echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@
 	@echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
 	@echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
 	@echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
-- 
1.6.6.2

[PATCH 2/2] t/t5800: skip if python version is older than 2.5

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:54

From: Brandon Casey <redacted>

This test script depends on the git-remote-testgit python script.  The
git-remote-testgit script makes use of the hashlib module which was
released in python version 2.5.  So, check the python version and skip this
test if it's too old.

Signed-off-by: Brandon Casey <redacted>
---


By the way, I don't have python 2.5 or newer to test this. :p

-brandon


 t/t5800-remote-helpers.sh |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/t/t5800-remote-helpers.sh b/t/t5800-remote-helpers.sh
index 75a0163..2e5efe6 100755
--- a/t/t5800-remote-helpers.sh
+++ b/t/t5800-remote-helpers.sh
@@ -7,9 +7,13 @@ test_description='Test remote-helper import and export commands'
 
 . ./test-lib.sh
 
-if ! test_have_prereq PYTHON
+if ! test_have_prereq PYTHON || ! "$PYTHON_PATH" -c '
+import sys
+if sys.hexversion < 0x02050000:
+    sys.exit(1)
+'
 then
-	say 'skipping git remote-testgit tests: requires Python support'
+	say 'skipping git remote-testgit tests: requires Python 2.5 or newer'
 	test_done
 fi
 
-- 
1.6.6.2

Re: [PATCH 2/5] git-request-pull.sh: remove -e switch to shell interpreter which breaks ksh

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:54

Brandon Casey [off-list ref] writes:
On 06/01/2010 11:30 PM, Jonathan Nieder wrote:
quoted
Brandon Casey wrote:
 ...
To maintain the old behavior, I think we would need something like
this:

-- 8< --
Subject: request-pull: more explicit error handling
works for me.
Will squash into a single patch; thanks.

Re: [PATCH 2/2] t/t5800: skip if python version is older than 2.5

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:49:20

Heya,

On Wed, Jun 2, 2010 at 18:23, Brandon Casey [off-list ref] wrote:
-if ! test_have_prereq PYTHON
+if ! test_have_prereq PYTHON || ! "$PYTHON_PATH" -c '
+import sys
+if sys.hexversion < 0x02050000:
+    sys.exit(1)
+'
I just checkout out this revision, there is no PYTHON_PATH variable. So:

sverre@laptop-sverre:~/code/git/t$ make t5800-remote-helpers.sh
*** t5800-remote-helpers.sh ***
t5800-remote-helpers.sh: line 10: : command not found
* skipping git remote-testgit tests: requires Python 2.5 or newer
* passed all 0 test(s)

I'm not sure what is wrong here, but somehow the PYTHON_PATH variable
is not propagated to the script?

-- 
Cheers,

Sverre Rabbelier

Re: [PATCH 2/2] t/t5800: skip if python version is older than 2.5

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:20

Sverre Rabbelier wrote:
sverre@laptop-sverre:~/code/git/t$ make t5800-remote-helpers.sh
*** t5800-remote-helpers.sh ***
t5800-remote-helpers.sh: line 10: : command not found
* skipping git remote-testgit tests: requires Python 2.5 or newer
* passed all 0 test(s)

I'm not sure what is wrong here, but somehow the PYTHON_PATH variable
is not propagated to the script?
Hmm, what does your GIT-BUILD-OPTIONS say?

Re: [PATCH 2/2] t/t5800: skip if python version is older than 2.5

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:49:20

Heya,

On Tue, Aug 17, 2010 at 18:28, Jonathan Nieder [off-list ref] wrote:
Hmm, what does your GIT-BUILD-OPTIONS say?
sverre@laptop-sverre:~/code/git$ cat GIT-BUILD-OPTIONS
SHELL_PATH='/bin/sh'
PERL_PATH='/usr/bin/perl'
TAR='tar'
NO_CURL=''
NO_PERL=''
NO_PYTHON=''

-- 
Cheers,

Sverre Rabbelier

Re: [PATCH 2/2] t/t5800: skip if python version is older than 2.5

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:20

Hi again,

Sverre Rabbelier wrote:
sverre@laptop-sverre:~/code/git$ cat GIT-BUILD-OPTIONS
SHELL_PATH='/bin/sh'
PERL_PATH='/usr/bin/perl'
TAR='tar'
NO_CURL=''
NO_PERL=''
NO_PYTHON=''
I see.  Maybe this is fixed by v1.7.2-rc0~33^2~1 (Makefile: add
PYTHON_PATH to GIT-BUILD-OPTIONS, 2010-06-09) from later in the
same series.

Re: [PATCH 2/2] t/t5800: skip if python version is older than 2.5

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:49:20

Heya,

On Tue, Aug 17, 2010 at 18:37, Jonathan Nieder [off-list ref] wrote:
I see.  Maybe this is fixed by v1.7.2-rc0~33^2~1 (Makefile: add
PYTHON_PATH to GIT-BUILD-OPTIONS, 2010-06-09) from later in the
same series.
Ah, correct. So that should have gone before this one. It works if I
check out and build that one. Thanks.

-- 
Cheers,

Sverre Rabbelier

Re: [PATCH 2/2] t/t5800: skip if python version is older than 2.5

From: Brandon Casey <hidden>
Date: 2016-06-15 22:49:20

On Tue, Aug 17, 2010 at 7:10 PM, Sverre Rabbelier [off-list ref] wrote:
Heya,

On Tue, Aug 17, 2010 at 18:37, Jonathan Nieder [off-list ref] wrote:
quoted
I see.  Maybe this is fixed by v1.7.2-rc0~33^2~1 (Makefile: add
PYTHON_PATH to GIT-BUILD-OPTIONS, 2010-06-09) from later in the
same series.
Well not actually the same series.  If I recall correctly, the
original version of
this 'skip if python vers...' patch was replaced by a resend of two patches and
one of them did the' propagate PYTHON_PATH to GIT-BUILD-OPTIONS' thing.

I think Junio ended up fixing up the original patch by hand, and the PYTHON_PATH
bit got dropped.

Later on I resent it.
Ah, correct. So that should have gone before this one. It works if I
check out and build that one. Thanks.
Also, note that the test should complete successfully if run via 'make
test' since
PYTHON_PATH is exported in the Makefile.  That's why I didn't notice the
flaw at first.

-Brandon
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help