{"thread":{"id":"16101","subject":"[PATCH] t4030: Don't use echo -n","startedAt":"2008-10-30T22:12:56Z","lastAt":"2008-11-03T16:30:10Z","messageCount":15,"participants":["Brian Gernhardt","Ian Hilt","Junio C Hamano","Steve Folly","Shawn O. Pearce","Jeff King","Pierre Habouzit","Francis Galiegue","Johannes Schindelin","Mike Ralphson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"94342","messageId":"1225404776-51748-1-git-send-email-benji@silverinsanity.com","threadId":"16101","inReplyTo":null,"subject":"[PATCH] t4030: Don't use echo -n","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2008-10-30T22:12:56Z","receivedAt":"2008-10-30T22:12:56Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>\n---\n t/t4030-diff-textconv.sh |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t4030-diff-textconv.sh b/t/t4030-diff-textconv.sh\nindex 3945731..7ec244f 100755\n--- a/t/t4030-diff-textconv.sh\n+++ b/t/t4030-diff-textconv.sh\n@@ -96,16 +96,15 @@ cat >expect.typechange <<'EOF'\n -1\n diff --git a/file b/file\n new file mode 120000\n-index ad8b3d2..67be421\n+index ad8b3d2..8e4020b\n --- /dev/null\n +++ b/file\n @@ -0,0 +1 @@\n +frotz\n-\\ No newline at end of file\n EOF\n # make a symlink the hard way that works on symlink-challenged file systems\n test_expect_success 'textconv does not act on symlinks' '\n-\techo -n frotz > file &&\n+\techo frotz > file &&\n \tgit add file &&\n \tgit ls-files -s | sed -e s/100644/120000/ |\n \t\tgit update-index --index-info &&\n-- \n1.6.0.3.523.g304d0\n"},{"id":"94352","messageId":"20081030235215.GB18221@sys-0.hiltweb.site","threadId":"16101","inReplyTo":"1225404776-51748-1-git-send-email-benji@silverinsanity.com","subject":"Re: [PATCH] t4030: Don't use echo -n","fromName":"Ian Hilt","fromEmail":"ian.hilt@gmx.com","sentAt":"2008-10-30T23:52:15Z","receivedAt":"2008-10-30T23:52:15Z","isPatch":true,"sender":{"key":"ian.hilt@gmx.com","avatar":null},"body":"On Thu, Oct 30, 2008 at 06:12:56PM -0400, Brian Gernhardt wrote:\n> Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>\n\nNo commit message???\n\n> ---\n>  t/t4030-diff-textconv.sh |    5 ++---\n>  1 files changed, 2 insertions(+), 3 deletions(-)\n> \n> diff --git a/t/t4030-diff-textconv.sh b/t/t4030-diff-textconv.sh\n> index 3945731..7ec244f 100755\n> --- a/t/t4030-diff-textconv.sh\n> +++ b/t/t4030-diff-textconv.sh\n> @@ -96,16 +96,15 @@ cat >expect.typechange <<'EOF'\n>  -1\n>  diff --git a/file b/file\n>  new file mode 120000\n> -index ad8b3d2..67be421\n> +index ad8b3d2..8e4020b\n>  --- /dev/null\n>  +++ b/file\n>  @@ -0,0 +1 @@\n>  +frotz\n> -\\ No newline at end of file\n>  EOF\n>  # make a symlink the hard way that works on symlink-challenged file systems\n>  test_expect_success 'textconv does not act on symlinks' '\n> -\techo -n frotz > file &&\n> +\techo frotz > file &&\n>  \tgit add file &&\n>  \tgit ls-files -s | sed -e s/100644/120000/ |\n>  \t\tgit update-index --index-info &&\n> -- \n> 1.6.0.3.523.g304d0\n\nThis doesn't apply for me.  My tip is up-to-date, but it doesn't even have\nthis file it t/.\n\nA little bewildered,\n\n\tIan\n"},{"id":"94366","messageId":"8A4A84EC-51F7-4038-957C-CCA5C00E5977@silverinsanity.com","threadId":"16101","inReplyTo":"20081030235215.GB18221@sys-0.hiltweb.site","subject":"Re: [PATCH] t4030: Don't use echo -n","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2008-10-31T05:02:45Z","receivedAt":"2008-10-31T05:02:45Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn Oct 30, 2008, at 7:52 PM, Ian Hilt wrote:\n\n> On Thu, Oct 30, 2008 at 06:12:56PM -0400, Brian Gernhardt wrote:\n>> Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>\n>\n> No commit message???\n>>\n\n\"Don't use echo -n\" seemed simple enough to me, as it's the only thing  \nit does.  And the reason is that echo -n isn't portable, as has been  \ndetermined previously in git.  I'll update this and use the better  \nreplacement \"printf\" anyway.\n\n> This doesn't apply for me.  My tip is up-to-date, but it doesn't  \n> even have\n> this file it t/.\n\nThis is based on next and is for a file that isn't in master.\n\n~~ Brian\n"},{"id":"94367","messageId":"1225429753-70109-1-git-send-email-benji@silverinsanity.com","threadId":"16101","inReplyTo":"8A4A84EC-51F7-4038-957C-CCA5C00E5977@silverinsanity.com","subject":"[PATCH] Avoid using non-portable `echo -n` in tests.","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2008-10-31T05:09:13Z","receivedAt":"2008-10-31T05:09:13Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"Not all /bin/sh have a builtin echo that recognizes -n.  Using printf\nis far more portable.\n\nDiscovered on OS X 10.5.5 in t4030-diff-textconv.sh and changed in all\nthe test scripts.\n\nSigned-off-by: Brian Gernhardt <benji@silverinsanity.com>\n---\n t/t2005-checkout-index-symlinks.sh |    2 +-\n t/t2102-update-index-symlinks.sh   |    4 ++--\n t/t4030-diff-textconv.sh           |    2 +-\n t/t6025-merge-symlinks.sh          |    4 ++--\n t/t9400-git-cvsserver-server.sh    |    2 +-\n 5 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t2005-checkout-index-symlinks.sh b/t/t2005-checkout-index-symlinks.sh\nindex ed12c4d..9fa5610 100755\n--- a/t/t2005-checkout-index-symlinks.sh\n+++ b/t/t2005-checkout-index-symlinks.sh\n@@ -13,7 +13,7 @@ file if core.symlinks is false.'\n test_expect_success \\\n 'preparation' '\n git config core.symlinks false &&\n-l=$(echo -n file | git hash-object -t blob -w --stdin) &&\n+l=$(printf file | git hash-object -t blob -w --stdin) &&\n echo \"120000 $l\tsymlink\" | git update-index --index-info'\n \n test_expect_success \\\ndiff --git a/t/t2102-update-index-symlinks.sh b/t/t2102-update-index-symlinks.sh\nindex f195aef..1ed44ee 100755\n--- a/t/t2102-update-index-symlinks.sh\n+++ b/t/t2102-update-index-symlinks.sh\n@@ -13,12 +13,12 @@ even if a plain file is in the working tree if core.symlinks is false.'\n test_expect_success \\\n 'preparation' '\n git config core.symlinks false &&\n-l=$(echo -n file | git hash-object -t blob -w --stdin) &&\n+l=$(printf file | git hash-object -t blob -w --stdin) &&\n echo \"120000 $l\tsymlink\" | git update-index --index-info'\n \n test_expect_success \\\n 'modify the symbolic link' '\n-echo -n new-file > symlink &&\n+printf new-file > symlink &&\n git update-index symlink'\n \n test_expect_success \\\ndiff --git a/t/t4030-diff-textconv.sh b/t/t4030-diff-textconv.sh\nindex 3945731..a235955 100755\n--- a/t/t4030-diff-textconv.sh\n+++ b/t/t4030-diff-textconv.sh\n@@ -105,7 +105,7 @@ index ad8b3d2..67be421\n EOF\n # make a symlink the hard way that works on symlink-challenged file systems\n test_expect_success 'textconv does not act on symlinks' '\n-\techo -n frotz > file &&\n+\tprintf frotz > file &&\n \tgit add file &&\n \tgit ls-files -s | sed -e s/100644/120000/ |\n \t\tgit update-index --index-info &&\ndiff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\nindex 53892a5..433c4de 100755\n--- a/t/t6025-merge-symlinks.sh\n+++ b/t/t6025-merge-symlinks.sh\n@@ -18,11 +18,11 @@ git add file &&\n git commit -m initial &&\n git branch b-symlink &&\n git branch b-file &&\n-l=$(echo -n file | git hash-object -t blob -w --stdin) &&\n+l=$(printf file | git hash-object -t blob -w --stdin) &&\n echo \"120000 $l\tsymlink\" | git update-index --index-info &&\n git commit -m master &&\n git checkout b-symlink &&\n-l=$(echo -n file-different | git hash-object -t blob -w --stdin) &&\n+l=$(printf file-different | git hash-object -t blob -w --stdin) &&\n echo \"120000 $l\tsymlink\" | git update-index --index-info &&\n git commit -m b-symlink &&\n git checkout b-file &&\ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex c1850d2..f6a2dbd 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -424,7 +424,7 @@ cd \"$WORKDIR\"\n test_expect_success 'cvs update (-p)' '\n     touch really-empty &&\n     echo Line 1 > no-lf &&\n-    echo -n Line 2 >> no-lf &&\n+    printf Line 2 >> no-lf &&\n     git add really-empty no-lf &&\n     git commit -q -m \"Update -p test\" &&\n     git push gitcvs.git >/dev/null &&\n-- \n1.6.0.3.757.g1e5a4\n"},{"id":"94376","messageId":"7vy70589jc.fsf@gitster.siamese.dyndns.org","threadId":"16101","inReplyTo":"1225429753-70109-1-git-send-email-benji@silverinsanity.com","subject":"Re: [PATCH] Avoid using non-portable `echo -n` in tests.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-10-31T08:15:51Z","receivedAt":"2008-10-31T08:15:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brian Gernhardt <benji@silverinsanity.com> writes:\n\n> Not all /bin/sh have a builtin echo that recognizes -n.  Using printf\n> is far more portable.\n\nThis is much better (minor nit: we do not care if echo is built-in or\n/bin/echo); the point of t4030 is to produce an incomplete line ;-).\n\nWill queue, thanks.\n"},{"id":"94378","messageId":"7vtzat89br.fsf@gitster.siamese.dyndns.org","threadId":"16101","inReplyTo":"1225429753-70109-1-git-send-email-benji@silverinsanity.com","subject":"Re: [PATCH] Avoid using non-portable `echo -n` in tests.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-10-31T08:20:24Z","receivedAt":"2008-10-31T08:20:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brian Gernhardt <benji@silverinsanity.com> writes:\n\n> Not all /bin/sh have a builtin echo that recognizes -n.  Using printf\n> is far more portable.\n>\n> Discovered on OS X 10.5.5 in t4030-diff-textconv.sh and changed in all\n> the test scripts.\n\nI had an impression that OS X was BSDish.  Wasn't \"echo -n\" a BSDism?\n"},{"id":"94391","messageId":"loom.20081031T093317-846@post.gmane.org","threadId":"16101","inReplyTo":"7vtzat89br.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Avoid using non-portable `echo-n` in tests.","fromName":"Steve Folly","fromEmail":"steve@spfweb.co.uk","sentAt":"2008-10-31T09:36:03Z","receivedAt":"2008-10-31T09:36:03Z","isPatch":true,"sender":{"key":"steve@spfweb.co.uk","avatar":null},"body":"Junio C Hamano <gitster <at> pobox.com> writes:\n\n> \n> Brian Gernhardt <benji <at> silverinsanity.com> writes:\n> \n> > Not all /bin/sh have a builtin echo that recognizes -n.  Using printf\n> > is far more portable.\n> >\n> > Discovered on OS X 10.5.5 in t4030-diff-textconv.sh and changed in all\n> > the test scripts.\n> \n> I had an impression that OS X was BSDish.  Wasn't \"echo -n\" a BSDism?\n> \n\nFYI, \"man echo\" on OS X 10.5.5 has this to say...\n\n     The following option is available:\n\n     -n    Do not print the trailing newline character.  This may also be\n           achieved by appending `\\c' to the end of the string, as is done by\n           iBCS2 compatible systems.  Note that this option as well as the\n           effect of `\\c' are implementation-defined in IEEE Std 1003.1-2001\n           (``POSIX.1'') as amended by Cor. 1-2002.  Applications aiming for\n           maximum portability are strongly encouraged to use printf(1) to\n           suppress the newline character.\n\n     Some shells may provide a builtin echo command which is similar or iden-\n     tical to this utility.  Most notably, the builtin echo in sh(1) does not\n     accept the -n option.  Consult the builtin(1) manual page.\n\n\nRegards,\nSteve.\n"},{"id":"94406","messageId":"20081031143200.GR14786@spearce.org","threadId":"16101","inReplyTo":"1225429753-70109-1-git-send-email-benji@silverinsanity.com","subject":"Re: [PATCH] Avoid using non-portable `echo -n` in tests.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-10-31T14:32:00Z","receivedAt":"2008-10-31T14:32:00Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Brian Gernhardt <benji@silverinsanity.com> wrote:\n> Not all /bin/sh have a builtin echo that recognizes -n.  Using printf\n> is far more portable.\n \n> diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\n> index c1850d2..f6a2dbd 100755\n> --- a/t/t9400-git-cvsserver-server.sh\n> +++ b/t/t9400-git-cvsserver-server.sh\n> @@ -424,7 +424,7 @@ cd \"$WORKDIR\"\n>  test_expect_success 'cvs update (-p)' '\n>      touch really-empty &&\n>      echo Line 1 > no-lf &&\n> -    echo -n Line 2 >> no-lf &&\n> +    printf Line 2 >> no-lf &&\n\nThat needs to be:\n\n\tprintf 'Line 2'\n\nto have the same result.  Fortunately I don't think it matters\nin this test, but it does read odd.\n\n-- \nShawn.\n"},{"id":"94410","messageId":"B8E9E11A-48B9-44A8-8ED2-812FFFCFABA6@silverinsanity.com","threadId":"16101","inReplyTo":"7vy70589jc.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Avoid using non-portable `echo -n` in tests.","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2008-10-31T15:38:13Z","receivedAt":"2008-10-31T15:38:13Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn Oct 31, 2008, at 4:15 AM, Junio C Hamano wrote:\n\n> Brian Gernhardt <benji@silverinsanity.com> writes:\n>\n>> Not all /bin/sh have a builtin echo that recognizes -n.  Using printf\n>> is far more portable.\n>\n> This is much better (minor nit: we do not care if echo is built-in or\n> /bin/echo); the point of t4030 is to produce an incomplete line ;-).\n\nWell, yes.  The reason I phrased it that way was that my /bin/echo  \nrecognizes -n but /bin/sh does not.\n\n~~ Brian\n"},{"id":"94432","messageId":"20081031182456.GC3230@sigill.intra.peff.net","threadId":"16101","inReplyTo":"1225429753-70109-1-git-send-email-benji@silverinsanity.com","subject":"Re: [PATCH] Avoid using non-portable `echo -n` in tests.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-31T18:24:56Z","receivedAt":"2008-10-31T18:24:56Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Oct 31, 2008 at 01:09:13AM -0400, Brian Gernhardt wrote:\n\n> Not all /bin/sh have a builtin echo that recognizes -n.  Using printf\n> is far more portable.\n> \n> Discovered on OS X 10.5.5 in t4030-diff-textconv.sh and changed in all\n> the test scripts.\n\nHmph. I think this is a good patch, and there is precedent in the past\n(20fa04ea, 2aad957, 9754563). But I am surprised this was not caught by\nour recent autobuilding project.\n\nHowever, it seems to work on FreeBSD (which makes it doubly weird that\nit is broken on OS X). On Solaris, the /bin/sh is so horribly broken\nthat I have to use bash anyway. Commit 9754563 claims breakage on AIX,\nbut it looks like Mike is doing the AIX builds with bash.\n\nSo I guess we just need an OS X autobuild. ;)\n\n>  t/t4030-diff-textconv.sh           |    2 +-\n\nAnd of course this one was me, but I blame JSixt, whose test I just\nmindlessly copied. ;)\n\n-Peff\n"},{"id":"94433","messageId":"20081031183601.GB8464@artemis.corp","threadId":"16101","inReplyTo":"20081031182456.GC3230@sigill.intra.peff.net","subject":"Re: [PATCH] Avoid using non-portable `echo -n` in tests.","fromName":"Pierre Habouzit","fromEmail":"madcoder@debian.org","sentAt":"2008-10-31T18:36:01Z","receivedAt":"2008-10-31T18:36:01Z","isPatch":true,"sender":{"key":"madcoder@debian.org","avatar":"https://avatars.githubusercontent.com/u/44708?v=4"},"body":"On Fri, Oct 31, 2008 at 06:24:56PM +0000, Jeff King wrote:\n> On Fri, Oct 31, 2008 at 01:09:13AM -0400, Brian Gernhardt wrote:\n> \n> > Not all /bin/sh have a builtin echo that recognizes -n.  Using printf\n> > is far more portable.\n> > \n> > Discovered on OS X 10.5.5 in t4030-diff-textconv.sh and changed in all\n> > the test scripts.\n> \n> Hmph. I think this is a good patch, and there is precedent in the past\n> (20fa04ea, 2aad957, 9754563). But I am surprised this was not caught by\n> our recent autobuilding project.\n\nSet up a Debian autobuilder with dash as a /bin/sh (apt-get install\ndash, dpkg-reconfigure -plow dash and say 'yes'). You'll see those kind\nof problems arise immediately.\n\nDash is a POSIX compatible shell, with almost no extension added (in\nparticular its echo has no -n option) which helps to find those kind of\nissues.\n\nIt would help detecting git shell scripts that use bashism as well.\n\n-- \n·O·  Pierre Habouzit\n··O                                                madcoder@debian.org\nOOO                                                http://www.madism.org\n"},{"id":"94434","messageId":"20081031183933.GA3577@sigill.intra.peff.net","threadId":"16101","inReplyTo":"20081031183601.GB8464@artemis.corp","subject":"Re: [PATCH] Avoid using non-portable `echo -n` in tests.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-31T18:39:33Z","receivedAt":"2008-10-31T18:39:33Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Oct 31, 2008 at 07:36:01PM +0100, Pierre Habouzit wrote:\n\n> Set up a Debian autobuilder with dash as a /bin/sh (apt-get install\n> dash, dpkg-reconfigure -plow dash and say 'yes'). You'll see those kind\n> of problems arise immediately.\n\nI don't need to; my development box is Debian with dash as /bin/sh. :)\n\n> Dash is a POSIX compatible shell, with almost no extension added (in\n> particular its echo has no -n option) which helps to find those kind of\n> issues.\n> \n> It would help detecting git shell scripts that use bashism as well.\n\nAgreed, and actually I found such a bashism (test ==) last week (though\nof course it also broke on FreeBSD).\n\n-Peff\n"},{"id":"94447","messageId":"200810312035.20016.fg@one2team.com","threadId":"16101","inReplyTo":"20081031183933.GA3577@sigill.intra.peff.net","subject":"Re: [PATCH] Avoid using non-portable `echo -n` in tests.","fromName":"Francis Galiegue","fromEmail":"fg@one2team.com","sentAt":"2008-10-31T19:35:19Z","receivedAt":"2008-10-31T19:35:19Z","isPatch":true,"sender":{"key":"fg@one2team.com","avatar":null},"body":"Le Friday 31 October 2008 19:39:33 Jeff King, vous avez écrit :\n[...]\n>\n> Agreed, and actually I found such a bashism (test ==) last week (though\n> of course it also broke on FreeBSD).\n>\n\nAs for bash-isms, a hunt for $(...) also looks necessary...\n\n$ grep -rl '\\$([^)]\\+)' $(find -type f)|wc -l\n272\n\nUnless I'm mistaken (and I probably am), the $(...) construct is \nbash-specific, isn't it?\n\n-- \nFrancis Galiegue\nONE2TEAM\nIngénieur système\nMob : +33 (0) 6 83 87 78 75\nTel : +33 (0) 1 78 94 55 52\nfge@one2team.com\n40 avenue Raymond Poincaré\n75116 Paris\n"},{"id":"94483","messageId":"alpine.DEB.1.00.0810312352120.22125@pacific.mpi-cbg.de.mpi-cbg.de","threadId":"16101","inReplyTo":"200810312035.20016.fg@one2team.com","subject":"Re: [PATCH] Avoid using non-portable `echo -n` in tests.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-10-31T22:53:47Z","receivedAt":"2008-10-31T22:53:47Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 31 Oct 2008, Francis Galiegue wrote:\n\n> Unless I'm mistaken (and I probably am), the $(...) construct is \n> bash-specific, isn't it?\n\nYou're mistaken,\nDscho\n\nP.S.: \nhttp://www.opengroup.org/onlinepubs/000095399/utilities/xcu_chap02.html#tag_02_06_03\n"},{"id":"94777","messageId":"e2b179460811030830t429a469bs3200fade42fecc01@mail.gmail.com","threadId":"16101","inReplyTo":"20081031182456.GC3230@sigill.intra.peff.net","subject":"Re: [PATCH] Avoid using non-portable `echo -n` in tests.","fromName":"Mike Ralphson","fromEmail":"mike.ralphson@gmail.com","sentAt":"2008-11-03T16:30:10Z","receivedAt":"2008-11-03T16:30:10Z","isPatch":true,"sender":{"key":"mike.ralphson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/21603?v=4"},"body":"2008/10/31 Jeff King <peff@peff.net>:\n> On Fri, Oct 31, 2008 at 01:09:13AM -0400, Brian Gernhardt wrote:\n>\n>> Not all /bin/sh have a builtin echo that recognizes -n.  Using printf\n>> is far more portable.\n>>\n>> Discovered on OS X 10.5.5 in t4030-diff-textconv.sh and changed in all\n>> the test scripts.\n>\n> Hmph. I think this is a good patch, and there is precedent in the past\n> (20fa04ea, 2aad957, 9754563). But I am surprised this was not caught by\n> our recent autobuilding project.\n>\n> However, it seems to work on FreeBSD (which makes it doubly weird that\n> it is broken on OS X). On Solaris, the /bin/sh is so horribly broken\n> that I have to use bash anyway. Commit 9754563 claims breakage on AIX,\n> but it looks like Mike is doing the AIX builds with bash.\n\nI've just retested with AIX's standard sh (ksh) instead of bash and\nthere were only two issues.\n\nOddly enough, one was with the (original) printfs in\nt4030-diff-textconv.sh. AIX seems to ship with a perfectly good\nprintf, but if you install the GNU tools from the 'IBM toolbox for\nAIX' (and prepend them to your PATH) it replaces that printf with one\nwhich doesn't grok the \"\\\\1\\\\n\" syntax, but I think wants it to be\n\"\\\\01\\\\n\".\n\nThe other problem is the 'trap exit' one discussed here:\nhttp://thread.gmane.org/gmane.comp.version-control.git/92748/focus=92944\n\nMike\n"}]}