{"thread":{"id":"30885","subject":"[PATCH 1/2] i18n: leave \\n out of translated diffstat","startedAt":"2012-06-24T12:41:31Z","lastAt":"2012-06-25T11:53:17Z","messageCount":11,"participants":["Nguyễn Thái Ngọc Duy","Jonathan Nieder","Junio C Hamano","Nguyen Thai Ngoc Duy"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"194158","messageId":"1340541692-10834-1-git-send-email-pclouds@gmail.com","threadId":"30885","inReplyTo":null,"subject":"[PATCH 1/2] i18n: leave \\n out of translated diffstat","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-06-24T12:41:31Z","receivedAt":"2012-06-24T12:41:31Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"GETTEXT_POISON scrapes everything in translated strings, including \\n.\nt4205.12 however needs this \\n in matching the end result. Keep this\n\\n out of translation to make t4205.12 happy.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n diff.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex 1a594df..923b6aa 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1397,7 +1397,7 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n \n \tif (!files) {\n \t\tassert(insertions == 0 && deletions == 0);\n-\t\treturn fputs(_(\" 0 files changed\\n\"), fp);\n+\t\treturn fprintf(fp, \"%s\\n\", _(\" 0 files changed\"));\n \t}\n \n \tstrbuf_addf(&sb,\n-- \n1.7.8\n"},{"id":"194159","messageId":"1340541692-10834-2-git-send-email-pclouds@gmail.com","threadId":"30885","inReplyTo":"1340541692-10834-1-git-send-email-pclouds@gmail.com","subject":"[PATCH 2/2] Add C_LOCALE_OUTPUT prereq to test cases that require English text matching","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-06-24T12:41:32Z","receivedAt":"2012-06-24T12:41:32Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"This fixes all GETTEXT_POISON breakages caused by recent i18n changes.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n t/t0006-date.sh                 |    6 +++---\n t/t0040-parse-options.sh        |    8 ++++----\n t/t1300-repo-config.sh          |    2 +-\n t/t1502-rev-parse-parseopt.sh   |    2 +-\n t/t2006-checkout-index-basic.sh |    4 ++--\n t/t2107-update-index-basic.sh   |    4 ++--\n t/t3004-ls-files-basic.sh       |    4 ++--\n t/t3200-branch.sh               |    4 ++--\n t/t3501-revert-cherry-pick.sh   |    4 ++--\n t/t4006-diff-mode.sh            |    8 ++++----\n t/t4012-diff-binary.sh          |    4 ++--\n t/t4120-apply-popt.sh           |    4 ++--\n t/t4133-apply-filenames.sh      |    2 +-\n t/t4200-rerere.sh               |    4 ++--\n t/t4202-log.sh                  |    2 +-\n t/t5300-pack-object.sh          |    2 +-\n t/t5505-remote.sh               |   16 ++++++++--------\n t/t6500-gc.sh                   |    4 ++--\n t/t7508-status.sh               |    2 +-\n t/t7600-merge.sh                |    2 +-\n 20 files changed, 44 insertions(+), 44 deletions(-)\n\ndiff --git a/t/t0006-date.sh b/t/t0006-date.sh\nindex 1d29810..3de3c8f 100755\n--- a/t/t0006-date.sh\n+++ b/t/t0006-date.sh\n@@ -9,7 +9,7 @@ TEST_DATE_NOW=1251660000; export TEST_DATE_NOW\n check_show() {\n \tt=$(($TEST_DATE_NOW - $1))\n \techo \"$t -> $2\" >expect\n-\ttest_expect_${3:-success} \"relative date ($2)\" \"\n+\ttest_expect_${3:-success} C_LOCALE_OUTPUT \"relative date ($2)\" \"\n \ttest-date show $t >actual &&\n \ttest_cmp expect actual\n \t\"\n@@ -29,7 +29,7 @@ check_show 62985600 '2 years ago'\n \n check_parse() {\n \techo \"$1 -> $2\" >expect\n-\ttest_expect_${4:-success} \"parse date ($1${3:+ TZ=$3})\" \"\n+\ttest_expect_${4:-success} C_LOCALE_OUTPUT \"parse date ($1${3:+ TZ=$3})\" \"\n \tTZ=${3:-$TZ} test-date parse '$1' >actual &&\n \ttest_cmp expect actual\n \t\"\n@@ -50,7 +50,7 @@ check_parse '2008-02-14 20:30:45' '2008-02-14 20:30:45 -0500' EST5\n \n check_approxidate() {\n \techo \"$1 -> $2 +0000\" >expect\n-\ttest_expect_${3:-success} \"parse approxidate ($1)\" \"\n+\ttest_expect_${3:-success} C_LOCALE_OUTPUT \"parse approxidate ($1)\" \"\n \ttest-date approxidate '$1' >actual &&\n \ttest_cmp expect actual\n \t\"\ndiff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh\nindex e3f354a..790428d 100755\n--- a/t/t0040-parse-options.sh\n+++ b/t/t0040-parse-options.sh\n@@ -48,7 +48,7 @@ Standard options\n \n EOF\n \n-test_expect_success 'test help' '\n+test_expect_success C_LOCALE_OUTPUT 'test help' '\n \ttest_must_fail test-parse-options -h > output 2> output.err &&\n \ttest ! -s output.err &&\n \ttest_cmp expect output\n@@ -104,8 +104,8 @@ test_expect_success 'OPT_BOOL() is idempotent #2' 'check boolean: 1 -DB'\n test_expect_success 'OPT_BOOL() negation #1' 'check boolean: 0 -D --no-yes'\n test_expect_success 'OPT_BOOL() negation #2' 'check boolean: 0 -D --no-no-doubt'\n \n-test_expect_success 'OPT_BOOL() no negation #1' 'check_unknown --fear'\n-test_expect_success 'OPT_BOOL() no negation #2' 'check_unknown --no-no-fear'\n+test_expect_success C_LOCALE_OUTPUT 'OPT_BOOL() no negation #1' 'check_unknown --fear'\n+test_expect_success C_LOCALE_OUTPUT 'OPT_BOOL() no negation #2' 'check_unknown --no-no-fear'\n \n test_expect_success 'OPT_BOOL() positivation' 'check boolean: 0 -D --doubt'\n \n@@ -308,7 +308,7 @@ cat > expect <<EOF\n Callback: \"not set\", 1\n EOF\n \n-test_expect_success 'OPT_CALLBACK() and callback errors work' '\n+test_expect_success C_LOCALE_OUTPUT 'OPT_CALLBACK() and callback errors work' '\n \ttest_must_fail test-parse-options --no-length > output 2> output.err &&\n \ttest_cmp expect output &&\n \ttest_cmp expect.err output.err\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex a477453..13953dc 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -389,7 +389,7 @@ test_expect_success 'get bool variable with empty value' \\\n \t'git config --bool emptyvalue.variable > output &&\n \t cmp output expect'\n \n-test_expect_success 'no arguments, but no crash' '\n+test_expect_success C_LOCALE_OUTPUT 'no arguments, but no crash' '\n \ttest_must_fail git config >output 2>&1 &&\n \tgrep usage output\n '\ndiff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh\nindex 1efd7f7..2b283ba 100755\n--- a/t/t1502-rev-parse-parseopt.sh\n+++ b/t/t1502-rev-parse-parseopt.sh\n@@ -39,7 +39,7 @@ Extras\n extra1    line above used to cause a segfault but no longer does\n EOF\n \n-test_expect_success 'test --parseopt help output' '\n+test_expect_success C_LOCALE_OUTPUT 'test --parseopt help output' '\n \ttest_expect_code 129 git rev-parse --parseopt -- -h > output < optionspec &&\n \ttest_cmp expect output\n '\ndiff --git a/t/t2006-checkout-index-basic.sh b/t/t2006-checkout-index-basic.sh\nindex b855983..3f75462 100755\n--- a/t/t2006-checkout-index-basic.sh\n+++ b/t/t2006-checkout-index-basic.sh\n@@ -5,12 +5,12 @@ test_description='basic checkout-index tests\n \n . ./test-lib.sh\n \n-test_expect_success 'checkout-index --gobbledegook' '\n+test_expect_success C_LOCALE_OUTPUT 'checkout-index --gobbledegook' '\n \ttest_expect_code 129 git checkout-index --gobbledegook 2>err &&\n \tgrep \"[Uu]sage\" err\n '\n \n-test_expect_success 'checkout-index -h in broken repository' '\n+test_expect_success C_LOCALE_OUTPUT 'checkout-index -h in broken repository' '\n \tmkdir broken &&\n \t(\n \t\tcd broken &&\ndiff --git a/t/t2107-update-index-basic.sh b/t/t2107-update-index-basic.sh\nindex 809fafe..36f2ebf 100755\n--- a/t/t2107-update-index-basic.sh\n+++ b/t/t2107-update-index-basic.sh\n@@ -13,12 +13,12 @@ test_expect_success 'update-index --nonsense fails' '\n \ttest -s msg\n '\n \n-test_expect_success 'update-index --nonsense dumps usage' '\n+test_expect_success C_LOCALE_OUTPUT 'update-index --nonsense dumps usage' '\n \ttest_expect_code 129 git update-index --nonsense 2>err &&\n \tgrep \"[Uu]sage: git update-index\" err\n '\n \n-test_expect_success 'update-index -h with corrupt index' '\n+test_expect_success C_LOCALE_OUTPUT 'update-index -h with corrupt index' '\n \tmkdir broken &&\n \t(\n \t\tcd broken &&\ndiff --git a/t/t3004-ls-files-basic.sh b/t/t3004-ls-files-basic.sh\nindex 490e052..2feeb60 100755\n--- a/t/t3004-ls-files-basic.sh\n+++ b/t/t3004-ls-files-basic.sh\n@@ -20,12 +20,12 @@ test_expect_success 'ls-files with nonexistent path' '\n \ttest_cmp empty actual\n '\n \n-test_expect_success 'ls-files with nonsense option' '\n+test_expect_success C_LOCALE_OUTPUT 'ls-files with nonsense option' '\n \ttest_expect_code 129 git ls-files --nonsense 2>actual &&\n \tgrep \"[Uu]sage: git ls-files\" actual\n '\n \n-test_expect_success 'ls-files -h in corrupt repository' '\n+test_expect_success C_LOCALE_OUTPUT 'ls-files -h in corrupt repository' '\n \tmkdir broken &&\n \t(\n \t\tcd broken &&\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex a17f8b2..4b24cf8 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -23,7 +23,7 @@ test_expect_success \\\n      test_path_is_missing .git/refs/heads/--help\n '\n \n-test_expect_success 'branch -h in broken repository' '\n+test_expect_success C_LOCALE_OUTPUT 'branch -h in broken repository' '\n \tmkdir broken &&\n \t(\n \t\tcd broken &&\n@@ -71,7 +71,7 @@ test_expect_success \\\n         git branch -d l/m &&\n         git branch l'\n \n-test_expect_success \\\n+test_expect_success C_LOCALE_OUTPUT \\\n     'git branch -m dumps usage' \\\n        'test_expect_code 129 git branch -m 2>err &&\n \tgrep \"[Uu]sage: git branch\" err'\ndiff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh\nindex 595d2ff..9b4b860 100755\n--- a/t/t3501-revert-cherry-pick.sh\n+++ b/t/t3501-revert-cherry-pick.sh\n@@ -41,7 +41,7 @@ test_expect_success setup '\n \tgit tag rename2\n '\n \n-test_expect_success 'cherry-pick --nonsense' '\n+test_expect_success C_LOCALE_OUTPUT 'cherry-pick --nonsense' '\n \n \tpos=$(git rev-parse HEAD) &&\n \tgit diff --exit-code HEAD &&\n@@ -50,7 +50,7 @@ test_expect_success 'cherry-pick --nonsense' '\n \tgrep '[Uu]sage:' msg\n '\n \n-test_expect_success 'revert --nonsense' '\n+test_expect_success C_LOCALE_OUTPUT 'revert --nonsense' '\n \n \tpos=$(git rev-parse HEAD) &&\n \tgit diff --exit-code HEAD &&\ndiff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh\nindex 7a3e1f9..135327e 100755\n--- a/t/t4006-diff-mode.sh\n+++ b/t/t4006-diff-mode.sh\n@@ -32,26 +32,26 @@ test_expect_success 'prepare binary file' '\n \tgit commit -m binbin\n '\n \n-test_expect_success '--stat output after text chmod' '\n+test_expect_success C_LOCALE_OUTPUT '--stat output after text chmod' '\n \ttest_chmod -x rezrov &&\n \techo \" 0 files changed\" >expect &&\n \tgit diff HEAD --stat >actual &&\n \ttest_cmp expect actual\n '\n \n-test_expect_success '--shortstat output after text chmod' '\n+test_expect_success C_LOCALE_OUTPUT '--shortstat output after text chmod' '\n \tgit diff HEAD --shortstat >actual &&\n \ttest_cmp expect actual\n '\n \n-test_expect_success '--stat output after binary chmod' '\n+test_expect_success C_LOCALE_OUTPUT '--stat output after binary chmod' '\n \ttest_chmod +x binbin &&\n \techo \" 0 files changed\" >expect &&\n \tgit diff HEAD --stat >actual &&\n \ttest_cmp expect actual\n '\n \n-test_expect_success '--shortstat output after binary chmod' '\n+test_expect_success C_LOCALE_OUTPUT '--shortstat output after binary chmod' '\n \tgit diff HEAD --shortstat >actual &&\n \ttest_cmp expect actual\n '\ndiff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh\nindex 6cebb39..6764a7c 100755\n--- a/t/t4012-diff-binary.sh\n+++ b/t/t4012-diff-binary.sh\n@@ -62,7 +62,7 @@ test_expect_success 'apply --numstat understands diff --binary format' '\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-test_expect_success 'apply detecting corrupt patch correctly' \\\n+test_expect_success C_LOCALE_OUTPUT 'apply detecting corrupt patch correctly' \\\n \t'git diff | sed -e 's/-CIT/xCIT/' >broken &&\n \t if git apply --stat --summary broken 2>detected\n \t then\n@@ -76,7 +76,7 @@ test_expect_success 'apply detecting corrupt patch correctly' \\\n \t detected=`sed -ne \"${detected}p\" broken` &&\n \t test \"$detected\" = xCIT'\n \n-test_expect_success 'apply detecting corrupt patch correctly' \\\n+test_expect_success C_LOCALE_OUTPUT 'apply detecting corrupt patch correctly' \\\n \t'git diff --binary | sed -e 's/-CIT/xCIT/' >broken &&\n \t if git apply --stat --summary broken 2>detected\n \t then\ndiff --git a/t/t4120-apply-popt.sh b/t/t4120-apply-popt.sh\nindex a33d510..90d5313 100755\n--- a/t/t4120-apply-popt.sh\n+++ b/t/t4120-apply-popt.sh\n@@ -29,7 +29,7 @@ test_expect_success 'apply git diff with -p2' '\n \tgit apply -p2 patch.file\n '\n \n-test_expect_success 'apply with too large -p' '\n+test_expect_success C_LOCALE_OUTPUT 'apply with too large -p' '\n \tcp file1.saved file1 &&\n \ttest_must_fail git apply --stat -p3 patch.file 2>err &&\n \tgrep \"removing 3 leading\" err\n@@ -51,7 +51,7 @@ test_expect_success 'apply (-p2) traditional diff with funny filenames' '\n \ttest_cmp expected file1\n '\n \n-test_expect_success 'apply with too large -p and fancy filename' '\n+test_expect_success C_LOCALE_OUTPUT 'apply with too large -p and fancy filename' '\n \tcp file1.saved file1 &&\n \ttest_must_fail git apply --stat -p3 patch.escaped 2>err &&\n \tgrep \"removing 3 leading\" err\ndiff --git a/t/t4133-apply-filenames.sh b/t/t4133-apply-filenames.sh\nindex 94da990..94b0233 100755\n--- a/t/t4133-apply-filenames.sh\n+++ b/t/t4133-apply-filenames.sh\n@@ -28,7 +28,7 @@ index d00491f..0000000\n EOF\n '\n \n-test_expect_success 'apply diff with inconsistent filenames in headers' '\n+test_expect_success C_LOCALE_OUTPUT 'apply diff with inconsistent filenames in headers' '\n \ttest_must_fail git apply bad1.patch 2>err &&\n \tgrep \"inconsistent new filename\" err &&\n \ttest_must_fail git apply bad2.patch 2>err &&\ndiff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh\nindex 36255d6..937b217 100755\n--- a/t/t4200-rerere.sh\n+++ b/t/t4200-rerere.sh\n@@ -377,7 +377,7 @@ test_expect_success 'explicit rerere --rerere-autoupdate overrides' '\n \ttest_cmp expected.unresolved actual2\n '\n \n-test_expect_success 'rerere --no-no-rerere-autoupdate' '\n+test_expect_success C_LOCALE_OUTPUT 'rerere --no-no-rerere-autoupdate' '\n \tgit rm -fr --cached . &&\n \tgit update-index --index-info <failedmerge &&\n \tcp file3.conflict file3 &&\n@@ -386,7 +386,7 @@ test_expect_success 'rerere --no-no-rerere-autoupdate' '\n \ttest_must_fail git update-index --refresh\n '\n \n-test_expect_success 'rerere -h' '\n+test_expect_success C_LOCALE_OUTPUT 'rerere -h' '\n \ttest_must_fail git rerere -h >help &&\n \tgrep [Uu]sage help\n '\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 71be59d..dc7d2e1 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -800,7 +800,7 @@ sanitize_output () {\n \t    -e 's/, 1 insertions(+)/, 1 insertion(+)/'\n }\n \n-test_expect_success 'log --graph with diff and stats' '\n+test_expect_success C_LOCALE_OUTPUT 'log --graph with diff and stats' '\n \tgit log --graph --pretty=short --stat -p >actual &&\n \tsanitize_output >actual.sanitized <actual &&\n \ttest_cmp expect actual.sanitized\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex d9d856b..da54924 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -413,7 +413,7 @@ test_expect_success \\\n      cp -f\t.git/objects/9d/235ed07cd19811a6ceb342de82f190e49c9f68 \\\n \t\t.git/objects/c8/2de19312b6c3695c0c18f70709a6c535682a67'\n \n-test_expect_success \\\n+test_expect_success C_LOCALE_OUTPUT \\\n     'make sure index-pack detects the SHA1 collision' \\\n     'test_must_fail git index-pack -o bad.idx test-3.pack 2>msg &&\n      grep \"SHA1 COLLISION FOUND\" msg'\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex e8af615..f632262 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -24,7 +24,7 @@ setup_repository () {\n tokens_match () {\n \techo \"$1\" | tr ' ' '\\012' | sort | sed -e '/^$/d' >expect &&\n \techo \"$2\" | tr ' ' '\\012' | sort | sed -e '/^$/d' >actual &&\n-\ttest_cmp expect actual\n+\ttest_i18ncmp expect actual\n }\n \n check_remote_track () {\n@@ -131,8 +131,8 @@ EOF\n \tgit remote rm oops 2>actual2 &&\n \tgit branch -d foobranch &&\n \tgit tag -d footag &&\n-\ttest_cmp expect1 actual1 &&\n-\ttest_cmp expect2 actual2\n+\ttest_i18ncmp expect1 actual1 &&\n+\ttest_i18ncmp expect2 actual2\n )\n '\n \n@@ -192,7 +192,7 @@ test_expect_success 'show' '\n \t git config --add remote.two.push refs/heads/master:refs/heads/another &&\n \t git remote show origin two > output &&\n \t git branch -d rebase octopus &&\n-\t test_cmp expect output)\n+\t test_i18ncmp expect output)\n '\n \n cat > test/expect << EOF\n@@ -217,7 +217,7 @@ test_expect_success 'show -n' '\n \t cd test &&\n \t git remote show -n origin > output &&\n \t mv ../one.unreachable ../one &&\n-\t test_cmp expect output)\n+\t test_i18ncmp expect output)\n '\n \n test_expect_success 'prune' '\n@@ -255,7 +255,7 @@ EOF\n test_expect_success 'set-head --auto fails w/multiple HEADs' '\n \t(cd test &&\n \t test_must_fail git remote set-head --auto two >output 2>&1 &&\n-\ttest_cmp expect output)\n+\ttest_i18ncmp expect output)\n '\n \n cat >test/expect <<EOF\n@@ -285,7 +285,7 @@ test_expect_success 'prune --dry-run' '\n \t test_must_fail git rev-parse refs/remotes/origin/side &&\n \t(cd ../one &&\n \t git branch -m side side2) &&\n-\t test_cmp expect output)\n+\t test_i18ncmp expect output)\n '\n \n test_expect_success 'add --mirror && prune' '\n@@ -694,7 +694,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '\n \t test \"$(git config remote.origin.fetch)\" = \"refs/heads/master:refs/heads/origin\")\n '\n \n-test_expect_success 'remote prune to cause a dangling symref' '\n+test_expect_success C_LOCALE_OUTPUT 'remote prune to cause a dangling symref' '\n \tgit clone one seven &&\n \t(\n \t\tcd one &&\ndiff --git a/t/t6500-gc.sh b/t/t6500-gc.sh\nindex 82f3639..00a7a5b 100755\n--- a/t/t6500-gc.sh\n+++ b/t/t6500-gc.sh\n@@ -9,12 +9,12 @@ test_expect_success 'gc empty repository' '\n \tgit gc\n '\n \n-test_expect_success 'gc --gobbledegook' '\n+test_expect_success C_LOCALE_OUTPUT 'gc --gobbledegook' '\n \ttest_expect_code 129 git gc --nonsense 2>err &&\n \tgrep \"[Uu]sage: git gc\" err\n '\n \n-test_expect_success 'gc -h with invalid configuration' '\n+test_expect_success C_LOCALE_OUTPUT 'gc -h with invalid configuration' '\n \tmkdir broken &&\n \t(\n \t\tcd broken &&\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex 28e1848..c3ca2ef 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -59,7 +59,7 @@ test_expect_success 'status (1)' '\n \ttest_i18ngrep \"use \\\"git rm --cached <file>\\.\\.\\.\\\" to unstage\" output\n '\n \n-test_expect_success 'status --column' '\n+test_expect_success C_LOCALE_OUTPUT 'status --column' '\n \tCOLUMNS=50 git status --column=\"column dense\" >output &&\n \tcat >expect <<\\EOF &&\n # On branch master\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex 9e27bbf..eebab61 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -149,7 +149,7 @@ test_expect_success 'test option parsing' '\n \ttest_must_fail git merge\n '\n \n-test_expect_success 'merge -h with invalid index' '\n+test_expect_success C_LOCALE_OUTPUT 'merge -h with invalid index' '\n \tmkdir broken &&\n \t(\n \t\tcd broken &&\n-- \n1.7.8\n"},{"id":"194167","messageId":"20120624160411.GA18791@burratino","threadId":"30885","inReplyTo":"1340541692-10834-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH 1/2] i18n: leave \\n out of translated diffstat","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-06-24T16:04:11Z","receivedAt":"2012-06-24T16:04:11Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nNguyễn Thái Ngọc Duy wrote:\n\n> GETTEXT_POISON scrapes everything in translated strings, including \\n.\n> t4205.12 however needs this \\n in matching the end result. Keep this\n> \\n out of translation to make t4205.12 happy.\n[...]\n> --- a/diff.c\n> +++ b/diff.c\n> @@ -1397,7 +1397,7 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n>  \n>  \tif (!files) {\n>  \t\tassert(insertions == 0 && deletions == 0);\n> -\t\treturn fputs(_(\" 0 files changed\\n\"), fp);\n> +\t\treturn fprintf(fp, \"%s\\n\", _(\" 0 files changed\"));\n\nMore importantly, this makes the string more similar to other\ntranslated strings in the same file and saves translators from having\nto remember to worry about appropriate whitespace at the end of the\nstring.\n\nActually, it should be possible to make their lives even easier.  How\nabout this?\n\ndiff --git i/diff.c w/diff.c\nindex 1a594df4..c53eea50 100644\n--- i/diff.c\n+++ w/diff.c\n@@ -1395,11 +1395,6 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n \tstruct strbuf sb = STRBUF_INIT;\n \tint ret;\n \n-\tif (!files) {\n-\t\tassert(insertions == 0 && deletions == 0);\n-\t\treturn fputs(_(\" 0 files changed\\n\"), fp);\n-\t}\n-\n \tstrbuf_addf(&sb,\n \t\t    Q_(\" %d file changed\", \" %d files changed\", files),\n \t\t    files);\n"},{"id":"194169","messageId":"20120624162807.GB18791@burratino","threadId":"30885","inReplyTo":"1340541692-10834-2-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH 2/2] Add C_LOCALE_OUTPUT prereq to test cases that require English text matching","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-06-24T16:28:07Z","receivedAt":"2012-06-24T16:28:07Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Nguyễn Thái Ngọc Duy wrote:\n\n> This fixes all GETTEXT_POISON breakages caused by recent i18n changes.\n\nFirst, thanks much for this.\n\nLots of these could be fixed in a more targetted way by using\ntest_i18ngrep, but the C_LOCALE_OUTPUT prereq works just as well as a\nway to double-check that the newly translated strings are hopefully\nnot disrupting any functionality people rely on.\n\n[...]\n> --- a/t/t0006-date.sh\n> +++ b/t/t0006-date.sh\n> @@ -9,7 +9,7 @@ TEST_DATE_NOW=1251660000; export TEST_DATE_NOW\n>  check_show() {\n>  \tt=$(($TEST_DATE_NOW - $1))\n>  \techo \"$t -> $2\" >expect\n> -\ttest_expect_${3:-success} \"relative date ($2)\" \"\n> +\ttest_expect_${3:-success} C_LOCALE_OUTPUT \"relative date ($2)\" \"\n>  \ttest-date show $t >actual &&\n>  \ttest_cmp expect actual\n>  \t\"\n\nCould use test_i18ncmp so we catch if test-date crashes, but anyway,\nyeah, we can't expect to be able to meaningfully test date formatting\nin another language.\n\n\n> @@ -29,7 +29,7 @@ check_show 62985600 '2 years ago'\n>  \n>  check_parse() {\n>  \techo \"$1 -> $2\" >expect\n> -\ttest_expect_${4:-success} \"parse date ($1${3:+ TZ=$3})\" \"\n> +\ttest_expect_${4:-success} C_LOCALE_OUTPUT \"parse date ($1${3:+ TZ=$3})\" \"\n>  \tTZ=${3:-$TZ} test-date parse '$1' >actual &&\n>  \ttest_cmp expect actual\n>  \t\"\n\nThis one is less pleasant.  Could test-date be convinced to produce\nmachine-readable output (e.g., seconds since the epoque)?  I'd be\nespecially concerned to check that the parser still accepts the\nsame input strings in other locales.\n\n> @@ -50,7 +50,7 @@ check_parse '2008-02-14 20:30:45' '2008-02-14 20:30:45 -0500' EST5\n>  \n>  check_approxidate() {\n>  \techo \"$1 -> $2 +0000\" >expect\n> -\ttest_expect_${3:-success} \"parse approxidate ($1)\" \"\n> +\ttest_expect_${3:-success} C_LOCALE_OUTPUT \"parse approxidate ($1)\" \"\n>  \ttest-date approxidate '$1' >actual &&\n>  \ttest_cmp expect actual\n>  \t\"\n\nLikewise.\n\n[...]\n> --- a/t/t0040-parse-options.sh\n> +++ b/t/t0040-parse-options.sh\n> @@ -48,7 +48,7 @@ Standard options\n>  \n>  EOF\n>  \n> -test_expect_success 'test help' '\n> +test_expect_success C_LOCALE_OUTPUT 'test help' '\n>  \ttest_must_fail test-parse-options -h > output 2> output.err &&\n>  \ttest ! -s output.err &&\n>  \ttest_cmp expect output\n\nSensible.\n\n> @@ -104,8 +104,8 @@ test_expect_success 'OPT_BOOL() is idempotent #2' 'check boolean: 1 -DB'\n>  test_expect_success 'OPT_BOOL() negation #1' 'check boolean: 0 -D --no-yes'\n>  test_expect_success 'OPT_BOOL() negation #2' 'check boolean: 0 -D --no-no-doubt'\n>  \n> -test_expect_success 'OPT_BOOL() no negation #1' 'check_unknown --fear'\n> -test_expect_success 'OPT_BOOL() no negation #2' 'check_unknown --no-no-fear'\n> +test_expect_success C_LOCALE_OUTPUT 'OPT_BOOL() no negation #1' 'check_unknown --fear'\n> +test_expect_success C_LOCALE_OUTPUT 'OPT_BOOL() no negation #2' 'check_unknown --no-no-fear'\n\nSimpler to do\n\n      --- i/t/t0040-parse-options.sh\n      +++ w/t/t0040-parse-options.sh\n      @@ -89,7 +89,7 @@ check_unknown() {\n\t      cat expect.err >>expect &&\n\t      test_must_fail test-parse-options $* >output 2>output.err &&\n\t      test ! -s output &&\n      -\ttest_cmp expect output.err\n      +\ttest_i18ncmp expect output.err\n       }\n       \n       test_expect_success 'OPT_BOOL() #1' 'check boolean: 1 --yes'\n\n[...]\n> @@ -308,7 +308,7 @@ cat > expect <<EOF\n>  Callback: \"not set\", 1\n>  EOF\n>  \n> -test_expect_success 'OPT_CALLBACK() and callback errors work' '\n> +test_expect_success C_LOCALE_OUTPUT 'OPT_CALLBACK() and callback errors work' '\n>  \ttest_must_fail test-parse-options --no-length > output 2> output.err &&\n>  \ttest_cmp expect output &&\n>  \ttest_cmp expect.err output.err\n\nUsing test_i18ncmp on stderr would allow us to keep checking stdout.\n\n[...]\n> --- a/t/t1300-repo-config.sh\n> +++ b/t/t1300-repo-config.sh\n> @@ -389,7 +389,7 @@ test_expect_success 'get bool variable with empty value' \\\n>  \t'git config --bool emptyvalue.variable > output &&\n>  \t cmp output expect'\n>  \n> -test_expect_success 'no arguments, but no crash' '\n> +test_expect_success C_LOCALE_OUTPUT 'no arguments, but no crash' '\n>  \ttest_must_fail git config >output 2>&1 &&\n>  \tgrep usage output\n>  '\n\nIt's mostly about \"no crash\", so test_i18ngrep would be more\ncomforting.\n\n[...]\n> --- a/t/t1502-rev-parse-parseopt.sh\n> +++ b/t/t1502-rev-parse-parseopt.sh\n> @@ -39,7 +39,7 @@ Extras\n>  extra1    line above used to cause a segfault but no longer does\n>  EOF\n>  \n> -test_expect_success 'test --parseopt help output' '\n> +test_expect_success C_LOCALE_OUTPUT 'test --parseopt help output' '\n>  \ttest_expect_code 129 git rev-parse --parseopt -- -h > output < optionspec &&\n>  \ttest_cmp expect output\n>  '\n\nSeems fine (though test_i18ncmp is more targetted).\n\n> --- a/t/t2006-checkout-index-basic.sh\n> +++ b/t/t2006-checkout-index-basic.sh\n> @@ -5,12 +5,12 @@ test_description='basic checkout-index tests\n>  \n>  . ./test-lib.sh\n>  \n> -test_expect_success 'checkout-index --gobbledegook' '\n> +test_expect_success C_LOCALE_OUTPUT 'checkout-index --gobbledegook' '\n[...]\n> -test_expect_success 'checkout-index -h in broken repository' '\n> +test_expect_success C_LOCALE_OUTPUT 'checkout-index -h in broken repository' '\n[...]\n> +++ b/t/t2107-update-index-basic.sh\n[...]\n> -test_expect_success 'update-index --nonsense dumps usage' '\n> +test_expect_success C_LOCALE_OUTPUT 'update-index --nonsense dumps usage' '\n[...]\n> -test_expect_success 'update-index -h with corrupt index' '\n> +test_expect_success C_LOCALE_OUTPUT 'update-index -h with corrupt index' '\n[...]\n> +++ b/t/t3004-ls-files-basic.sh\n[...]\n> -test_expect_success 'ls-files with nonsense option' '\n> +test_expect_success C_LOCALE_OUTPUT 'ls-files with nonsense option' '\n[...]\n> -test_expect_success 'ls-files -h in corrupt repository' '\n> +test_expect_success C_LOCALE_OUTPUT 'ls-files -h in corrupt repository' '\n[...]\n> +++ b/t/t3200-branch.sh\n[...]\n> -test_expect_success 'branch -h in broken repository' '\n> +test_expect_success C_LOCALE_OUTPUT 'branch -h in broken repository' '\n[...]\n> -test_expect_success \\\n> +test_expect_success C_LOCALE_OUTPUT \\\n>      'git branch -m dumps usage' \\\n[...]\n> +++ b/t/t3501-revert-cherry-pick.sh\n[...]\n> -test_expect_success 'cherry-pick --nonsense' '\n> +test_expect_success C_LOCALE_OUTPUT 'cherry-pick --nonsense' '\n[...]\n> -test_expect_success 'revert --nonsense' '\n> +test_expect_success C_LOCALE_OUTPUT 'revert --nonsense' '\n\nLikewise.\n\n> --- a/t/t4006-diff-mode.sh\n> +++ b/t/t4006-diff-mode.sh\n> @@ -32,26 +32,26 @@ test_expect_success 'prepare binary file' '\n>  \tgit commit -m binbin\n>  '\n>  \n> -test_expect_success '--stat output after text chmod' '\n> +test_expect_success C_LOCALE_OUTPUT '--stat output after text chmod' '\n>  \ttest_chmod -x rezrov &&\n>  \techo \" 0 files changed\" >expect &&\n>  \tgit diff HEAD --stat >actual &&\n>  \ttest_cmp expect actual\n>  '\n\nYeah, sensible enough.\n\nIt would be possible to recover some of the test by adding another\nthat does --numstat.\n\n[...]\n> --- a/t/t4012-diff-binary.sh\n> +++ b/t/t4012-diff-binary.sh\n> @@ -62,7 +62,7 @@ test_expect_success 'apply --numstat understands diff --binary format' '\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> -test_expect_success 'apply detecting corrupt patch correctly' \\\n> +test_expect_success C_LOCALE_OUTPUT 'apply detecting corrupt patch correctly' \\\n>  \t'git diff | sed -e 's/-CIT/xCIT/' >broken &&\n>  \t if git apply --stat --summary broken 2>detected\n>  \t then\n\nThis is an old one and uses a weird style.  I guess I'd go for\n\n\tgit diff >patch &&\n\tsed -e \"s/-CIT/xCIT/\" <patch >broken &&\n\ttest_must_fail git apply --stat --summary broken 2>detected &&\n\n\tif test_have_prereq C_LOCALE_OUTPUT\n\tthen\n\t\tl=$(sed -n \"s/.*fatal.*at line \\([0-9]*\\).*/\\1/p\" <detected) &&\n\t\techo xCIT >expect &&\n\t\tsed -n \"$l p\" <broken >actual &&\n\t\ttest_cmp expect actual\n\tfi\n\nA translator is free to use %Id for the line number, so it's hard to\nparse this in an arbitrary locale.\n\n[...]\n> -test_expect_success 'apply detecting corrupt patch correctly' \\\n> +test_expect_success C_LOCALE_OUTPUT 'apply detecting corrupt patch correctly' \\\n\nLikewise.\n\n[...]\n> --- a/t/t4120-apply-popt.sh\n> +++ b/t/t4120-apply-popt.sh\n[...]\n> -test_expect_success 'apply with too large -p' '\n> +test_expect_success C_LOCALE_OUTPUT 'apply with too large -p' '\n>  \tcp file1.saved file1 &&\n>  \ttest_must_fail git apply --stat -p3 patch.file 2>err &&\n>  \tgrep \"removing 3 leading\" err\n\nIt's mostly about making sure \"git apply\" fails gracefully and the\nfunctionality involves parsing (which can get screwed up by locale\nsettings), so keeping the test running in other locales using\ntest_i18ngrep would be a comfort.  \n\n[...]\n> -test_expect_success 'apply with too large -p and fancy filename' '\n> +test_expect_success C_LOCALE_OUTPUT 'apply with too large -p and fancy filename' '\n\nLikewise.\n\n> --- a/t/t4133-apply-filenames.sh\n> +++ b/t/t4133-apply-filenames.sh\n> @@ -28,7 +28,7 @@ index d00491f..0000000\n[...]\n> -test_expect_success 'apply diff with inconsistent filenames in headers' '\n> +test_expect_success C_LOCALE_OUTPUT 'apply diff with inconsistent filenames in headers' '\n>  \ttest_must_fail git apply bad1.patch 2>err &&\n>  \tgrep \"inconsistent new filename\" err &&\n>  \ttest_must_fail git apply bad2.patch 2>err &&\n[...]\n> +++ b/t/t4200-rerere.sh\n[...]\n> +test_expect_success C_LOCALE_OUTPUT 'rerere --no-no-rerere-autoupdate' '\n[...]\n> +test_expect_success C_LOCALE_OUTPUT 'rerere -h' '\n[...]\n> +++ b/t/t4202-log.sh\n[...]\n> +test_expect_success C_LOCALE_OUTPUT 'log --graph with diff and stats' '\n\nSeems fine.\n\n> --- a/t/t5300-pack-object.sh\n> +++ b/t/t5300-pack-object.sh\n> @@ -413,7 +413,7 @@ test_expect_success \\\n[...]\n> -test_expect_success \\\n> +test_expect_success C_LOCALE_OUTPUT \\\n>      'make sure index-pack detects the SHA1 collision' \\\n>      'test_must_fail git index-pack -o bad.idx test-3.pack 2>msg &&\n>       grep \"SHA1 COLLISION FOUND\" msg'\n\nI'd drop the grep, personally.\n\n[...]\n> --- a/t/t5505-remote.sh\n> +++ b/t/t5505-remote.sh\n> @@ -24,7 +24,7 @@ setup_repository () {\n>  tokens_match () {\n>  \techo \"$1\" | tr ' ' '\\012' | sort | sed -e '/^$/d' >expect &&\n>  \techo \"$2\" | tr ' ' '\\012' | sort | sed -e '/^$/d' >actual &&\n> -\ttest_cmp expect actual\n> +\ttest_i18ncmp expect actual\n\nSensible.\n\n[...]\n> @@ -694,7 +694,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' '\n>  \t test \"$(git config remote.origin.fetch)\" = \"refs/heads/master:refs/heads/origin\")\n>  '\n>  \n> -test_expect_success 'remote prune to cause a dangling symref' '\n> +test_expect_success C_LOCALE_OUTPUT 'remote prune to cause a dangling symref' '\n>  \tgit clone one seven &&\n\ntest_i18ngrep message\n\nand\n\ntest_i18ngrep ! message\n\nwork well for this kind of thing.\n\n[...]\n> --- a/t/t6500-gc.sh\n> +++ b/t/t6500-gc.sh\n[...]\n> +test_expect_success C_LOCALE_OUTPUT 'gc --gobbledegook' '\n[...]\n> +test_expect_success C_LOCALE_OUTPUT 'gc -h with invalid configuration' '\n[...]\n> +++ b/t/t7508-status.sh\n[...]\n> +test_expect_success C_LOCALE_OUTPUT 'status --column' '\n[...]\n> +test_expect_success C_LOCALE_OUTPUT 'merge -h with invalid index' '\n\nSane.\n\nHope that helps,\nJonathan\n"},{"id":"194175","messageId":"7vzk7shvd0.fsf@alter.siamese.dyndns.org","threadId":"30885","inReplyTo":"20120624160411.GA18791@burratino","subject":"Re: [PATCH 1/2] i18n: leave \\n out of translated diffstat","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-25T04:24:27Z","receivedAt":"2012-06-25T04:24:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Hi,\n>\n> Nguyễn Thái Ngọc Duy wrote:\n>\n>> GETTEXT_POISON scrapes everything in translated strings, including \\n.\n>> t4205.12 however needs this \\n in matching the end result. Keep this\n>> \\n out of translation to make t4205.12 happy.\n> [...]\n>> --- a/diff.c\n>> +++ b/diff.c\n>> @@ -1397,7 +1397,7 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n>>  \n>>  \tif (!files) {\n>>  \t\tassert(insertions == 0 && deletions == 0);\n>> -\t\treturn fputs(_(\" 0 files changed\\n\"), fp);\n>> +\t\treturn fprintf(fp, \"%s\\n\", _(\" 0 files changed\"));\n>\n> More importantly, this makes the string more similar to other\n> translated strings in the same file and saves translators from having\n> to remember to worry about appropriate whitespace at the end of the\n> string.\n>\n> Actually, it should be possible to make their lives even easier.  How\n> about this?\n>\n> diff --git i/diff.c w/diff.c\n> index 1a594df4..c53eea50 100644\n> --- i/diff.c\n> +++ w/diff.c\n> @@ -1395,11 +1395,6 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n>  \tstruct strbuf sb = STRBUF_INIT;\n>  \tint ret;\n>  \n> -\tif (!files) {\n> -\t\tassert(insertions == 0 && deletions == 0);\n> -\t\treturn fputs(_(\" 0 files changed\\n\"), fp);\n> -\t}\n> -\n>  \tstrbuf_addf(&sb,\n>  \t\t    Q_(\" %d file changed\", \" %d files changed\", files),\n>  \t\t    files);\n\nYeah, I think that is going in the right direction.\n\nThanks for careful reviews.\n"},{"id":"194197","messageId":"CACsJy8De_Toy+7jvsBueYZpcuakTxZupmwLYZVm29Ni3+1QuMw@mail.gmail.com","threadId":"30885","inReplyTo":"7vzk7shvd0.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/2] i18n: leave \\n out of translated diffstat","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-06-25T11:17:22Z","receivedAt":"2012-06-25T11:17:22Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Jun 25, 2012 at 11:24 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Jonathan Nieder <jrnieder@gmail.com> writes:\n>\n>> Hi,\n>>\n>> Nguyễn Thái Ngọc Duy wrote:\n>>\n>>> GETTEXT_POISON scrapes everything in translated strings, including \\n.\n>>> t4205.12 however needs this \\n in matching the end result. Keep this\n>>> \\n out of translation to make t4205.12 happy.\n>> [...]\n>>> --- a/diff.c\n>>> +++ b/diff.c\n>>> @@ -1397,7 +1397,7 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n>>>\n>>>      if (!files) {\n>>>              assert(insertions == 0 && deletions == 0);\n>>> -            return fputs(_(\" 0 files changed\\n\"), fp);\n>>> +            return fprintf(fp, \"%s\\n\", _(\" 0 files changed\"));\n>>\n>> More importantly, this makes the string more similar to other\n>> translated strings in the same file and saves translators from having\n>> to remember to worry about appropriate whitespace at the end of the\n>> string.\n>>\n>> Actually, it should be possible to make their lives even easier.  How\n>> about this?\n>>\n>> diff --git i/diff.c w/diff.c\n>> index 1a594df4..c53eea50 100644\n>> --- i/diff.c\n>> +++ w/diff.c\n>> @@ -1395,11 +1395,6 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n>>       struct strbuf sb = STRBUF_INIT;\n>>       int ret;\n>>\n>> -     if (!files) {\n>> -             assert(insertions == 0 && deletions == 0);\n>> -             return fputs(_(\" 0 files changed\\n\"), fp);\n>> -     }\n>> -\n>>       strbuf_addf(&sb,\n>>                   Q_(\" %d file changed\", \" %d files changed\", files),\n>>                   files);\n>\n> Yeah, I think that is going in the right direction.\n\nThat prints \"0 files changed, 0 insertions(+), 0 deletions(-)\" instead\nof \"0 files changed\". Two more changed lines to make it the latter. I\ndon't mind either way, just checking which way you two and the list\nprefer before I submit another patch.\n-- \nDuy\n"},{"id":"194199","messageId":"CACsJy8DpOL+V=sVZt3B-7OQ=POHtu1bovFB-sQ9HwPpmdKmN-A@mail.gmail.com","threadId":"30885","inReplyTo":"20120624162807.GB18791@burratino","subject":"Re: [PATCH 2/2] Add C_LOCALE_OUTPUT prereq to test cases that require English text matching","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-06-25T11:32:30Z","receivedAt":"2012-06-25T11:32:30Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sun, Jun 24, 2012 at 11:28 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Nguyễn Thái Ngọc Duy wrote:\n>\n>> This fixes all GETTEXT_POISON breakages caused by recent i18n changes.\n>\n> First, thanks much for this.\n>\n> Lots of these could be fixed in a more targetted way by using\n> test_i18ngrep, but the C_LOCALE_OUTPUT prereq works just as well as a\n> way to double-check that the newly translated strings are hopefully\n> not disrupting any functionality people rely on.\n\nI probably still don't grasp the principles behind gettext-poison.\nPretending success quietly in test_i18ngrep and test_i18ncmp makes me\nuncomfortable. At least C_LOCAL_OUTPUT clearly shows the test is\nskipped, which is why I prefer it over test_i18n*. Letting it run to\ncatch crashes is good, but not enough (it's more likely to crash with\nwrong printf format specifiers for example, which gettext-poison won't\ncatch). Will update it according to your comments.\n\n> [...]\n>> --- a/t/t0006-date.sh\n>> +++ b/t/t0006-date.sh\n>> @@ -9,7 +9,7 @@ TEST_DATE_NOW=1251660000; export TEST_DATE_NOW\n>>  check_show() {\n>>       t=$(($TEST_DATE_NOW - $1))\n>>       echo \"$t -> $2\" >expect\n>> -     test_expect_${3:-success} \"relative date ($2)\" \"\n>> +     test_expect_${3:-success} C_LOCALE_OUTPUT \"relative date ($2)\" \"\n>>       test-date show $t >actual &&\n>>       test_cmp expect actual\n>>       \"\n>\n> Could use test_i18ncmp so we catch if test-date crashes, but anyway,\n> yeah, we can't expect to be able to meaningfully test date formatting\n> in another language.\n\nThis reminds me of an inkscape crash I encountered long ago because of\na mistake in Vietnamese translation. Too bad we can't test all locales\nfor similar bugs (or we would need to i18n-ize expected results in the\ntest suite too)\n-- \nDuy\n"},{"id":"194200","messageId":"20120625113328.GA9270@burratino","threadId":"30885","inReplyTo":"CACsJy8De_Toy+7jvsBueYZpcuakTxZupmwLYZVm29Ni3+1QuMw@mail.gmail.com","subject":"Re: [PATCH 1/2] i18n: leave \\n out of translated diffstat","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-06-25T11:33:29Z","receivedAt":"2012-06-25T11:33:29Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Nguyen Thai Ngoc Duy wrote:\n\n> That prints \"0 files changed, 0 insertions(+), 0 deletions(-)\" instead\n> of \"0 files changed\". Two more changed lines to make it the latter.\n\nSloppy of me.  Yes, I meant\n\ndiff --git i/diff.c w/diff.c\nindex 1a594df4..287f310d 100644\n--- i/diff.c\n+++ w/diff.c\n@@ -1395,11 +1395,6 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n \tstruct strbuf sb = STRBUF_INIT;\n \tint ret;\n \n-\tif (!files) {\n-\t\tassert(insertions == 0 && deletions == 0);\n-\t\treturn fputs(_(\" 0 files changed\\n\"), fp);\n-\t}\n-\n \tstrbuf_addf(&sb,\n \t\t    Q_(\" %d file changed\", \" %d files changed\", files),\n \t\t    files);\n@@ -1412,7 +1407,7 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n \t * is probably less confusing (i.e skip over \"2 files changed\n \t * but nothing about added/removed lines? Is this a bug in Git?\").\n \t */\n-\tif (insertions || deletions == 0) {\n+\tif (insertions || (files && deletions == 0)) {\n \t\t/*\n \t\t * TRANSLATORS: \"+\" in (+) is a line addition marker;\n \t\t * do not translate it.\n@@ -1423,7 +1418,7 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)\n \t\t\t    insertions);\n \t}\n \n-\tif (deletions || insertions == 0) {\n+\tif (deletions || (files && insertions == 0)) {\n \t\t/*\n \t\t * TRANSLATORS: \"-\" in (-) is a line removal marker;\n \t\t * do not translate it.\n"},{"id":"194201","messageId":"20120625113956.GB9270@burratino","threadId":"30885","inReplyTo":"CACsJy8DpOL+V=sVZt3B-7OQ=POHtu1bovFB-sQ9HwPpmdKmN-A@mail.gmail.com","subject":"Re: [PATCH 2/2] Add C_LOCALE_OUTPUT prereq to test cases that require English text matching","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-06-25T11:39:56Z","receivedAt":"2012-06-25T11:39:56Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Nguyen Thai Ngoc Duy wrote:\n> On Sun, Jun 24, 2012 at 11:28 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>> Nguyễn Thái Ngọc Duy wrote:\n\n>>> -     test_expect_${3:-success} \"relative date ($2)\" \"\n>>> +     test_expect_${3:-success} C_LOCALE_OUTPUT \"relative date ($2)\" \"\n>>>       test-date show $t >actual &&\n>>>       test_cmp expect actual\n>>>       \"\n>>\n>> Could use test_i18ncmp so we catch if test-date crashes, but anyway,\n>> yeah, we can't expect to be able to meaningfully test date formatting\n>> in another language.\n>\n> This reminds me of an inkscape crash I encountered long ago because of\n> a mistake in Vietnamese translation. Too bad we can't test all locales\n> for similar bugs (or we would need to i18n-ize expected results in the\n> test suite too)\n\nSure we can. :)  We just need to make sure we are using test_i18ncmp\nwhere appropriate so the tests run and check as much as they can\nwithout relying on details that are left to the translators'\ndisgression.\n\nBut yes, the test harness doesn't know how to do that yet.  I'm hoping\nthat soon-ish there will be an option to run tests in your chosen\nlanguage, so the test result can more closely reflect bugs one is\nlikely to run into in practice (and so developers can more easily test\nthe edge cases such as Turkic locales where tolower('I') != 'i').\nSorry I haven't had enough time to bring this kind of thing into\nreality, and thanks for stepping in with the partial work in that\ndirection before.\n\nJonathan\n"},{"id":"194202","messageId":"CACsJy8BMizkU+P6VPhkbY_q2tYY5=aY-GNHeDjBYN9-zg2nENQ@mail.gmail.com","threadId":"30885","inReplyTo":"CACsJy8DpOL+V=sVZt3B-7OQ=POHtu1bovFB-sQ9HwPpmdKmN-A@mail.gmail.com","subject":"Re: [PATCH 2/2] Add C_LOCALE_OUTPUT prereq to test cases that require English text matching","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-06-25T11:45:06Z","receivedAt":"2012-06-25T11:45:06Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Jun 25, 2012 at 6:32 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n>>> --- a/t/t0006-date.sh\n>>> +++ b/t/t0006-date.sh\n>>> @@ -9,7 +9,7 @@ TEST_DATE_NOW=1251660000; export TEST_DATE_NOW\n>>>  check_show() {\n>>>       t=$(($TEST_DATE_NOW - $1))\n>>>       echo \"$t -> $2\" >expect\n>>> -     test_expect_${3:-success} \"relative date ($2)\" \"\n>>> +     test_expect_${3:-success} C_LOCALE_OUTPUT \"relative date ($2)\" \"\n>>>       test-date show $t >actual &&\n>>>       test_cmp expect actual\n>>>       \"\n>>\n>> Could use test_i18ncmp so we catch if test-date crashes, but anyway,\n>> yeah, we can't expect to be able to meaningfully test date formatting\n>> in another language.\n>\n> This reminds me of an inkscape crash I encountered long ago because of\n> a mistake in Vietnamese translation. Too bad we can't test all locales\n> for similar bugs (or we would need to i18n-ize expected results in the\n> test suite too)\n\nWhat if we allow to run the test suite in non-C locales and skip the\ntests that require C_LOCALE_OUTPUT? In non-C locales, we won't set\nC_LOCALE_OUTPUT prerequisite. This allows to test a localized git with\n~90% of the test suite. Would it work?\n-- \nDuy\n"},{"id":"194204","messageId":"20120625115317.GC9270@burratino","threadId":"30885","inReplyTo":"CACsJy8BMizkU+P6VPhkbY_q2tYY5=aY-GNHeDjBYN9-zg2nENQ@mail.gmail.com","subject":"Re: [PATCH 2/2] Add C_LOCALE_OUTPUT prereq to test cases that require English text matching","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2012-06-25T11:53:17Z","receivedAt":"2012-06-25T11:53:17Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Nguyen Thai Ngoc Duy wrote:\n\n> What if we allow to run the test suite in non-C locales and skip the\n> tests that require C_LOCALE_OUTPUT? In non-C locales, we won't set\n> C_LOCALE_OUTPUT prerequisite. This allows to test a localized git with\n> ~90% of the test suite. Would it work?\n\nYes, of course, modulo bugs. :)  I guess one thing to watch out for\nwould be assumptions about non-git utilities in the test suite --- for\nexample, some commands such as \"sed\" have a different idea of what a\ncharacter is in other locales.  But the main ingredient needed is just\nUI (a test option or envvar).\n"}]}