{"thread":{"id":"4297","subject":"[PATCH 3/4] t5500-fetch-pack: remove local (bashism) usage.","startedAt":"2006-05-26T02:06:16Z","lastAt":"2007-09-26T08:41:44Z","messageCount":13,"participants":["Eric Wong","Herbert Xu","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"20722","messageId":"11486091783808-git-send-email-normalperson@yhbt.net","threadId":"4297","inReplyTo":"11486091783542-git-send-email-normalperson@yhbt.net","subject":"[PATCH 2/4] tests: Remove heredoc usage inside quotes","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-05-26T02:06:16Z","receivedAt":"2006-05-26T02:06:16Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"The use of heredoc inside quoted strings doesn't seem to be\nsupported by dash.  pdksh seems to handle it fine, however.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n\n---\n\n t/t2101-update-index-reupdate.sh |   48 ++++++++++++++++++++------------------\n t/t4012-diff-binary.sh           |   17 +++++--------\n 2 files changed, 31 insertions(+), 34 deletions(-)\n\n250810154c837c6999a954fc6bc4318099b67c01\ndiff --git a/t/t2101-update-index-reupdate.sh b/t/t2101-update-index-reupdate.sh\nindex 77aed8d..a78ea7f 100755\n--- a/t/t2101-update-index-reupdate.sh\n+++ b/t/t2101-update-index-reupdate.sh\n@@ -8,15 +8,16 @@ test_description='git-update-index --aga\n \n . ./test-lib.sh\n \n+cat > expected <<\\EOF\n+100644 3b18e512dba79e4c8300dd08aeb37f8e728b8dad 0\tfile1\n+100644 9db8893856a8a02eaa73470054b7c1c5a7c82e47 0\tfile2\n+EOF\n test_expect_success 'update-index --add' \\\n \t'echo hello world >file1 &&\n \t echo goodbye people >file2 &&\n \t git-update-index --add file1 file2 &&\n \t git-ls-files -s >current &&\n-\t cmp current - <<\\EOF\n-100644 3b18e512dba79e4c8300dd08aeb37f8e728b8dad 0\tfile1\n-100644 9db8893856a8a02eaa73470054b7c1c5a7c82e47 0\tfile2\n-EOF'\n+\t cmp current expected'\n \n test_expect_success 'update-index --again' \\\n \t'rm -f file1 &&\n@@ -29,20 +30,22 @@ test_expect_success 'update-index --agai\n \t\techo happy - failed as expected\n \tfi &&\n \t git-ls-files -s >current &&\n-\t cmp current - <<\\EOF\n-100644 3b18e512dba79e4c8300dd08aeb37f8e728b8dad 0\tfile1\n-100644 9db8893856a8a02eaa73470054b7c1c5a7c82e47 0\tfile2\n-EOF'\n+\t cmp current expected'\n \n+cat > expected <<\\EOF\n+100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0\tfile2\n+EOF\n test_expect_success 'update-index --remove --again' \\\n \t'git-update-index --remove --again &&\n \t git-ls-files -s >current &&\n-\t cmp current - <<\\EOF\n-100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0\tfile2\n-EOF'\n+\t cmp current expected'\n \n test_expect_success 'first commit' 'git-commit -m initial'\n \n+cat > expected <<\\EOF\n+100644 53ab446c3f4e42ce9bb728a0ccb283a101be4979 0\tdir1/file3\n+100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0\tfile2\n+EOF\n test_expect_success 'update-index again' \\\n \t'mkdir -p dir1 &&\n \techo hello world >dir1/file3 &&\n@@ -52,11 +55,12 @@ test_expect_success 'update-index again'\n \techo happy >dir1/file3 &&\n \tgit-update-index --again &&\n \tgit-ls-files -s >current &&\n-\tcmp current - <<\\EOF\n-100644 53ab446c3f4e42ce9bb728a0ccb283a101be4979 0\tdir1/file3\n-100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0\tfile2\n-EOF'\n+\tcmp current expected'\n \n+cat > expected <<\\EOF\n+100644 d7fb3f695f06c759dbf3ab00046e7cc2da22d10f 0\tdir1/file3\n+100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0\tfile2\n+EOF\n test_expect_success 'update-index --update from subdir' \\\n \t'echo not so happy >file2 &&\n \tcd dir1 &&\n@@ -64,19 +68,17 @@ test_expect_success 'update-index --upda\n \tgit-update-index --again &&\n \tcd .. &&\n \tgit-ls-files -s >current &&\n-\tcmp current - <<\\EOF\n-100644 d7fb3f695f06c759dbf3ab00046e7cc2da22d10f 0\tdir1/file3\n-100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0\tfile2\n-EOF'\n+\tcmp current expected'\n \n+cat > expected <<\\EOF\n+100644 594fb5bb1759d90998e2bf2a38261ae8e243c760 0\tdir1/file3\n+100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0\tfile2\n+EOF\n test_expect_success 'update-index --update with pathspec' \\\n \t'echo very happy >file2 &&\n \tcat file2 >dir1/file3 &&\n \tgit-update-index --again dir1/ &&\n \tgit-ls-files -s >current &&\n-\tcmp current - <<\\EOF\n-100644 594fb5bb1759d90998e2bf2a38261ae8e243c760 0\tdir1/file3\n-100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0\tfile2\n-EOF'\n+\tcmp current expected'\n \n test_done\ndiff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh\nindex bdd95c0..323606c 100755\n--- a/t/t4012-diff-binary.sh\n+++ b/t/t4012-diff-binary.sh\n@@ -16,25 +16,20 @@ test_expect_success 'prepare repository'\n \t echo git >c &&\n \t cat b b >d'\n \n-test_expect_success 'diff without --binary' \\\n-\t'git-diff | git-apply --stat --summary >current &&\n-\t cmp current - <<\\EOF\n+cat > expected <<\\EOF\n  a |    2 +-\n  b |  Bin\n  c |    2 +-\n  d |  Bin\n  4 files changed, 2 insertions(+), 2 deletions(-)\n-EOF'\n+EOF\n+test_expect_success 'diff without --binary' \\\n+\t'git-diff | git-apply --stat --summary >current &&\n+\t cmp current expected'\n \n test_expect_success 'diff with --binary' \\\n \t'git-diff --binary | git-apply --stat --summary >current &&\n-\t cmp current - <<\\EOF\n- a |    2 +-\n- b |  Bin\n- c |    2 +-\n- d |  Bin\n- 4 files changed, 2 insertions(+), 2 deletions(-)\n-EOF'\n+\t cmp current expected'\n \n # apply needs to be able to skip the binary material correctly\n # in order to report the line number of a corrupt patch.\n-- \n1.3.2.g7d11\n"},{"id":"20720","messageId":"11486091793385-git-send-email-normalperson@yhbt.net","threadId":"4297","inReplyTo":"11486091783808-git-send-email-normalperson@yhbt.net","subject":"[PATCH 3/4] t5500-fetch-pack: remove local (bashism) usage.","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-05-26T02:06:17Z","receivedAt":"2006-05-26T02:06:17Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"None of the variables seem to conflict, so local was unnecessary.\n\nAlso replaced ${var:pos:len} with the sed equivalent.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n\n---\n\n t/t5500-fetch-pack.sh |   30 +++++++++++++++---------------\n 1 files changed, 15 insertions(+), 15 deletions(-)\n\n62f64e95d24f90e61af0fa42d88300e41f60c277\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 92f12d9..f7625a6 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -12,11 +12,11 @@ # Test fetch-pack/upload-pack pair.\n \n # Some convenience functions\n \n-function add () {\n-\tlocal name=$1\n-\tlocal text=\"$@\"\n-\tlocal branch=${name:0:1}\n-\tlocal parents=\"\"\n+add () {\n+\tname=$1\n+\ttext=\"$@\"\n+\tbranch=`echo $name | sed -e 's/^\\(.\\).*$/\\1/'`\n+\tparents=\"\"\n \n \tshift\n \twhile test $1; do\n@@ -36,13 +36,13 @@ function add () {\n \teval ${branch}TIP=$commit\n }\n \n-function count_objects () {\n+count_objects () {\n \tls .git/objects/??/* 2>>log2.txt | wc -l | tr -d \" \"\n }\n \n-function test_expect_object_count () {\n-\tlocal message=$1\n-\tlocal count=$2\n+test_expect_object_count () {\n+\tmessage=$1\n+\tcount=$2\n \n \toutput=\"$(count_objects)\"\n \ttest_expect_success \\\n@@ -50,18 +50,18 @@ function test_expect_object_count () {\n \t\t\"test $count = $output\"\n }\n \n-function pull_to_client () {\n-\tlocal number=$1\n-\tlocal heads=$2\n-\tlocal count=$3\n-\tlocal no_strict_count_check=$4\n+pull_to_client () {\n+\tnumber=$1\n+\theads=$2\n+\tcount=$3\n+\tno_strict_count_check=$4\n \n \tcd client\n \ttest_expect_success \"$number pull\" \\\n \t\t\"git-fetch-pack -k -v .. $heads\"\n \tcase \"$heads\" in *A*) echo $ATIP > .git/refs/heads/A;; esac\n \tcase \"$heads\" in *B*) echo $BTIP > .git/refs/heads/B;; esac\n-\tgit-symbolic-ref HEAD refs/heads/${heads:0:1}\n+\tgit-symbolic-ref HEAD refs/heads/`echo $heads | sed -e 's/^\\(.\\).*$/\\1/'`\n \n \ttest_expect_success \"fsck\" 'git-fsck-objects --full > fsck.txt 2>&1'\n \n-- \n1.3.2.g7d11\n"},{"id":"20721","messageId":"11486091792604-git-send-email-normalperson@yhbt.net","threadId":"4297","inReplyTo":"11486091793385-git-send-email-normalperson@yhbt.net","subject":"[PATCH 4/4] t6000lib: workaround a possible dash bug","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-05-26T02:06:18Z","receivedAt":"2006-05-26T02:06:18Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"pdksh doesn't need this patch, of course bash works fine since\nthat what most users use.\n\nNormally, 'var=val command' seems to work fine with dash, but\nperhaps there's something weird going on with \"$@\".  dash is\npretty widespread, so it'll be good to support this even though\nit does seem like a bug in dash.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n\n---\n\n t/t6000lib.sh |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ncba907ce0b1c0927fb15cbb5dd91a4129ff9a950\ndiff --git a/t/t6000lib.sh b/t/t6000lib.sh\nindex c6752af..d402621 100755\n--- a/t/t6000lib.sh\n+++ b/t/t6000lib.sh\n@@ -69,7 +69,9 @@ on_committer_date()\n {\n     _date=$1\n     shift 1\n-    GIT_COMMITTER_DATE=$_date \"$@\"\n+    export GIT_COMMITTER_DATE=\"$_date\"\n+    \"$@\"\n+    unset GIT_COMMITTER_DATE\n }\n \n # Execute a command and suppress any error output.\n-- \n1.3.2.g7d11\n"},{"id":"20750","messageId":"20060526122231.GB5372@gondor.apana.org.au","threadId":"4297","inReplyTo":"11486091783808-git-send-email-normalperson@yhbt.net","subject":"Re: [PATCH 2/4] tests: Remove heredoc usage inside quotes","fromName":"Herbert Xu","fromEmail":"herbert@gondor.apana.org.au","sentAt":"2006-05-26T12:22:31Z","receivedAt":"2006-05-26T12:22:31Z","isPatch":true,"sender":{"key":"herbert@gondor.apana.org.au","avatar":null},"body":"On Thu, May 25, 2006 at 07:06:16PM -0700, Eric Wong wrote:\n> The use of heredoc inside quoted strings doesn't seem to be\n> supported by dash.  pdksh seems to handle it fine, however.\n\nThis is a bug in dash and should be fixed there instead.\nThanks for drawing my attention to it.\n\nCheers,\n-- \nVisit Openswan at http://www.openswan.org/\nEmail: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>\nHome Page: http://gondor.apana.org.au/~herbert/\nPGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt\n"},{"id":"20752","messageId":"20060526122317.GC5372@gondor.apana.org.au","threadId":"4297","inReplyTo":"11486091793385-git-send-email-normalperson@yhbt.net","subject":"Re: [PATCH 3/4] t5500-fetch-pack: remove local (bashism) usage.","fromName":"Herbert Xu","fromEmail":"herbert@gondor.apana.org.au","sentAt":"2006-05-26T12:23:17Z","receivedAt":"2006-05-26T12:23:17Z","isPatch":true,"sender":{"key":"herbert@gondor.apana.org.au","avatar":null},"body":"On Thu, May 25, 2006 at 07:06:17PM -0700, Eric Wong wrote:\n> None of the variables seem to conflict, so local was unnecessary.\n\nBTW, dash supports (and has always supported) local which is a quite\nuseful feature.\n\nCheers,\n-- \nVisit Openswan at http://www.openswan.org/\nEmail: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>\nHome Page: http://gondor.apana.org.au/~herbert/\nPGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt\n"},{"id":"20753","messageId":"20060526123342.GD5372@gondor.apana.org.au","threadId":"4297","inReplyTo":"11486091792604-git-send-email-normalperson@yhbt.net","subject":"Re: [PATCH 4/4] t6000lib: workaround a possible dash bug","fromName":"Herbert Xu","fromEmail":"herbert@gondor.apana.org.au","sentAt":"2006-05-26T12:33:42Z","receivedAt":"2006-05-26T12:33:42Z","isPatch":true,"sender":{"key":"herbert@gondor.apana.org.au","avatar":null},"body":"On Thu, May 25, 2006 at 07:06:18PM -0700, Eric Wong wrote:\n>\n>  t/t6000lib.sh |    4 +++-\n>  1 files changed, 3 insertions(+), 1 deletions(-)\n> \n> cba907ce0b1c0927fb15cbb5dd91a4129ff9a950\n> diff --git a/t/t6000lib.sh b/t/t6000lib.sh\n> index c6752af..d402621 100755\n> --- a/t/t6000lib.sh\n> +++ b/t/t6000lib.sh\n> @@ -69,7 +69,9 @@ on_committer_date()\n>  {\n>      _date=$1\n>      shift 1\n> -    GIT_COMMITTER_DATE=$_date \"$@\"\n> +    export GIT_COMMITTER_DATE=\"$_date\"\n> +    \"$@\"\n> +    unset GIT_COMMITTER_DATE\n\nThe original code looks correct to me.  So I think this too should\nbe fixed in dash instead.\n\nThanks,\n-- \nVisit Openswan at http://www.openswan.org/\nEmail: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>\nHome Page: http://gondor.apana.org.au/~herbert/\nPGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt\n"},{"id":"20860","messageId":"20060529052828.GB24077@localdomain","threadId":"4297","inReplyTo":"20060526122317.GC5372@gondor.apana.org.au","subject":"Re: [PATCH 3/4] t5500-fetch-pack: remove local (bashism) usage.","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-05-29T05:28:28Z","receivedAt":"2006-05-29T05:28:28Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Herbert Xu <herbert@gondor.apana.org.au> wrote:\n> On Thu, May 25, 2006 at 07:06:17PM -0700, Eric Wong wrote:\n> > None of the variables seem to conflict, so local was unnecessary.\n> \n> BTW, dash supports (and has always supported) local which is a quite\n> useful feature.\n\nCool.  Hmm... pdksh seems to support it here (Debian sid).  I'm pretty\nsure local is not part of the POSIX spec, though; and I have seen\n/bin/sh that don't support it.\n\n-- \nEric Wong\n"},{"id":"20862","messageId":"20060529053017.GC24077@localdomain","threadId":"4297","inReplyTo":"20060526122231.GB5372@gondor.apana.org.au","subject":"Re: [PATCH 2/4] tests: Remove heredoc usage inside quotes","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2006-05-29T05:30:17Z","receivedAt":"2006-05-29T05:30:17Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Herbert Xu <herbert@gondor.apana.org.au> wrote:\n> On Thu, May 25, 2006 at 07:06:16PM -0700, Eric Wong wrote:\n> > The use of heredoc inside quoted strings doesn't seem to be\n> > supported by dash.  pdksh seems to handle it fine, however.\n> \n> This is a bug in dash and should be fixed there instead.\n> Thanks for drawing my attention to it.\n\nNo problem.  I think these dash bugs should be fixed in dash, but\ncontinue to be worked around in git as old versions of dash will\nprobably continue to exist for a long time.\n\n-- \nEric Wong\n"},{"id":"20863","messageId":"7vpshxbde9.fsf@assigned-by-dhcp.cox.net","threadId":"4297","inReplyTo":"20060529052828.GB24077@localdomain","subject":"Re: [PATCH 3/4] t5500-fetch-pack: remove local (bashism) usage.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-29T05:36:46Z","receivedAt":"2006-05-29T05:36:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> Herbert Xu <herbert@gondor.apana.org.au> wrote:\n>> On Thu, May 25, 2006 at 07:06:17PM -0700, Eric Wong wrote:\n>> > None of the variables seem to conflict, so local was unnecessary.\n>> \n>> BTW, dash supports (and has always supported) local which is a quite\n>> useful feature.\n>\n> Cool.  Hmm... pdksh seems to support it here (Debian sid).  I'm pretty\n> sure local is not part of the POSIX spec, though; and I have seen\n> /bin/sh that don't support it.\n\nConcurred.  There are things Herbert said are clearly dash bugs,\nbut this one is outside POSIX, so lets leave your changes to the\ntest for it.\n"},{"id":"20874","messageId":"20060529073137.GB22452@gondor.apana.org.au","threadId":"4297","inReplyTo":"20060529052828.GB24077@localdomain","subject":"Re: [PATCH 3/4] t5500-fetch-pack: remove local (bashism) usage.","fromName":"Herbert Xu","fromEmail":"herbert@gondor.apana.org.au","sentAt":"2006-05-29T07:31:37Z","receivedAt":"2006-05-29T07:31:37Z","isPatch":true,"sender":{"key":"herbert@gondor.apana.org.au","avatar":null},"body":"On Sun, May 28, 2006 at 10:28:28PM -0700, Eric Wong wrote:\n>\n> Cool.  Hmm... pdksh seems to support it here (Debian sid).  I'm pretty\n> sure local is not part of the POSIX spec, though; and I have seen\n> /bin/sh that don't support it.\n\nIt is true that the current POSIX spec does not specify it.  However,\nall useful POSIX-compliant shells on Linux (i.e., excluding those\nshells that exist only to test POSIX compliance) support it and it\nis used by a large corpus of existing Linux scripts.\n\nCheers,\n-- \nVisit Openswan at http://www.openswan.org/\nEmail: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>\nHome Page: http://gondor.apana.org.au/~herbert/\nPGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt\n"},{"id":"53720","messageId":"20070921132808.GB9778@gondor.apana.org.au","threadId":"4297","inReplyTo":"11486091792604-git-send-email-normalperson@yhbt.net","subject":"Re: [PATCH 4/4] t6000lib: workaround a possible dash bug","fromName":"Herbert Xu","fromEmail":"herbert@gondor.apana.org.au","sentAt":"2007-09-21T13:28:08Z","receivedAt":"2007-09-21T13:28:08Z","isPatch":true,"sender":{"key":"herbert@gondor.apana.org.au","avatar":null},"body":"Hi Eric:\n\nOn Thu, May 25, 2006 at 07:06:18PM -0700, Eric Wong wrote:\n> pdksh doesn't need this patch, of course bash works fine since\n> that what most users use.\n> \n> Normally, 'var=val command' seems to work fine with dash, but\n> perhaps there's something weird going on with \"$@\".  dash is\n> pretty widespread, so it'll be good to support this even though\n> it does seem like a bug in dash.\n\nJust going through dash issues right now.  Do you recall\nwhat the bug is in this case? Doing a quick test doesn't\nseem to show much:\n\ndash -c 'set -- env; a=b \"$@\"'\n\n> diff --git a/t/t6000lib.sh b/t/t6000lib.sh\n> index c6752af..d402621 100755\n> --- a/t/t6000lib.sh\n> +++ b/t/t6000lib.sh\n> @@ -69,7 +69,9 @@ on_committer_date()\n>  {\n>      _date=$1\n>      shift 1\n> -    GIT_COMMITTER_DATE=$_date \"$@\"\n> +    export GIT_COMMITTER_DATE=\"$_date\"\n> +    \"$@\"\n> +    unset GIT_COMMITTER_DATE\n>  }\n>  \n>  # Execute a command and suppress any error output.\n> -- \n> 1.3.2.g7d11\n\nThanks,\n-- \nVisit Openswan at http://www.openswan.org/\nEmail: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>\nHome Page: http://gondor.apana.org.au/~herbert/\nPGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt\n"},{"id":"53749","messageId":"20070921204511.GA10079@muzzle","threadId":"4297","inReplyTo":"20070921132808.GB9778@gondor.apana.org.au","subject":"Re: [PATCH 4/4] t6000lib: workaround a possible dash bug","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-09-21T20:45:11Z","receivedAt":"2007-09-21T20:45:11Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Herbert Xu <herbert@gondor.apana.org.au> wrote:\n> Hi Eric:\n\nHi Herbert,\n\n> On Thu, May 25, 2006 at 07:06:18PM -0700, Eric Wong wrote:\n> > pdksh doesn't need this patch, of course bash works fine since\n> > that what most users use.\n> > \n> > Normally, 'var=val command' seems to work fine with dash, but\n> > perhaps there's something weird going on with \"$@\".  dash is\n> > pretty widespread, so it'll be good to support this even though\n> > it does seem like a bug in dash.\n> \n> Just going through dash issues right now.  Do you recall\n> what the bug is in this case? Doing a quick test doesn't\n> seem to show much:\n> \n> dash -c 'set -- env; a=b \"$@\"'\n\nI tried to reproduce it on a quick script using shell functions,\nmultiple arguments, spaces in the $a variable.., but haven't\nbeen successful.  However, reverting the below patch still\ncauses errors in the latest git test suite.\n\n> > diff --git a/t/t6000lib.sh b/t/t6000lib.sh\n> > index c6752af..d402621 100755\n> > --- a/t/t6000lib.sh\n> > +++ b/t/t6000lib.sh\n> > @@ -69,7 +69,9 @@ on_committer_date()\n> >  {\n> >      _date=$1\n> >      shift 1\n> > -    GIT_COMMITTER_DATE=$_date \"$@\"\n> > +    export GIT_COMMITTER_DATE=\"$_date\"\n> > +    \"$@\"\n> > +    unset GIT_COMMITTER_DATE\n> >  }\n> >  \n> >  # Execute a command and suppress any error output.\n> > -- \n> > 1.3.2.g7d11\n> \n> Thanks,\n\nI'm using dash 0.5.3-7 from Debian Etch on x86-32.\n(git @ 17ed158021ead9cb056f692fc35ff3fcde96a747)\n\n*** t6003-rev-list-topo-order.sh ***\n*   ok 1: rev-list has correct number of entries\n*   ok 2: simple topo order\n*   ok 3: two diamonds topo order (g6)\n* FAIL 4: multiple heads\n\tcheck_output multiple-heads \"git rev-list --topo-order a3 b3 c3\"\n* FAIL 5: multiple heads, prune at a1\n\tcheck_output multiple-heads-prune-at-a1 \"git rev-list --topo-order a3 b3 c3 ^a1\"\n* FAIL 6: multiple heads, prune at l1\n\tcheck_output multiple-heads-prune-at-l1 \"git rev-list --topo-order a3 b3 c3 ^l1\"\n*   ok 7: cross-epoch, head at l5, prune at l1\n*   ok 8: duplicated head arguments\n*   ok 9: prune near topo\n*   ok 10: head has no parent\n*   ok 11: two nodes - one head, one base\n*   ok 12: three nodes one head, one internal, one base\n*   ok 13: linear prune l2 ^root\n*   ok 14: linear prune l2 ^l0\n*   ok 15: linear prune l2 ^l1\n*   ok 16: linear prune l5 ^a4\n*   ok 17: linear prune l5 ^l3\n*   ok 18: linear prune l5 ^l4\n*   ok 19: max-count 10 - topo order\n* FAIL 20: max-count 10 - non topo order\n\tcheck_output max-count-10-non-topo-order \"git rev-list --max-count=10 l5\"\n* FAIL 21: --max-age=c3, no --topo-order\n\tcheck_output max-age-c3-no-topo-order \"git rev-list --max-age=1190407285 l5\"\n*   ok 22: one specified head reachable from another a4, c3, --topo-order\n*   ok 23: one specified head reachable from another c3, a4, --topo-order\n*   ok 24: one specified head reachable from another a4, c3, no --topo-order\n*   ok 25: one specified head reachable from another c3, a4, no --topo-order\n*   ok 26: graph with c3 and a4 parents of head\n*   ok 27: graph with a4 and c3 parents of head\n*   ok 28: head ^head --topo-order\n*   ok 29: head ^head no --topo-order\n*   ok 30: simple topo order (l5r1)\n*   ok 31: simple topo order (r1l5)\n*   ok 32: don't print things unreachable from one branch\n*   ok 33: --topo-order a4 l3\n* failed 5 among 33 test(s)\nmake: *** [t6003-rev-list-topo-order.sh] Error 1\n\n-- \nEric Wong\n"},{"id":"54089","messageId":"20070926084144.GA11582@gondor.apana.org.au","threadId":"4297","inReplyTo":"20070921204511.GA10079@muzzle","subject":"Re: [PATCH 4/4] t6000lib: workaround a possible dash bug","fromName":"Herbert Xu","fromEmail":"herbert@gondor.apana.org.au","sentAt":"2007-09-26T08:41:44Z","receivedAt":"2007-09-26T08:41:44Z","isPatch":true,"sender":{"key":"herbert@gondor.apana.org.au","avatar":null},"body":"On Fri, Sep 21, 2007 at 01:45:11PM -0700, Eric Wong wrote:\n>\n> I tried to reproduce it on a quick script using shell functions,\n> multiple arguments, spaces in the $a variable.., but haven't\n> been successful.  However, reverting the below patch still\n> causes errors in the latest git test suite.\n\nAh I see, it's a function.  Unfortunately POSIX requires\nshell functions to have the variable assignment properties\nof special built-ins.  So\n\n\tX=value func\n\nhas the same properties as\n\n\tX=value :\n\nIn other words, the value assigned to X (and any subsequent\nvalues assigned within the function) persists after the call.\nAlso, the variable X is not exported unless it's already been\nexported.\n\nThis is pretty lame but it's how the original Korn shell did\nthings and POSIX has adopted that.  Bash's POSIX mode tries\nto balance things by both making the value persist and exporting\nX.  Unfortunately this is buggy too as it causes X to continue\nto be exported after the function returns.\n\nSo the bottom-line is that your patch is the correct solution\nafter all :)\n\nCheers,\n-- \nVisit Openswan at http://www.openswan.org/\nEmail: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>\nHome Page: http://gondor.apana.org.au/~herbert/\nPGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt\n"}]}