{"thread":{"id":"30770","subject":"[PATCH] t: Replace 'perl' by $PERL_PATH","startedAt":"2012-06-11T19:01:53Z","lastAt":"2012-06-20T20:16:17Z","messageCount":15,"participants":["vfr@lyx.org","Junio C Hamano","Jeff King","Erik Faye-Lund","Vincent van Ravesteijn","Torsten Bögershausen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"193355","messageId":"1339441313-5296-1-git-send-email-vfr@lyx.org","threadId":"30770","inReplyTo":null,"subject":"[PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"","fromEmail":"vfr@lyx.org","sentAt":"2012-06-11T19:01:53Z","receivedAt":"2012-06-11T19:01:53Z","isPatch":true,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"From: Vincent van Ravesteijn <vfr@lyx.org>\n\nGIT-BUILD-OPTIONS defines PERL_PATH to be used in the test suite. Only a\nfew tests already actually use this variable when perl is needed. The\nother test just call 'perl' and it might happen that the wrong perl\ninterpreter is used.\n\nThis becomes problematic on Windows, when the perl interpreter that is\ncompiled and installed on the Windows system is used, because this perl\ninterpreter might introduce some unexpected LF->CRLF conversions.\n\nThis patch makes sure that $PERL_PATH is used everywhere in the test suite\nand that the correct perl interpreter is used.\n\nSigned-off-by: Vincent van Ravesteijn <vfr@lyx.org>\n---\n t/t1010-mktree.sh                         |    4 ++--\n t/t3300-funny-names.sh                    |    6 +++---\n t/t4014-format-patch.sh                   |    2 +-\n t/t4020-diff-external.sh                  |    2 +-\n t/t4029-diff-trailing-space.sh            |    2 +-\n t/t4030-diff-textconv.sh                  |    2 +-\n t/t4031-diff-rewrite-binary.sh            |    2 +-\n t/t4103-apply-binary.sh                   |    4 ++--\n t/t4116-apply-reverse.sh                  |    4 ++--\n t/t4200-rerere.sh                         |    8 ++++----\n t/t5300-pack-object.sh                    |    8 ++++----\n t/t5303-pack-corruption-resilience.sh     |    4 ++--\n t/t5532-fetch-proxy.sh                    |    2 +-\n t/t5551-http-fetch.sh                     |    2 +-\n t/t6011-rev-list-with-bad-commit.sh       |    2 +-\n t/t6013-rev-list-reverse-parents.sh       |    4 ++--\n t/t7508-status.sh                         |    2 +-\n t/t8006-blame-textconv.sh                 |    2 +-\n t/t9129-git-svn-i18n-commitencoding.sh    |    2 +-\n t/t9137-git-svn-dcommit-clobber-series.sh |    8 ++++----\n t/t9300-fast-import.sh                    |    2 +-\n t/t9350-fast-export.sh                    |    2 +-\n t/t9810-git-p4-rcs.sh                     |    2 +-\n t/test-lib-functions.sh                   |    4 ++--\n 24 files changed, 41 insertions(+), 41 deletions(-)\n\ndiff --git a/t/t1010-mktree.sh b/t/t1010-mktree.sh\nindex b946f87..3535761 100755\n--- a/t/t1010-mktree.sh\n+++ b/t/t1010-mktree.sh\n@@ -42,13 +42,13 @@ test_expect_success 'ls-tree piped to mktree (2)' '\n '\n \n test_expect_success 'ls-tree output in wrong order given to mktree (1)' '\n-\tperl -e \"print reverse <>\" <top |\n+\t$PERL_PATH -e \"print reverse <>\" <top |\n \tgit mktree >actual &&\n \ttest_cmp tree actual\n '\n \n test_expect_success 'ls-tree output in wrong order given to mktree (2)' '\n-\tperl -e \"print reverse <>\" <top.withsub |\n+\t$PERL_PATH -e \"print reverse <>\" <top.withsub |\n \tgit mktree >actual &&\n \ttest_cmp tree.withsub actual\n '\ndiff --git a/t/t3300-funny-names.sh b/t/t3300-funny-names.sh\nindex c53c9f6..f42adc4 100755\n--- a/t/t3300-funny-names.sh\n+++ b/t/t3300-funny-names.sh\n@@ -71,7 +71,7 @@ test_expect_success 'ls-files -z does not quote funny filename' '\n \ttabs\t,\" (dq) and spaces\n \tEOF\n \tgit ls-files -z >ls-files.z &&\n-\tperl -pe \"y/\\000/\\012/\" <ls-files.z >current &&\n+\t$PERL_PATH -pe \"y/\\000/\\012/\" <ls-files.z >current &&\n \ttest_cmp expected current\n '\n \n@@ -108,7 +108,7 @@ test_expect_success 'diff-index -z does not quote funny filename' '\n \ttabs\t,\" (dq) and spaces\n \tEOF\n \tgit diff-index -z --name-status $t0 >diff-index.z &&\n-\tperl -pe \"y/\\000/\\012/\" <diff-index.z >current &&\n+\t$PERL_PATH -pe \"y/\\000/\\012/\" <diff-index.z >current &&\n \ttest_cmp expected current\n '\n \n@@ -118,7 +118,7 @@ test_expect_success 'diff-tree -z does not quote funny filename' '\n \ttabs\t,\" (dq) and spaces\n \tEOF\n \tgit diff-tree -z --name-status $t0 $t1 >diff-tree.z &&\n-\tperl -pe y/\\\\000/\\\\012/ <diff-tree.z >current &&\n+\t$PERL_PATH -pe y/\\\\000/\\\\012/ <diff-tree.z >current &&\n \ttest_cmp expected current\n '\n \ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex b473b6d..4c22c17 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -243,7 +243,7 @@ check_threading () {\n \t(git format-patch --stdout \"$@\"; echo $? > status.out) |\n \t# Prints everything between the Message-ID and In-Reply-To,\n \t# and replaces all Message-ID-lookalikes by a sequence number\n-\tperl -ne '\n+\t$PERL_PATH -ne '\n \t\tif (/^(message-id|references|in-reply-to)/i) {\n \t\t\t$printing = 1;\n \t\t} elsif (/^\\S/) {\ndiff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh\nindex 083f62d..3d9307b 100755\n--- a/t/t4020-diff-external.sh\n+++ b/t/t4020-diff-external.sh\n@@ -118,7 +118,7 @@ test_expect_success 'no diff with -diff' '\n \tgit diff | grep Binary\n '\n \n-echo NULZbetweenZwords | perl -pe 'y/Z/\\000/' > file\n+echo NULZbetweenZwords | $PERL_PATH -pe 'y/Z/\\000/' > file\n \n test_expect_success 'force diff with \"diff\"' '\n \techo >.gitattributes \"file diff\" &&\ndiff --git a/t/t4029-diff-trailing-space.sh b/t/t4029-diff-trailing-space.sh\nindex 3ccc237..7f7f504 100755\n--- a/t/t4029-diff-trailing-space.sh\n+++ b/t/t4029-diff-trailing-space.sh\n@@ -27,7 +27,7 @@ test_expect_success \\\n      git config --bool diff.suppressBlankEmpty true &&\n      git diff f > actual &&\n      test_cmp exp actual &&\n-     perl -i.bak -p -e \"s/^\\$/ /\" exp &&\n+     $PERL_PATH -i.bak -p -e \"s/^\\$/ /\" exp &&\n      git config --bool diff.suppressBlankEmpty false &&\n      git diff f > actual &&\n      test_cmp exp actual &&\ndiff --git a/t/t4030-diff-textconv.sh b/t/t4030-diff-textconv.sh\nindex d4ab4f2..82e36ec 100755\n--- a/t/t4030-diff-textconv.sh\n+++ b/t/t4030-diff-textconv.sh\n@@ -21,7 +21,7 @@ EOF\n \n cat >hexdump <<'EOF'\n #!/bin/sh\n-perl -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < \"$1\"\n+$PERL_PATH -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < \"$1\"\n EOF\n chmod +x hexdump\n \ndiff --git a/t/t4031-diff-rewrite-binary.sh b/t/t4031-diff-rewrite-binary.sh\nindex c8296fa..e8ee06e 100755\n--- a/t/t4031-diff-rewrite-binary.sh\n+++ b/t/t4031-diff-rewrite-binary.sh\n@@ -60,7 +60,7 @@ test_expect_success 'diff --stat counts binary rewrite as 0 lines' '\n {\n \techo \"#!$SHELL_PATH\"\n \tcat <<'EOF'\n-perl -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < \"$1\"\n+$PERL_PATH -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < \"$1\"\n EOF\n } >dump\n chmod +x dump\ndiff --git a/t/t4103-apply-binary.sh b/t/t4103-apply-binary.sh\nindex dbbf56c..5b533cf 100755\n--- a/t/t4103-apply-binary.sh\n+++ b/t/t4103-apply-binary.sh\n@@ -25,10 +25,10 @@ test_expect_success 'setup' \"\n \tgit commit -m 'Initial Version' 2>/dev/null &&\n \n \tgit checkout -b binary &&\n-\tperl -pe 'y/x/\\000/' <file1 >file3 &&\n+\t$PERL_PATH -pe 'y/x/\\000/' <file1 >file3 &&\n \tcat file3 >file4 &&\n \tgit add file2 &&\n-\tperl -pe 'y/\\000/v/' <file3 >file1 &&\n+\t$PERL_PATH -pe 'y/\\000/v/' <file3 >file1 &&\n \trm -f file2 &&\n \tgit update-index --add --remove file1 file2 file3 file4 &&\n \tgit commit -m 'Second Version' &&\ndiff --git a/t/t4116-apply-reverse.sh b/t/t4116-apply-reverse.sh\nindex 2298ece..7b0c02a 100755\n--- a/t/t4116-apply-reverse.sh\n+++ b/t/t4116-apply-reverse.sh\n@@ -12,14 +12,14 @@ test_description='git apply in reverse\n test_expect_success setup '\n \n \tfor i in a b c d e f g h i j k l m n; do echo $i; done >file1 &&\n-\tperl -pe \"y/ijk/\\\\000\\\\001\\\\002/\" <file1 >file2 &&\n+\t$PERL_PATH -pe \"y/ijk/\\\\000\\\\001\\\\002/\" <file1 >file2 &&\n \n \tgit add file1 file2 &&\n \tgit commit -m initial &&\n \tgit tag initial &&\n \n \tfor i in a b c g h i J K L m o n p q; do echo $i; done >file1 &&\n-\tperl -pe \"y/mon/\\\\000\\\\001\\\\002/\" <file1 >file2 &&\n+\t$PERL_PATH -pe \"y/mon/\\\\000\\\\001\\\\002/\" <file1 >file2 &&\n \n \tgit commit -a -m second &&\n \tgit tag second &&\ndiff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh\nindex 36255d6..ec7622c 100755\n--- a/t/t4200-rerere.sh\n+++ b/t/t4200-rerere.sh\n@@ -78,7 +78,7 @@ test_expect_success 'activate rerere, old style (conflicting merge)' '\n \ttest_might_fail git config --unset rerere.enabled &&\n \ttest_must_fail git merge first &&\n \n-\tsha1=$(perl -pe \"s/\t.*//\" .git/MERGE_RR) &&\n+\tsha1=$($PERL_PATH -pe \"s/\t.*//\" .git/MERGE_RR) &&\n \trr=.git/rr-cache/$sha1 &&\n \tgrep \"^=======\\$\" $rr/preimage &&\n \t! test -f $rr/postimage &&\n@@ -91,7 +91,7 @@ test_expect_success 'rerere.enabled works, too' '\n \tgit reset --hard &&\n \ttest_must_fail git merge first &&\n \n-\tsha1=$(perl -pe \"s/\t.*//\" .git/MERGE_RR) &&\n+\tsha1=$($PERL_PATH -pe \"s/\t.*//\" .git/MERGE_RR) &&\n \trr=.git/rr-cache/$sha1 &&\n \tgrep ^=======$ $rr/preimage\n '\n@@ -101,7 +101,7 @@ test_expect_success 'set up rr-cache' '\n \tgit config rerere.enabled true &&\n \tgit reset --hard &&\n \ttest_must_fail git merge first &&\n-\tsha1=$(perl -pe \"s/\t.*//\" .git/MERGE_RR) &&\n+\tsha1=$($PERL_PATH -pe \"s/\t.*//\" .git/MERGE_RR) &&\n \trr=.git/rr-cache/$sha1\n '\n \n@@ -185,7 +185,7 @@ test_expect_success 'rerere updates postimage timestamp' '\n \n test_expect_success 'rerere clear' '\n \trm $rr/postimage &&\n-\techo \"$sha1\ta1\" | perl -pe \"y/\\012/\\000/\" >.git/MERGE_RR &&\n+\techo \"$sha1\ta1\" | $PERL_PATH -pe \"y/\\012/\\000/\" >.git/MERGE_RR &&\n \tgit rerere clear &&\n \t! test -d $rr\n '\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex d9d856b..a97bb74 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -13,9 +13,9 @@ TRASH=`pwd`\n test_expect_success \\\n     'setup' \\\n     'rm -f .git/index* &&\n-     perl -e \"print \\\"a\\\" x 4096;\" > a &&\n-     perl -e \"print \\\"b\\\" x 4096;\" > b &&\n-     perl -e \"print \\\"c\\\" x 4096;\" > c &&\n+     $PERL_PATH -e \"print \\\"a\\\" x 4096;\" > a &&\n+     $PERL_PATH -e \"print \\\"b\\\" x 4096;\" > b &&\n+     $PERL_PATH -e \"print \\\"c\\\" x 4096;\" > c &&\n      test-genrandom \"seed a\" 2097152 > a_big &&\n      test-genrandom \"seed b\" 2097152 > b_big &&\n      git update-index --add a a_big b b_big c &&\n@@ -129,7 +129,7 @@ test_expect_success \\\n cd \"$TRASH\"\n \n test_expect_success 'compare delta flavors' '\n-\tperl -e '\\''\n+\t$PERL_PATH -e '\\''\n \t\tdefined($_ = -s $_) or die for @ARGV;\n \t\texit 1 if $ARGV[0] <= $ARGV[1];\n \t'\\'' test-2-$packname_2.pack test-3-$packname_3.pack\ndiff --git a/t/t5303-pack-corruption-resilience.sh b/t/t5303-pack-corruption-resilience.sh\nindex 5f6cd4f..ee4e1af 100755\n--- a/t/t5303-pack-corruption-resilience.sh\n+++ b/t/t5303-pack-corruption-resilience.sh\n@@ -98,7 +98,7 @@ test_expect_success \\\n     'create_new_pack &&\n      git prune-packed &&\n      chmod +w ${pack}.pack &&\n-     perl -i.bak -pe \"s/ base /abcdef/\" ${pack}.pack &&\n+     $PERL_PATH -i.bak -pe \"s/ base /abcdef/\" ${pack}.pack &&\n      test_must_fail git cat-file blob $blob_1 > /dev/null &&\n      test_must_fail git cat-file blob $blob_2 > /dev/null &&\n      test_must_fail git cat-file blob $blob_3 > /dev/null'\n@@ -155,7 +155,7 @@ test_expect_success \\\n     'create_new_pack &&\n      git prune-packed &&\n      chmod +w ${pack}.pack &&\n-     perl -i.bak -pe \"s/ delta1 /abcdefgh/\" ${pack}.pack &&\n+     $PERL_PATH -i.bak -pe \"s/ delta1 /abcdefgh/\" ${pack}.pack &&\n      git cat-file blob $blob_1 > /dev/null &&\n      test_must_fail git cat-file blob $blob_2 > /dev/null &&\n      test_must_fail git cat-file blob $blob_3 > /dev/null'\ndiff --git a/t/t5532-fetch-proxy.sh b/t/t5532-fetch-proxy.sh\nindex 62f2460..6ef4378 100755\n--- a/t/t5532-fetch-proxy.sh\n+++ b/t/t5532-fetch-proxy.sh\n@@ -15,7 +15,7 @@ test_expect_success 'setup remote repo' '\n cat >proxy <<'EOF'\n #!/bin/sh\n echo >&2 \"proxying for $*\"\n-cmd=`perl -e '\n+cmd=`$PERL_PATH -e '\n \tread(STDIN, $buf, 4);\n \tmy $n = hex($buf) - 4;\n \tread(STDIN, $buf, $n);\ndiff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh\nindex be6094b..0667a3b 100755\n--- a/t/t5551-http-fetch.sh\n+++ b/t/t5551-http-fetch.sh\n@@ -130,7 +130,7 @@ test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '\n \tdone | git fast-import --export-marks=marks &&\n \n \t# now assign tags to all the dangling commits we created above\n-\ttag=$(perl -e \"print \\\"bla\\\" x 30\") &&\n+\ttag=$($PERL_PATH -e \"print \\\"bla\\\" x 30\") &&\n \tsed -e \"s/^:\\(.\\+\\) \\(.\\+\\)$/\\2 refs\\/tags\\/$tag-\\1/\" <marks >>packed-refs\n \t)\n '\ndiff --git a/t/t6011-rev-list-with-bad-commit.sh b/t/t6011-rev-list-with-bad-commit.sh\nindex e51eb41..b2c6125 100755\n--- a/t/t6011-rev-list-with-bad-commit.sh\n+++ b/t/t6011-rev-list-with-bad-commit.sh\n@@ -37,7 +37,7 @@ test_expect_success 'verify number of revisions' \\\n \n test_expect_success 'corrupt second commit object' \\\n    '\n-   perl -i.bak -pe \"s/second commit/socond commit/\" .git/objects/pack/*.pack &&\n+   $PERL_PATH -i.bak -pe \"s/second commit/socond commit/\" .git/objects/pack/*.pack &&\n    test_must_fail git fsck --full\n    '\n \ndiff --git a/t/t6013-rev-list-reverse-parents.sh b/t/t6013-rev-list-reverse-parents.sh\nindex 59fc2f0..3178c14 100755\n--- a/t/t6013-rev-list-reverse-parents.sh\n+++ b/t/t6013-rev-list-reverse-parents.sh\n@@ -25,7 +25,7 @@ test_expect_success 'set up --reverse example' '\n \n test_expect_success '--reverse --parents --full-history combines correctly' '\n \tgit rev-list --parents --full-history master -- foo |\n-\t\tperl -e \"print reverse <>\" > expected &&\n+\t\t$PERL_PATH -e \"print reverse <>\" > expected &&\n \tgit rev-list --reverse --parents --full-history master -- foo \\\n \t\t> actual &&\n \ttest_cmp actual expected\n@@ -33,7 +33,7 @@ test_expect_success '--reverse --parents --full-history combines correctly' '\n \n test_expect_success '--boundary does too' '\n \tgit rev-list --boundary --parents --full-history master ^root -- foo |\n-\t\tperl -e \"print reverse <>\" > expected &&\n+\t\t$PERL_PATH -e \"print reverse <>\" > expected &&\n \tgit rev-list --boundary --reverse --parents --full-history \\\n \t\tmaster ^root -- foo > actual &&\n \ttest_cmp actual expected\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex 28e1848..5e9160f 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -941,7 +941,7 @@ test_expect_success 'status -s submodule summary (clean submodule)' '\n \n test_expect_success 'status -z implies porcelain' '\n \tgit status --porcelain |\n-\tperl -pe \"s/\\012/\\000/g\" >expect &&\n+\t$PERL_PATH -pe \"s/\\012/\\000/g\" >expect &&\n \tgit status -z >output &&\n \ttest_cmp expect output\n '\ndiff --git a/t/t8006-blame-textconv.sh b/t/t8006-blame-textconv.sh\nindex c3c22f7..06b8f86 100755\n--- a/t/t8006-blame-textconv.sh\n+++ b/t/t8006-blame-textconv.sh\n@@ -10,7 +10,7 @@ find_blame() {\n cat >helper <<'EOF'\n #!/bin/sh\n grep -q '^bin: ' \"$1\" || { echo \"E: $1 is not \\\"binary\\\" file\" 1>&2; exit 1; }\n-perl -p -e 's/^bin: /converted: /' \"$1\"\n+$PERL_PATH -p -e 's/^bin: /converted: /' \"$1\"\n EOF\n chmod +x helper\n \ndiff --git a/t/t9129-git-svn-i18n-commitencoding.sh b/t/t9129-git-svn-i18n-commitencoding.sh\nindex 8cfdfe7..c9c8d02 100755\n--- a/t/t9129-git-svn-i18n-commitencoding.sh\n+++ b/t/t9129-git-svn-i18n-commitencoding.sh\n@@ -29,7 +29,7 @@ fi\n compare_svn_head_with () {\n \t# extract just the log message and strip out committer info.\n \t# don't use --limit here since svn 1.1.x doesn't have it,\n-\tLC_ALL=\"$a_utf8_locale\" svn log `git svn info --url` | perl -w -e '\n+\tLC_ALL=\"$a_utf8_locale\" svn log `git svn info --url` | $PERL_PATH -w -e '\n \t\tuse bytes;\n \t\t$/ = (\"-\"x72) . \"\\n\";\n \t\tmy @x = <STDIN>;\ndiff --git a/t/t9137-git-svn-dcommit-clobber-series.sh b/t/t9137-git-svn-dcommit-clobber-series.sh\nindex d60da63..726875a 100755\n--- a/t/t9137-git-svn-dcommit-clobber-series.sh\n+++ b/t/t9137-git-svn-dcommit-clobber-series.sh\n@@ -20,8 +20,8 @@ test_expect_success '(supposedly) non-conflicting change from SVN' '\n \ttest x\"`sed -n -e 61p < file`\" = x61 &&\n \tsvn_cmd co \"$svnrepo\" tmp &&\n \t(cd tmp &&\n-\t\tperl -i.bak -p -e \"s/^58$/5588/\" file &&\n-\t\tperl -i.bak -p -e \"s/^61$/6611/\" file &&\n+\t\t$PERL_PATH -i.bak -p -e \"s/^58$/5588/\" file &&\n+\t\t$PERL_PATH -i.bak -p -e \"s/^61$/6611/\" file &&\n \t\tpoke file &&\n \t\ttest x\"`sed -n -e 58p < file`\" = x5588 &&\n \t\ttest x\"`sed -n -e 61p < file`\" = x6611 &&\n@@ -40,8 +40,8 @@ test_expect_success 'some unrelated changes to git' \"\n test_expect_success 'change file but in unrelated area' \"\n \ttest x\\\"\\`sed -n -e 4p < file\\`\\\" = x4 &&\n \ttest x\\\"\\`sed -n -e 7p < file\\`\\\" = x7 &&\n-\tperl -i.bak -p -e 's/^4\\$/4444/' file &&\n-\tperl -i.bak -p -e 's/^7\\$/7777/' file &&\n+\t$PERL_PATH -i.bak -p -e 's/^4\\$/4444/' file &&\n+\t$PERL_PATH -i.bak -p -e 's/^7\\$/7777/' file &&\n \ttest x\\\"\\`sed -n -e 4p < file\\`\\\" = x4444 &&\n \ttest x\\\"\\`sed -n -e 7p < file\\`\\\" = x7777 &&\n \tgit commit -m '4 => 4444, 7 => 7777' file &&\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex 2aa1824..007e5af 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -12,7 +12,7 @@ test_description='test git fast-import utility'\n # This could be written as \"head -c $1\", but IRIX \"head\" does not\n # support the -c option.\n head_c () {\n-\tperl -e '\n+\t$PERL_PATH -e '\n \t\tmy $len = $ARGV[1];\n \t\twhile ($len > 0) {\n \t\t\tmy $s;\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex b00196b..6b6dc20 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -424,7 +424,7 @@ test_expect_success 'fast-export quotes pathnames' '\n \t\t--cacheinfo 100644 $blob \"path with \\\\backslash\" \\\n \t\t--cacheinfo 100644 $blob \"path with space\" &&\n \t git commit -m addition &&\n-\t git ls-files -z -s | perl -0pe \"s{\\\\t}{$&subdir/}\" >index &&\n+\t git ls-files -z -s | $PERL_PATH -0pe \"s{\\\\t}{$&subdir/}\" >index &&\n \t git read-tree --empty &&\n \t git update-index -z --index-info <index &&\n \t git commit -m rename &&\ndiff --git a/t/t9810-git-p4-rcs.sh b/t/t9810-git-p4-rcs.sh\nindex d8d9ca4..ce38c10 100755\n--- a/t/t9810-git-p4-rcs.sh\n+++ b/t/t9810-git-p4-rcs.sh\n@@ -246,7 +246,7 @@ test_expect_success 'cope with rcs keyword expansion damage' '\n \t\tgit config git-p4.attemptRCSCleanup true &&\n \t\t(cd ../cli && p4_append_to_file kwfile1.c) &&\n \t\told_lines=$(wc -l <kwfile1.c) &&\n-\t\tperl -n -i -e \"print unless m/Revision:/\" kwfile1.c &&\n+\t\t$PERL_PATH -n -i -e \"print unless m/Revision:/\" kwfile1.c &&\n \t\tnew_lines=$(wc -l <kwfile1.c) &&\n \t\ttest $new_lines = $(($old_lines - 1)) &&\n \ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 7b3b4be..fc0c080 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -76,11 +76,11 @@ test_decode_color () {\n }\n \n nul_to_q () {\n-\tperl -pe 'y/\\000/Q/'\n+\t$PERL_PATH -pe 'y/\\000/Q/'\n }\n \n q_to_nul () {\n-\tperl -pe 'y/Q/\\000/'\n+\t$PERL_PATH -pe 'y/Q/\\000/'\n }\n \n q_to_cr () {\n-- \n1.7.9.msysgit.0\n"},{"id":"193362","messageId":"7v1ull7j9k.fsf@alter.siamese.dyndns.org","threadId":"30770","inReplyTo":"1339441313-5296-1-git-send-email-vfr@lyx.org","subject":"Re: [PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-11T19:15:03Z","receivedAt":"2012-06-11T19:15:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"vfr@lyx.org writes:\n\n> From: Vincent van Ravesteijn <vfr@lyx.org>\n>\n> GIT-BUILD-OPTIONS defines PERL_PATH to be used in the test suite. Only a\n> few tests already actually use this variable when perl is needed. The\n> other test just call 'perl' and it might happen that the wrong perl\n> interpreter is used.\n>\n> This becomes problematic on Windows, when the perl interpreter that is\n> compiled and installed on the Windows system is used, because this perl\n> interpreter might introduce some unexpected LF->CRLF conversions.\n>\n> This patch makes sure that $PERL_PATH is used everywhere in the test suite\n> and that the correct perl interpreter is used.\n>\n> Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>\n> ---\n\nThere was already this discussion:\n\n    http://thread.gmane.org/gmane.comp.version-control.git/132560/focus=132561\n\nwhich basically dismissed effort along this line with \"If the perl\nin your PATH is so broken that it can't be used for simple helpers,\nthen you should fix your PATH.\"\n\nI personally do not mind if we do this consistently, but I am not\nsure your $PERL_PATH that is not quoted is the right way to invoke\nit; look for PERL_PATH in t/ to see the existing uses.\n"},{"id":"193431","messageId":"20120612123454.GA25407@sigill.intra.peff.net","threadId":"30770","inReplyTo":"7v1ull7j9k.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-06-12T12:34:54Z","receivedAt":"2012-06-12T12:34:54Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jun 11, 2012 at 12:15:03PM -0700, Junio C Hamano wrote:\n\n> There was already this discussion:\n> \n>     http://thread.gmane.org/gmane.comp.version-control.git/132560/focus=132561\n> \n> which basically dismissed effort along this line with \"If the perl\n> in your PATH is so broken that it can't be used for simple helpers,\n> then you should fix your PATH.\"\n\nThat sounds like something I would say. :)\n\n> I personally do not mind if we do this consistently, but I am not\n> sure your $PERL_PATH that is not quoted is the right way to invoke\n> it; look for PERL_PATH in t/ to see the existing uses.\n\nMy biggest concern is placing an extra portability burden on\ntest-writers (who will inevitably forget, and won't notice because what\nthey are doing is only broken on obscure systems). Is there a way we can\nhide this behind a perl() shell function or something?\n\n-Peff\n"},{"id":"193449","messageId":"7v4nqg4lzb.fsf@alter.siamese.dyndns.org","threadId":"30770","inReplyTo":"20120612123454.GA25407@sigill.intra.peff.net","subject":"Re: [PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-12T14:56:56Z","receivedAt":"2012-06-12T14:56:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n>> I personally do not mind if we do this consistently, but I am not\n>> sure your $PERL_PATH that is not quoted is the right way to invoke\n>> it; look for PERL_PATH in t/ to see the existing uses.\n>\n> My biggest concern is placing an extra portability burden on\n> test-writers (who will inevitably forget, and won't notice because what\n> they are doing is only broken on obscure systems). Is there a way we can\n> hide this behind a perl() shell function or something?\n\nI am hoping that writing 'perl' without any adornment will hopefully\nstand out like a sore thumb if all perl invocations in existing code\nare spelled '\"$PERL_PATH\"'.  We forbid \"! git cmd\" and tell people\nto write \"test_must_fail git cmd\" instead, and I think it has worked\nreasonably well.\n"},{"id":"193450","messageId":"20120612145937.GA9200@sigill.intra.peff.net","threadId":"30770","inReplyTo":"7v4nqg4lzb.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-06-12T14:59:37Z","receivedAt":"2012-06-12T14:59:37Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jun 12, 2012 at 07:56:56AM -0700, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> >> I personally do not mind if we do this consistently, but I am not\n> >> sure your $PERL_PATH that is not quoted is the right way to invoke\n> >> it; look for PERL_PATH in t/ to see the existing uses.\n> >\n> > My biggest concern is placing an extra portability burden on\n> > test-writers (who will inevitably forget, and won't notice because what\n> > they are doing is only broken on obscure systems). Is there a way we can\n> > hide this behind a perl() shell function or something?\n> \n> I am hoping that writing 'perl' without any adornment will hopefully\n> stand out like a sore thumb if all perl invocations in existing code\n> are spelled '\"$PERL_PATH\"'.  We forbid \"! git cmd\" and tell people\n> to write \"test_must_fail git cmd\" instead, and I think it has worked\n> reasonably well.\n\nI am not confident, but I guess we will see. :)\n\n-Peff\n"},{"id":"193454","messageId":"CABPQNSY=X8HG__vcEncdcgjT4fvqaC1gX_5_QH4n0+bX0tNT6g@mail.gmail.com","threadId":"30770","inReplyTo":"7v1ull7j9k.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2012-06-12T15:36:48Z","receivedAt":"2012-06-12T15:36:48Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Mon, Jun 11, 2012 at 9:15 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> vfr@lyx.org writes:\n>\n>> From: Vincent van Ravesteijn <vfr@lyx.org>\n>>\n>> GIT-BUILD-OPTIONS defines PERL_PATH to be used in the test suite. Only a\n>> few tests already actually use this variable when perl is needed. The\n>> other test just call 'perl' and it might happen that the wrong perl\n>> interpreter is used.\n>>\n>> This becomes problematic on Windows, when the perl interpreter that is\n>> compiled and installed on the Windows system is used, because this perl\n>> interpreter might introduce some unexpected LF->CRLF conversions.\n>>\n>> This patch makes sure that $PERL_PATH is used everywhere in the test suite\n>> and that the correct perl interpreter is used.\n>>\n>> Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>\n>> ---\n>\n> There was already this discussion:\n>\n>    http://thread.gmane.org/gmane.comp.version-control.git/132560/focus=132561\n>\n> which basically dismissed effort along this line with \"If the perl\n> in your PATH is so broken that it can't be used for simple helpers,\n> then you should fix your PATH.\"\n>\n\nThis way of looking at it has the flaw that it might not be the Perl\nthat is \"broken\", it could be that Git is the guilty one for creating\nproblems.\n\nThe reason in this case is that pipes are text-mode by default, which\nmeans newlines get translated between LF and CRLF on Windows. However,\nGit is largely written for Unixy systems where there's no\nCRLF-translation going on.\n\nBecause a lot of the internal Git protocols assume they can send\nbinary data over stdin/stdout by default, we set these to binary mode\non startup in Git for Windows to avoid. This cause problems with\nexternal tools like Perl, but we currently ship an MSYS version of\nperl where text-mode means LF-newlines, and thus no translation.\n\nHaving an MSYS version of Perl in PATH is \"broken\" in the Windows\nworld, so it's THIS Perl that people might want to keep out of their\nPATH.\n\nThat being said, it should be possible (and probably desirable) to\nhave a different PATH for the MSYS environment. But I'm not sure how\nwell this works for people who run Git for Windows from cmd, as\nopposed to from MSYS.\n\nIn the long run, it would probably be better to default to text-mode,\nand explicitly switch between text and binary-mode when needed. But\nfor now, the binary-pipe-hack \"almost works\" ;)\n"},{"id":"193457","messageId":"7vsje0jyxh.fsf@alter.siamese.dyndns.org","threadId":"30770","inReplyTo":"CABPQNSY=X8HG__vcEncdcgjT4fvqaC1gX_5_QH4n0+bX0tNT6g@mail.gmail.com","subject":"Re: [PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-12T16:08:10Z","receivedAt":"2012-06-12T16:08:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Erik Faye-Lund <kusmabite@gmail.com> writes:\n\n> Having an MSYS version of Perl in PATH is \"broken\" in the Windows\n> world, so it's THIS Perl that people might want to keep out of their\n> PATH.\n\nFair enough.  After all, that is why we have $PERL_PATH that can be\nused (and is used) in our Porcelain scripts.\n"},{"id":"193460","messageId":"7vhaugjx9h.fsf@alter.siamese.dyndns.org","threadId":"30770","inReplyTo":"7vsje0jyxh.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-12T16:44:10Z","receivedAt":"2012-06-12T16:44:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Erik Faye-Lund <kusmabite@gmail.com> writes:\n>\n>> Having an MSYS version of Perl in PATH is \"broken\" in the Windows\n>> world, so it's THIS Perl that people might want to keep out of their\n>> PATH.\n>\n> Fair enough.  After all, that is why we have $PERL_PATH that can be\n> used (and is used) in our Porcelain scripts.\n\nLet's also apply something like this to t/README.\n\nAs to vfr's patch, I'll replace $PERL_PATH with \"$PERL_PATH\" and queue.\n\n\n t/README | 25 ++++++++++++++++++++++---\n 1 file changed, 22 insertions(+), 3 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex 3534f43..4c3ea25 100644\n--- a/t/README\n+++ b/t/README\n@@ -307,6 +307,25 @@ Don't:\n    Use test_done instead if you need to stop the tests early (see\n    \"Skipping tests\" below).\n \n+ - use '! git cmd' when you want to make sure the git command exits\n+   with failure in a controlled way by calling \"die()\".  Instead,\n+   use 'test_must_fail git cmd'.  This will signal a failure if git\n+   dies in an unexpected way (e.g. segfault).\n+\n+ - use perl without spelling it as \"$PERL_PATH\". This is to help our\n+   friends on Windows where the platform Perl often adds CR before\n+   the end of line, and they bundle Git with a version of Perl that\n+   does not do so, whose path is specified with $PERL_PATH.\n+\n+ - use sh without spelling it as \"$SHELL_PATH\", when your script can\n+   be misinterpreted by broken platform shell (e.g. Solaris).\n+\n+ - chdir around in tests.  It is not sufficient to chdir to\n+   somewhere and then chdir back to the original location later in\n+   the test, as any intermediate step can fail and abort the test,\n+   causing the next test to start in an unexpected directory.  Do chdir\n+   inside a subshell if necessary.\n+\n  - Break the TAP output\n \n    The raw output from your test may be interpreted by a TAP harness. TAP\n@@ -342,9 +361,9 @@ If you need to skip tests you should do so by using the three-arg form\n of the test_* functions (see the \"Test harness library\" section\n below), e.g.:\n \n-    test_expect_success PERL 'I need Perl' \"\n-        '$PERL_PATH' -e 'hlagh() if unf_unf()'\n-    \"\n+    test_expect_success PERL 'I need Perl' '\n+        \"$PERL_PATH\" -e \"hlagh() if unf_unf()\"\n+    '\n \n The advantage of skipping tests like this is that platforms that don't\n have the PERL and other optional dependencies get an indication of how\n"},{"id":"193463","messageId":"20120612170536.GA12706@sigill.intra.peff.net","threadId":"30770","inReplyTo":"7vhaugjx9h.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-06-12T17:05:36Z","receivedAt":"2012-06-12T17:05:36Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jun 12, 2012 at 09:44:10AM -0700, Junio C Hamano wrote:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Erik Faye-Lund <kusmabite@gmail.com> writes:\n> >\n> >> Having an MSYS version of Perl in PATH is \"broken\" in the Windows\n> >> world, so it's THIS Perl that people might want to keep out of their\n> >> PATH.\n> >\n> > Fair enough.  After all, that is why we have $PERL_PATH that can be\n> > used (and is used) in our Porcelain scripts.\n> \n> Let's also apply something like this to t/README.\n> [...]\n>  t/README | 25 ++++++++++++++++++++++---\n>  1 file changed, 22 insertions(+), 3 deletions(-)\n\nLooks good to me.\n\n-Peff\n"},{"id":"193489","messageId":"4FD79898.2050104@lyx.org","threadId":"30770","inReplyTo":"7vhaugjx9h.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"Vincent van Ravesteijn","fromEmail":"vfr@lyx.org","sentAt":"2012-06-12T19:29:28Z","receivedAt":"2012-06-12T19:29:28Z","isPatch":true,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"Op 12-6-2012 18:44, Junio C Hamano schreef:\n> Fair enough.  After all, that is why we have $PERL_PATH that can be\n> used (and is used) in our Porcelain scripts.\n>\n>\n> As to vfr's patch, I'll replace $PERL_PATH with \"$PERL_PATH\" and queue.\n\nThanks. At least I'm now certain that all scripts use the same perl \ninterpreter.\n\nThe next question is whether the tests should also work with \"the \nbroken\" perl interpreter, i.e. the one that replaces LF with CRLF. I \nalso sent a patch on this issue for a single case, but there might be \nmore issues, or not. I'll report back when I know more.\n\nVincent\n"},{"id":"193757","messageId":"4FDD7AE6.6000000@web.de","threadId":"30770","inReplyTo":"1339441313-5296-1-git-send-email-vfr@lyx.org","subject":"Re: [PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-06-17T06:36:22Z","receivedAt":"2012-06-17T06:36:22Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\nHej,\nDoes this work for you?\n\nNone of the 2 patches found on pu do work here:\n> a3428205e6d74542d6441baaa29d1cb1d1064d95\n>Author: Vincent van Ravesteijn <vfr@lyx.org>\n>Date:   Mon Jun 11 19:01:53 2012 +0000\n>    t: Replace 'perl' by $PERL_PATH\n\n[165c0e8f0b04b8573e91ead2890870d9e36bb39c] tests: enclose $PERL_PATH in duoble quotes\n\nt4030 seems to be broken.\nWhen I try to debug it, the $PERL_PATH seems to be empty:\n\n------------------\n./t4030-diff-textconv.sh  --verbose | less\n\nThe ok 2 - file is considered binary by porcelain\n\nexpecting success: \n        git diff-tree -p HEAD^ HEAD >diff &&\n:/Users/tb/projects/git/git.git/t/trash directory.t4030-diff-textconv/hexdump: line 2: -e: command not found\n------------------\nAnd the hexdump line 2 uses $PERL_PATH, which is empty: \n--------------------\nt/trash directory.t4030-diff-textconv> cat  hexdump \n#!/bin/sh\n$PERL_PATH -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < \"$1\"\ntb@birne:~/projects/git/git.git/t/trash directory.t4030-diff-textconv> \n-------------------\nCan anybody help to find out what is going on?\n"},{"id":"193758","messageId":"7vipeq76ke.fsf@alter.siamese.dyndns.org","threadId":"30770","inReplyTo":"4FDD7AE6.6000000@web.de","subject":"Re: [PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-17T07:15:13Z","receivedAt":"2012-06-17T07:15:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> When I try to debug it, the $PERL_PATH seems to be empty:\n\nAhh, given that it does this:\n\n    cat >hexdump <<'EOF'\n    #!/bin/sh\n    perl -e '$/ = undef; $_ = <>; s/./ord($&)/ge; print $_' < \"$1\"\n    EOF\n    chmod +x hexdump\n\nPERL_PATH should be exported from test-lib.sh; we dot-source\nGIT-BUILD-OPTIONS to get its value, but it is not propagated to the\nsubprocess like this hexdump script.\n"},{"id":"193760","messageId":"4FDD9A4F.2060605@web.de","threadId":"30770","inReplyTo":"7vipeq76ke.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-06-17T08:50:23Z","receivedAt":"2012-06-17T08:50:23Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\n> PERL_PATH should be exported from test-lib.sh; we dot-source\n> GIT-BUILD-OPTIONS to get its value, but it is not propagated to the\n\nThanks, that works for me.\nDo you squeeze some like that onto pu?\n\n@@ -493,6 +493,7 @@ GIT_ATTR_NOSYSTEM=1\n export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_ATTR_NOSYSTEM\n \n . \"$GIT_BUILD_DIR\"/GIT-BUILD-OPTIONS\n+export PERL_PATH\n"},{"id":"193773","messageId":"7vk3z560i8.fsf@alter.siamese.dyndns.org","threadId":"30770","inReplyTo":"4FDD9A4F.2060605@web.de","subject":"Re: [PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-17T22:23:43Z","receivedAt":"2012-06-17T22:23:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n>> PERL_PATH should be exported from test-lib.sh; we dot-source\n>> GIT-BUILD-OPTIONS to get its value, but it is not propagated to the\n>\n> Thanks, that works for me.\n> Do you squeeze some like that onto pu?\n>\n> @@ -493,6 +493,7 @@ GIT_ATTR_NOSYSTEM=1\n>  export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_ATTR_NOSYSTEM\n>  \n>  . \"$GIT_BUILD_DIR\"/GIT-BUILD-OPTIONS\n> +export PERL_PATH\n\nNot on 'pu'; any fix should go on top of vr/use-our-perl-in-tests\ntopic that ends at b493e6b (t/README: add a bit more Don'ts,\n2012-06-12).\n\nI see other uses of bare \"perl\" that the patch forgot to convert,\nand the worst part is that one of these uses of bare \"perl\" appears\nin test-lib.sh _before_ it dot-sources GIT-BUILD-OPTIONS to pick up\nthe correct version of Perl, so the above single liner cannot be the\nwhole fix.\n"},{"id":"193993","messageId":"4FE22F91.1000809@web.de","threadId":"30770","inReplyTo":"7vk3z560i8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t: Replace 'perl' by $PERL_PATH","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2012-06-20T20:16:17Z","receivedAt":"2012-06-20T20:16:17Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 06/18/2012 12:23 AM, Junio C Hamano wrote:\n> Torsten Bögershausen<tboegi@web.de>  writes:\n>\n>>> PERL_PATH should be exported from test-lib.sh; we dot-source\n>>> GIT-BUILD-OPTIONS to get its value, but it is not propagated to the\n>>\n>> Thanks, that works for me.\n>> Do you squeeze some like that onto pu?\n>>\n>> @@ -493,6 +493,7 @@ GIT_ATTR_NOSYSTEM=1\n>>   export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_ATTR_NOSYSTEM\n>>\n>>   . \"$GIT_BUILD_DIR\"/GIT-BUILD-OPTIONS\n>> +export PERL_PATH\n > I see other uses of bare \"perl\" that the patch forgot to convert,\n > and the worst part is that one of these uses of bare \"perl\" appears\n > in test-lib.sh _before_ it dot-sources GIT-BUILD-OPTIONS to pick up\n > the correct version of Perl, so the above single liner cannot be the\n > whole fix.\n\nHow do you like the following idea:\n- rename t/test-lib.sh into t/test-lib.sh.sh\n- Change perl into @@PERL_PATH@@ in this file\n- Add the missing EXPORT PERL_PATH in test-lib.sh.sh\n- Preprocess t/test-lib.sh from t/test-lib.sh.sh, as seen below\n\n> diff --git a/Makefile b/Makefile\nindex 0914133..765107a 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -442,6 +442,7 @@ SCRIPT_LIB += git-rebase--interactive\n  SCRIPT_LIB += git-rebase--merge\n  SCRIPT_LIB += git-sh-setup\n  SCRIPT_LIB += git-sh-i18n\n+SCRIPT_LIB += t/test-lib.sh\n\n  SCRIPT_PERL += git-add--interactive.perl\n  SCRIPT_PERL += git-difftool.perl\n@@ -2018,6 +2019,7 @@ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n      -e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \\\n      -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n      -e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \\\n+    -e 's|@@PERL_PATH@@|$(PERL_PATH)|g' \\\n      -e $(BROKEN_PATH_FIX) \\\n      $@.sh >$@+\n  endef\n"}]}