{"thread":{"id":"11325","subject":"[PATCH] the use of 'tr' in the test suite isn't really portable","startedAt":"2007-12-17T18:15:08Z","lastAt":"2007-12-18T00:20:44Z","messageCount":4,"participants":["H.Merijn Brand","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"63448","messageId":"20071217191508.79cc05e2@pc09.procura.nl","threadId":"11325","inReplyTo":null,"subject":"[PATCH] the use of 'tr' in the test suite isn't really portable","fromName":"H.Merijn Brand","fromEmail":"h.m.brand@xs4all.nl","sentAt":"2007-12-17T18:15:08Z","receivedAt":"2007-12-17T18:15:08Z","isPatch":true,"sender":{"key":"h.m.brand@xs4all.nl","avatar":"https://gravatar.com/avatar/5b8f83ee35c427a646cbea3b104346e00ab3663b99bbf435cddeb75cd4b3857b?d=mp&s=160"},"body":"Some versions of 'tr' only accept octal codes if entered with three digits,\nand therefor misinterpret the '\\0' in the test suite.\n\nSome versions of 'tr' reject the (needless) use of character classes.\n\nSigned-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>\n---\n\ndiff -pur git-2007-12-10_01/git-filter-branch.sh git-2007-12-10/git-filter-branch.sh\n--- git-2007-12-10_01/git-filter-branch.sh      2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/git-filter-branch.sh 2007-12-11 13:39:02 +0100\n@@ -290,7 +290,7 @@ while read commit parents; do\n                eval \"$filter_tree\" < /dev/null ||\n                        die \"tree filter failed: $filter_tree\"\n\n-               git diff-index -r $commit | cut -f 2- | tr '\\n' '\\0' | \\\n+               git diff-index -r $commit | cut -f 2- | tr '\\n' '\\000' | \\\n                        xargs -0 git update-index --add --replace --remove\n                git ls-files -z --others | \\\n                        xargs -0 git update-index --add --replace --remove\ndiff -pur git-2007-12-10_01/t/diff-lib.sh git-2007-12-10/t/diff-lib.sh\n--- git-2007-12-10_01/t/diff-lib.sh     2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/diff-lib.sh        2007-12-11 13:39:56 +0100\n@@ -21,8 +21,8 @@ compare_diff_raw_z () {\n     # Also we do not check SHA1 hash generation in this test, which\n     # is a job for t0000-basic.sh\n\n-    tr '\\0' '\\012' <\"$1\" | sed -e \"$sanitize_diff_raw_z\" >.tmp-1\n-    tr '\\0' '\\012' <\"$2\" | sed -e \"$sanitize_diff_raw_z\" >.tmp-2\n+    tr '\\000' '\\012' <\"$1\" | sed -e \"$sanitize_diff_raw_z\" >.tmp-1\n+    tr '\\000' '\\012' <\"$2\" | sed -e \"$sanitize_diff_raw_z\" >.tmp-2\n     git diff .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2\n }\n\ndiff -pur git-2007-12-10_01/t/t0020-crlf.sh git-2007-12-10/t/t0020-crlf.sh\n--- git-2007-12-10_01/t/t0020-crlf.sh   2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t0020-crlf.sh      2007-12-10 14:25:58 +0100\n@@ -5,7 +5,7 @@ test_description='CRLF conversion'\n . ./test-lib.sh\n\n q_to_nul () {\n-       tr Q '\\0'\n+       tr Q '\\000'\n }\n\n append_cr () {\ndiff -pur git-2007-12-10_01/t/t1300-repo-config.sh git-2007-12-10/t/t1300-repo-config.sh\n--- git-2007-12-10_01/t/t1300-repo-config.sh    2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t1300-repo-config.sh       2007-12-10 09:49:48 +0100\n@@ -591,12 +591,12 @@ Qsection.sub=section.val4\n Qsection.sub=section.val5Q\n EOF\n\n-git config --null --list | tr '[\\000]' 'Q' > result\n+git config --null --list | tr '\\000' 'Q' > result\n echo >>result\n\n test_expect_success '--null --list' 'cmp result expect'\n\n-git config --null --get-regexp 'val[0-9]' | tr '[\\000]' 'Q' > result\n+git config --null --get-regexp 'val[0-9]' | tr '\\000' 'Q' > result\n echo >>result\n\n test_expect_success '--null --get-regexp' 'cmp result expect'\ndiff -pur git-2007-12-10_01/t/t3300-funny-names.sh git-2007-12-10/t/t3300-funny-names.sh\n--- git-2007-12-10_01/t/t3300-funny-names.sh    2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t3300-funny-names.sh       2007-12-11 13:40:32 +0100\n@@ -54,7 +54,7 @@ echo 'just space\n no-funny\n tabs   ,\" (dq) and spaces' >expected\n test_expect_success 'git ls-files -z with-funny' \\\n-       'git ls-files -z | tr \\\\0 \\\\012 >current &&\n+       'git ls-files -z | tr \\\\000 \\\\012 >current &&\n        git diff expected current'\n\n t1=`git write-tree`\n@@ -83,11 +83,11 @@ test_expect_success 'git diff-tree with-\n echo 'A\n tabs   ,\" (dq) and spaces' >expected\n test_expect_success 'git diff-index -z with-funny' \\\n-       'git diff-index -z --name-status $t0 | tr \\\\0 \\\\012 >current &&\n+       'git diff-index -z --name-status $t0 | tr \\\\000 \\\\012 >current &&\n        git diff expected current'\n\n test_expect_success 'git diff-tree -z with-funny' \\\n-       'git diff-tree -z --name-status $t0 $t1 | tr \\\\0 \\\\012 >current &&\n+       'git diff-tree -z --name-status $t0 $t1 | tr \\\\000 \\\\012 >current &&\n        git diff expected current'\n\n cat > expected <<\\EOF\ndiff -pur git-2007-12-10_01/t/t4020-diff-external.sh git-2007-12-10/t/t4020-diff-external.sh\n--- git-2007-12-10_01/t/t4020-diff-external.sh  2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t4020-diff-external.sh     2007-12-11 13:40:44 +0100\n@@ -99,7 +99,7 @@ test_expect_success 'no diff with -diff'\n        git diff | grep Binary\n '\n\n-echo NULZbetweenZwords | tr Z '\\0' > file\n+echo NULZbetweenZwords | tr Z '\\000' > file\n\n test_expect_success 'force diff with \"diff\"' '\n        echo >.gitattributes \"file diff\" &&\ndiff -pur git-2007-12-10_01/t/t4103-apply-binary.sh git-2007-12-10/t/t4103-apply-binary.sh\n--- git-2007-12-10_01/t/t4103-apply-binary.sh   2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t4103-apply-binary.sh      2007-12-11 13:40:57 +0100\n@@ -24,10 +24,10 @@ git update-index --add --remove file1 fi\n git-commit -m 'Initial Version' 2>/dev/null\n\n git-checkout -b binary\n-tr 'x' '\\0' <file1 >file3\n+tr 'x' '\\000' <file1 >file3\n cat file3 >file4\n git add file2\n-tr '\\0' 'v' <file3 >file1\n+tr '\\000' 'v' <file3 >file1\n rm -f file2\n git update-index --add --remove file1 file2 file3 file4\n git-commit -m 'Second Version'\ndiff -pur git-2007-12-10_01/t/t4116-apply-reverse.sh git-2007-12-10/t/t4116-apply-reverse.sh\n--- git-2007-12-10_01/t/t4116-apply-reverse.sh  2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t4116-apply-reverse.sh     2007-12-11 13:42:13 +0100\n@@ -12,14 +12,14 @@ test_description='git apply in reverse\n test_expect_success setup '\n\n        for i in a b c d e f g h i j k l m n; do echo $i; done >file1 &&\n-       tr \"[ijk]\" '\\''[\\0\\1\\2]'\\'' <file1 >file2 &&\n+       tr \"ijk\" '\\''\\000\\001\\002'\\'' <file1 >file2 &&\n\n        git add file1 file2 &&\n        git commit -m initial &&\n        git tag initial &&\n\n        for i in a b c g h i J K L m o n p q; do echo $i; done >file1 &&\n-       tr \"[mon]\" '\\''[\\0\\1\\2]'\\'' <file1 >file2 &&\n+       tr \"mon\" '\\''\\000\\001\\002'\\'' <file1 >file2 &&\n\n        git commit -a -m second &&\n        git tag second &&\ndiff -pur git-2007-12-10_01/t/t4200-rerere.sh git-2007-12-10/t/t4200-rerere.sh\n--- git-2007-12-10_01/t/t4200-rerere.sh 2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t4200-rerere.sh    2007-12-11 13:42:28 +0100\n@@ -129,7 +129,7 @@ test_expect_success 'rerere kicked in' \"\n test_expect_success 'rerere prefers first change' 'git diff a1 expect'\n\n rm $rr/postimage\n-echo \"$sha1    a1\" | tr '\\012' '\\0' > .git/rr-cache/MERGE_RR\n+echo \"$sha1    a1\" | tr '\\012' '\\000' > .git/rr-cache/MERGE_RR\n\n test_expect_success 'rerere clear' 'git rerere clear'\n\ndiff -pur git-2007-12-10_01/t/t5300-pack-object.sh git-2007-12-10/t/t5300-pack-object.sh\n--- git-2007-12-10_01/t/t5300-pack-object.sh    2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t5300-pack-object.sh       2007-12-11 13:42:46 +0100\n@@ -15,7 +15,7 @@ test_expect_success \\\n     'rm -f .git/index*\n      for i in a b c\n      do\n-            dd if=/dev/zero bs=4k count=1 | tr \"\\\\0\" $i >$i &&\n+            dd if=/dev/zero bs=4k count=1 | tr \"\\\\000\" $i >$i &&\n             git update-index --add $i || return 1\n      done &&\n      cat c >d && echo foo >>d && git update-index --add d &&\ndiff -pur git-2007-12-10_01/test-sha1.sh git-2007-12-10/test-sha1.sh\n--- git-2007-12-10_01/test-sha1.sh      2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/test-sha1.sh 2007-12-11 13:39:29 +0100\n@@ -10,7 +10,7 @@ do\n                {\n                        test -z \"$pfx\" || echo \"$pfx\"\n                        dd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |\n-                       tr '[\\0]' '[g]'\n+                       tr '\\000' 'g'\n                } | ./test-sha1 $cnt\n        `\n        if test \"$expect\" = \"$actual\"\n@@ -55,7 +55,7 @@ do\n                {\n                        test -z \"$pfx\" || echo \"$pfx\"\n                        dd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |\n-                       tr '[\\0]' '[g]'\n+                       tr '\\000' 'g'\n                } | sha1sum |\n                sed -e 's/ .*//'\n        `\n-- \ngit-2007-12-17\n\n-- \nH.Merijn Brand         Amsterdam Perl Mongers (http://amsterdam.pm.org/)\nusing & porting perl 5.6.2, 5.8.x, 5.10.x  on HP-UX 10.20, 11.00, 11.11,\n& 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin.       http://qa.perl.org\nhttp://mirrors.develooper.com/hpux/            http://www.test-smoke.org\n                        http://www.goldmark.org/jeff/stupid-disclaimers/\n"},{"id":"63472","messageId":"7vlk7t6pc6.fsf@gitster.siamese.dyndns.org","threadId":"11325","inReplyTo":"20071217191508.79cc05e2@pc09.procura.nl","subject":"Re: [PATCH] the use of 'tr' in the test suite isn't really portable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-17T20:25:29Z","receivedAt":"2007-12-17T20:25:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The contents looked correct but the patch was garbled.\n\n--\n\nApplying the use of 'tr' in the test suite isn't really portable\n.dotest/patch:11: indent with spaces.\n               git diff-index -r $commit | cut -f 2- | tr '\\n' '\\000' | \\\n.dotest/patch:153: indent with spaces.\n            dd if=/dev/zero bs=4k count=1 | tr \"\\\\000\" $i >$i &&\n.dotest/patch:165: indent with spaces.\n                       tr '\\000' 'g'\n.dotest/patch:174: indent with spaces.\n                       tr '\\000' 'g'\nerror: patch failed: git-filter-branch.sh:290\nerror: git-filter-branch.sh: patch does not apply\nerror: patch failed: t/t0020-crlf.sh:5\nerror: t/t0020-crlf.sh: patch does not apply\nerror: patch failed: t/t3300-funny-names.sh:54\nerror: t/t3300-funny-names.sh: patch does not apply\nerror: patch failed: t/t4020-diff-external.sh:99\nerror: t/t4020-diff-external.sh: patch does not apply\nerror: patch failed: t/t4116-apply-reverse.sh:12\nerror: t/t4116-apply-reverse.sh: patch does not apply\nerror: patch failed: t/t4200-rerere.sh:129\nerror: t/t4200-rerere.sh: patch does not apply\nerror: patch failed: t/t5300-pack-object.sh:15\nerror: t/t5300-pack-object.sh: patch does not apply\nerror: patch failed: test-sha1.sh:10\nerror: test-sha1.sh: patch does not apply\n.dotest/patch:11: indent with spaces.\n               git diff-index -r $commit | cut -f 2- | tr '\\n' '\\000' | \\\n.dotest/patch:153: indent with spaces.\n            dd if=/dev/zero bs=4k count=1 | tr \"\\\\000\" $i >$i &&\n.dotest/patch:165: indent with spaces.\n                       tr '\\000' 'g'\n.dotest/patch:174: indent with spaces.\n                       tr '\\000' 'g'\n"},{"id":"63499","messageId":"20071217232846.476940ec@pc09.procura.nl","threadId":"11325","inReplyTo":"7vlk7t6pc6.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] the use of 'tr' in the test suite isn't really portable","fromName":"H.Merijn Brand","fromEmail":"h.m.brand@xs4all.nl","sentAt":"2007-12-17T22:28:46Z","receivedAt":"2007-12-17T22:28:46Z","isPatch":true,"sender":{"key":"h.m.brand@xs4all.nl","avatar":"https://gravatar.com/avatar/5b8f83ee35c427a646cbea3b104346e00ab3663b99bbf435cddeb75cd4b3857b?d=mp&s=160"},"body":"On Mon, 17 Dec 2007 12:25:29 -0800, Junio C Hamano <gitster@pobox.com> wrote:\n\n> The contents looked correct but the patch was garbled.\n\nhttp://www.xs4all.nl/~procura/git-tr.diff\nand attached\n\nThe docs tell me to use git-diff, but I don't have a git repos for git,\nbecause git on HP-UX doesn't work yet out of the box, so I use the\nsnapshots from http://www.codemonkey.org.uk/projects/git-snapshots/git/\n\nThis was based on 2007-12-17\n\n\n-- \nH.Merijn Brand         Amsterdam Perl Mongers (http://amsterdam.pm.org/)\nusing & porting perl 5.6.2, 5.8.x, 5.10.x  on HP-UX 10.20, 11.00, 11.11,\n& 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin.       http://qa.perl.org\nhttp://mirrors.develooper.com/hpux/            http://www.test-smoke.org\n                        http://www.goldmark.org/jeff/stupid-disclaimers/\n\n\ndiff -pur git-2007-12-10_01/git-filter-branch.sh git-2007-12-10/git-filter-branch.sh\n--- git-2007-12-10_01/git-filter-branch.sh\t2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/git-filter-branch.sh\t2007-12-11 13:39:02 +0100\n@@ -290,7 +290,7 @@ while read commit parents; do\n \t\teval \"$filter_tree\" < /dev/null ||\n \t\t\tdie \"tree filter failed: $filter_tree\"\n \n-\t\tgit diff-index -r $commit | cut -f 2- | tr '\\n' '\\0' | \\\n+\t\tgit diff-index -r $commit | cut -f 2- | tr '\\n' '\\000' | \\\n \t\t\txargs -0 git update-index --add --replace --remove\n \t\tgit ls-files -z --others | \\\n \t\t\txargs -0 git update-index --add --replace --remove\ndiff -pur git-2007-12-10_01/t/diff-lib.sh git-2007-12-10/t/diff-lib.sh\n--- git-2007-12-10_01/t/diff-lib.sh\t2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/diff-lib.sh\t2007-12-11 13:39:56 +0100\n@@ -21,8 +21,8 @@ compare_diff_raw_z () {\n     # Also we do not check SHA1 hash generation in this test, which\n     # is a job for t0000-basic.sh\n \n-    tr '\\0' '\\012' <\"$1\" | sed -e \"$sanitize_diff_raw_z\" >.tmp-1\n-    tr '\\0' '\\012' <\"$2\" | sed -e \"$sanitize_diff_raw_z\" >.tmp-2\n+    tr '\\000' '\\012' <\"$1\" | sed -e \"$sanitize_diff_raw_z\" >.tmp-1\n+    tr '\\000' '\\012' <\"$2\" | sed -e \"$sanitize_diff_raw_z\" >.tmp-2\n     git diff .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2\n }\n \ndiff -pur git-2007-12-10_01/t/t0020-crlf.sh git-2007-12-10/t/t0020-crlf.sh\n--- git-2007-12-10_01/t/t0020-crlf.sh\t2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t0020-crlf.sh\t2007-12-10 14:25:58 +0100\n@@ -5,7 +5,7 @@ test_description='CRLF conversion'\n . ./test-lib.sh\n \n q_to_nul () {\n-\ttr Q '\\0'\n+\ttr Q '\\000'\n }\n \n append_cr () {\ndiff -pur git-2007-12-10_01/t/t1300-repo-config.sh git-2007-12-10/t/t1300-repo-config.sh\n--- git-2007-12-10_01/t/t1300-repo-config.sh\t2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t1300-repo-config.sh\t2007-12-10 09:49:48 +0100\n@@ -591,12 +591,12 @@ Qsection.sub=section.val4\n Qsection.sub=section.val5Q\n EOF\n \n-git config --null --list | tr '[\\000]' 'Q' > result\n+git config --null --list | tr '\\000' 'Q' > result\n echo >>result\n \n test_expect_success '--null --list' 'cmp result expect'\n \n-git config --null --get-regexp 'val[0-9]' | tr '[\\000]' 'Q' > result\n+git config --null --get-regexp 'val[0-9]' | tr '\\000' 'Q' > result\n echo >>result\n \n test_expect_success '--null --get-regexp' 'cmp result expect'\ndiff -pur git-2007-12-10_01/t/t3300-funny-names.sh git-2007-12-10/t/t3300-funny-names.sh\n--- git-2007-12-10_01/t/t3300-funny-names.sh\t2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t3300-funny-names.sh\t2007-12-11 13:40:32 +0100\n@@ -54,7 +54,7 @@ echo 'just space\n no-funny\n tabs\t,\" (dq) and spaces' >expected\n test_expect_success 'git ls-files -z with-funny' \\\n-\t'git ls-files -z | tr \\\\0 \\\\012 >current &&\n+\t'git ls-files -z | tr \\\\000 \\\\012 >current &&\n \tgit diff expected current'\n \n t1=`git write-tree`\n@@ -83,11 +83,11 @@ test_expect_success 'git diff-tree with-\n echo 'A\n tabs\t,\" (dq) and spaces' >expected\n test_expect_success 'git diff-index -z with-funny' \\\n-\t'git diff-index -z --name-status $t0 | tr \\\\0 \\\\012 >current &&\n+\t'git diff-index -z --name-status $t0 | tr \\\\000 \\\\012 >current &&\n \tgit diff expected current'\n \n test_expect_success 'git diff-tree -z with-funny' \\\n-\t'git diff-tree -z --name-status $t0 $t1 | tr \\\\0 \\\\012 >current &&\n+\t'git diff-tree -z --name-status $t0 $t1 | tr \\\\000 \\\\012 >current &&\n \tgit diff expected current'\n \n cat > expected <<\\EOF\ndiff -pur git-2007-12-10_01/t/t4020-diff-external.sh git-2007-12-10/t/t4020-diff-external.sh\n--- git-2007-12-10_01/t/t4020-diff-external.sh\t2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t4020-diff-external.sh\t2007-12-11 13:40:44 +0100\n@@ -99,7 +99,7 @@ test_expect_success 'no diff with -diff'\n \tgit diff | grep Binary\n '\n \n-echo NULZbetweenZwords | tr Z '\\0' > file\n+echo NULZbetweenZwords | tr Z '\\000' > file\n \n test_expect_success 'force diff with \"diff\"' '\n \techo >.gitattributes \"file diff\" &&\ndiff -pur git-2007-12-10_01/t/t4103-apply-binary.sh git-2007-12-10/t/t4103-apply-binary.sh\n--- git-2007-12-10_01/t/t4103-apply-binary.sh\t2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t4103-apply-binary.sh\t2007-12-11 13:40:57 +0100\n@@ -24,10 +24,10 @@ git update-index --add --remove file1 fi\n git-commit -m 'Initial Version' 2>/dev/null\n \n git-checkout -b binary\n-tr 'x' '\\0' <file1 >file3\n+tr 'x' '\\000' <file1 >file3\n cat file3 >file4\n git add file2\n-tr '\\0' 'v' <file3 >file1\n+tr '\\000' 'v' <file3 >file1\n rm -f file2\n git update-index --add --remove file1 file2 file3 file4\n git-commit -m 'Second Version'\ndiff -pur git-2007-12-10_01/t/t4116-apply-reverse.sh git-2007-12-10/t/t4116-apply-reverse.sh\n--- git-2007-12-10_01/t/t4116-apply-reverse.sh\t2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t4116-apply-reverse.sh\t2007-12-11 13:42:13 +0100\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-\ttr \"[ijk]\" '\\''[\\0\\1\\2]'\\'' <file1 >file2 &&\n+\ttr \"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-\ttr \"[mon]\" '\\''[\\0\\1\\2]'\\'' <file1 >file2 &&\n+\ttr \"mon\" '\\''\\000\\001\\002'\\'' <file1 >file2 &&\n \n \tgit commit -a -m second &&\n \tgit tag second &&\ndiff -pur git-2007-12-10_01/t/t4200-rerere.sh git-2007-12-10/t/t4200-rerere.sh\n--- git-2007-12-10_01/t/t4200-rerere.sh\t2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t4200-rerere.sh\t2007-12-11 13:42:28 +0100\n@@ -129,7 +129,7 @@ test_expect_success 'rerere kicked in' \"\n test_expect_success 'rerere prefers first change' 'git diff a1 expect'\n \n rm $rr/postimage\n-echo \"$sha1\ta1\" | tr '\\012' '\\0' > .git/rr-cache/MERGE_RR\n+echo \"$sha1\ta1\" | tr '\\012' '\\000' > .git/rr-cache/MERGE_RR\n \n test_expect_success 'rerere clear' 'git rerere clear'\n \ndiff -pur git-2007-12-10_01/t/t5300-pack-object.sh git-2007-12-10/t/t5300-pack-object.sh\n--- git-2007-12-10_01/t/t5300-pack-object.sh\t2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/t/t5300-pack-object.sh\t2007-12-11 13:42:46 +0100\n@@ -15,7 +15,7 @@ test_expect_success \\\n     'rm -f .git/index*\n      for i in a b c\n      do\n-\t     dd if=/dev/zero bs=4k count=1 | tr \"\\\\0\" $i >$i &&\n+\t     dd if=/dev/zero bs=4k count=1 | tr \"\\\\000\" $i >$i &&\n \t     git update-index --add $i || return 1\n      done &&\n      cat c >d && echo foo >>d && git update-index --add d &&\ndiff -pur git-2007-12-10_01/test-sha1.sh git-2007-12-10/test-sha1.sh\n--- git-2007-12-10_01/test-sha1.sh\t2007-12-09 10:23:48 +0100\n+++ git-2007-12-10/test-sha1.sh\t2007-12-11 13:39:29 +0100\n@@ -10,7 +10,7 @@ do\n \t\t{\n \t\t\ttest -z \"$pfx\" || echo \"$pfx\"\n \t\t\tdd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |\n-\t\t\ttr '[\\0]' '[g]'\n+\t\t\ttr '\\000' 'g'\n \t\t} | ./test-sha1 $cnt\n \t`\n \tif test \"$expect\" = \"$actual\"\n@@ -55,7 +55,7 @@ do\n \t\t{\n \t\t\ttest -z \"$pfx\" || echo \"$pfx\"\n \t\t\tdd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |\n-\t\t\ttr '[\\0]' '[g]'\n+\t\t\ttr '\\000' 'g'\n \t\t} | sha1sum |\n \t\tsed -e 's/ .*//'\n \t`\n"},{"id":"63531","messageId":"7vk5nc4zvn.fsf@gitster.siamese.dyndns.org","threadId":"11325","inReplyTo":"20071217232846.476940ec@pc09.procura.nl","subject":"Re: [PATCH] the use of 'tr' in the test suite isn't really portable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-18T00:20:44Z","receivedAt":"2007-12-18T00:20:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.  Applied.\n"}]}