{"thread":{"id":"31367","subject":"[PATCH v3 0/7] Gettext poison fixes","startedAt":"2012-08-27T22:59:10Z","lastAt":"2012-08-27T22:59:17Z","messageCount":8,"participants":["Jiang Xin"],"isPatch":true,"patchVersion":3,"patchTotal":7},"messages":[{"id":"197939","messageId":"cover.1346108242.git.worldhello.net@gmail.com","threadId":"31367","inReplyTo":null,"subject":"[PATCH v3 0/7] Gettext poison fixes","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-08-27T22:59:10Z","receivedAt":"2012-08-27T22:59:10Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"With this series, the test suite should pass again with gettext\npoison on.\n\nUpdates in v3:\n * patch 1/7: fix typo in commit log message.\n * patch 6/7: remove tailing '&&'.\n\nJiang Xin (7):\n  Fix tests under GETTEXT_POISON on relative dates\n  Fix tests under GETTEXT_POISON on git-stash\n  Fix tests under GETTEXT_POISON on diffstat\n  Fix tests under GETTEXT_POISON on git-apply\n  Fix tests under GETTEXT_POISON on pack-object\n  Fix tests under GETTEXT_POISON on git-remote\n  Fix tests under GETTEXT_POISON on parseopt\n\n t/t0006-date.sh                 |  2 +-\n t/t0040-parse-options.sh        | 34 +++++++++++++++++++++++++++++-----\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/t3903-stash.sh                |  2 +-\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      |  4 ++--\n t/t4200-rerere.sh               |  4 ++--\n t/t4202-log.sh                  |  2 +-\n t/t4205-log-pretty-formats.sh   |  4 ++--\n t/t5300-pack-object.sh          |  4 ++--\n t/t5505-remote.sh               | 28 +++++++++++++++++-----------\n t/t5530-upload-pack-error.sh    |  4 ++--\n t/t6500-gc.sh                   |  4 ++--\n t/t7508-status.sh               |  2 +-\n t/t7600-merge.sh                |  2 +-\n 23 files changed, 83 insertions(+), 53 deletions(-)\n\n-- \n1.7.12.92.g949df84\n"},{"id":"197941","messageId":"1954d94a032f1cedee953a7db5da8f6d37e4c7d9.1346108242.git.worldhello.net@gmail.com","threadId":"31367","inReplyTo":"cover.1346108242.git.worldhello.net@gmail.com","subject":"[PATCH v3 1/7] Fix tests under GETTEXT_POISON on relative dates","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-08-27T22:59:11Z","receivedAt":"2012-08-27T22:59:11Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Use a i18n-specific test_i18ncmp in t/t0006-date.sh for relative dates\ntests. This issue was was introduced in v1.7.10-230-g7d29a:\n\n    7d29a i18n: mark relative dates for translation\n\nand been broken under GETTEXT_POISON=YesPlease since.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n t/t0006-date.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t0006-date.sh b/t/t0006-date.sh\nindex 1d29..e53cf 100755\n--- a/t/t0006-date.sh\n+++ b/t/t0006-date.sh\n@@ -11,7 +11,7 @@ check_show() {\n \techo \"$t -> $2\" >expect\n \ttest_expect_${3:-success} \"relative date ($2)\" \"\n \ttest-date show $t >actual &&\n-\ttest_cmp expect actual\n+\ttest_i18ncmp expect actual\n \t\"\n }\n \n-- \n1.7.12.92.g949df84\n"},{"id":"197940","messageId":"4e2f6d25bc4588f478bb3b6866290f2feabc03d0.1346108242.git.worldhello.net@gmail.com","threadId":"31367","inReplyTo":"1954d94a032f1cedee953a7db5da8f6d37e4c7d9.1346108242.git.worldhello.net@gmail.com","subject":"[PATCH v3 2/7] Fix tests under GETTEXT_POISON on git-stash","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-08-27T22:59:12Z","receivedAt":"2012-08-27T22:59:12Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Use i18n-specific test functions in test scripts for git-stash.\nThis issue was was introduced in v1.7.4.1-119-g355ec:\n\n    355ec i18n: git-status basic messages\n\nand been broken under GETTEXT_POISON=YesPlease since.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n t/t3903-stash.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex cd0426..5dfbd 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -610,7 +610,7 @@ test_expect_success 'stash apply shows status same as git status (relative to cu\n \t\tgit stash apply\n \t) |\n \tsed -e 1,2d >actual && # drop \"Saved...\" and \"HEAD is now...\"\n-\ttest_cmp expect actual\n+\ttest_i18ncmp expect actual\n '\n \n cat > expect << EOF\n-- \n1.7.12.92.g949df84\n"},{"id":"197944","messageId":"19564c3c4288172ab1cf2c7097a750f5689faba8.1346108242.git.worldhello.net@gmail.com","threadId":"31367","inReplyTo":"4e2f6d25bc4588f478bb3b6866290f2feabc03d0.1346108242.git.worldhello.net@gmail.com","subject":"[PATCH v3 3/7] Fix tests under GETTEXT_POISON on diffstat","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-08-27T22:59:13Z","receivedAt":"2012-08-27T22:59:13Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Use i18n-specific test functions in test scripts for diffstat.\nThis issue was was introduced in v1.7.9-1-g7f814:\n\n    7f814 Use correct grammar in diffstat summary line\n\nand been broken under GETTEXT_POISON=YesPlease since.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n t/t4006-diff-mode.sh          | 8 ++++----\n t/t4202-log.sh                | 2 +-\n t/t4205-log-pretty-formats.sh | 4 ++--\n t/t7508-status.sh             | 2 +-\n 4 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh\nindex 7a3e1..3d4b1 100755\n--- a/t/t4006-diff-mode.sh\n+++ b/t/t4006-diff-mode.sh\n@@ -36,24 +36,24 @@ test_expect_success '--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+\ttest_i18ncmp expect actual\n '\n \n test_expect_success '--shortstat output after text chmod' '\n \tgit diff HEAD --shortstat >actual &&\n-\ttest_cmp expect actual\n+\ttest_i18ncmp expect actual\n '\n \n test_expect_success '--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+\ttest_i18ncmp expect actual\n '\n \n test_expect_success '--shortstat output after binary chmod' '\n \tgit diff HEAD --shortstat >actual &&\n-\ttest_cmp expect actual\n+\ttest_i18ncmp expect actual\n '\n \n test_done\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 71be5..31869 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -803,7 +803,7 @@ sanitize_output () {\n test_expect_success '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\n+\ttest_i18ncmp expect actual.sanitized\n '\n \n test_done\ndiff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh\nindex 4afd77..2c45d 100755\n--- a/t/t4205-log-pretty-formats.sh\n+++ b/t/t4205-log-pretty-formats.sh\n@@ -88,7 +88,7 @@ test_expect_success 'NUL separation with --stat' '\n \tstat1_part=$(git diff --stat --root HEAD^) &&\n \tprintf \"add bar\\n$stat0_part\\n\\0initial\\n$stat1_part\\n\" >expected &&\n \tgit log -z --stat --pretty=\"format:%s\" >actual &&\n-\ttest_cmp expected actual\n+\ttest_i18ncmp expected actual\n '\n \n test_expect_failure 'NUL termination with --stat' '\n@@ -96,7 +96,7 @@ test_expect_failure 'NUL termination with --stat' '\n \tstat1_part=$(git diff --stat --root HEAD^) &&\n \tprintf \"add bar\\n$stat0_part\\n\\0initial\\n$stat1_part\\n\\0\" >expected &&\n \tgit log -z --stat --pretty=\"tformat:%s\" >actual &&\n-\ttest_cmp expected actual\n+\ttest_i18ncmp expected actual\n '\n \n test_done\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex c206f..e313e 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -80,7 +80,7 @@ test_expect_success 'status --column' '\n #\tdir1/untracked dir2/untracked untracked\n #\tdir2/modified  output\n EOF\n-\ttest_cmp expect output\n+\ttest_i18ncmp expect output\n '\n \n cat >expect <<\\EOF\n-- \n1.7.12.92.g949df84\n"},{"id":"197943","messageId":"c7c8ebb234e8bd0771cfd7d2f715f06d86e5c472.1346108242.git.worldhello.net@gmail.com","threadId":"31367","inReplyTo":"19564c3c4288172ab1cf2c7097a750f5689faba8.1346108242.git.worldhello.net@gmail.com","subject":"[PATCH v3 4/7] Fix tests under GETTEXT_POISON on git-apply","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-08-27T22:59:14Z","receivedAt":"2012-08-27T22:59:14Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Use i18n-specific test functions in test scripts for git-apply.\nThis issue was was introduced in the following commits:\n\n    de373 i18n: apply: mark parseopt strings for translation\n    3638e i18n: apply: mark strings for translation\n\nand been broken under GETTEXT_POISON=YesPlease since.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n t/t4012-diff-binary.sh     | 4 ++--\n t/t4120-apply-popt.sh      | 4 ++--\n t/t4133-apply-filenames.sh | 4 ++--\n 3 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh\nindex ec4de..1215a 100755\n--- a/t/t4012-diff-binary.sh\n+++ b/t/t4012-diff-binary.sh\n@@ -63,7 +63,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 \tgit diff >output &&\n \tsed -e \"s/-CIT/xCIT/\" <output >broken &&\n \ttest_must_fail git apply --stat --summary broken 2>detected &&\n@@ -73,7 +73,7 @@ test_expect_success 'apply detecting corrupt patch correctly' '\n \ttest \"$detected\" = xCIT\n '\n \n-test_expect_success 'apply detecting corrupt patch correctly' '\n+test_expect_success C_LOCALE_OUTPUT 'apply detecting corrupt patch correctly' '\n \tgit diff --binary | sed -e \"s/-CIT/xCIT/\" >broken &&\n \ttest_must_fail git apply --stat --summary broken 2>detected &&\n \tdetected=`cat detected` &&\ndiff --git a/t/t4120-apply-popt.sh b/t/t4120-apply-popt.sh\nindex a33d5..c5fec 100755\n--- a/t/t4120-apply-popt.sh\n+++ b/t/t4120-apply-popt.sh\n@@ -32,7 +32,7 @@ test_expect_success 'apply git diff with -p2' '\n test_expect_success '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+\ttest_i18ngrep \"removing 3 leading\" err\n '\n \n test_expect_success 'apply (-p2) traditional diff with funny filenames' '\n@@ -54,7 +54,7 @@ test_expect_success 'apply (-p2) traditional diff with funny filenames' '\n test_expect_success '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\n+\ttest_i18ngrep \"removing 3 leading\" err\n '\n \n test_expect_success 'apply (-p2) diff, mode change only' '\ndiff --git a/t/t4133-apply-filenames.sh b/t/t4133-apply-filenames.sh\nindex 94da9..2ecb4 100755\n--- a/t/t4133-apply-filenames.sh\n+++ b/t/t4133-apply-filenames.sh\n@@ -30,9 +30,9 @@ EOF\n \n test_expect_success '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_i18ngrep \"inconsistent new filename\" err &&\n \ttest_must_fail git apply bad2.patch 2>err &&\n-\tgrep \"inconsistent old filename\" err\n+\ttest_i18ngrep \"inconsistent old filename\" err\n '\n \n test_done\n-- \n1.7.12.92.g949df84\n"},{"id":"197942","messageId":"c89b2d6f6636e693c27ed52fb57231664a61336b.1346108242.git.worldhello.net@gmail.com","threadId":"31367","inReplyTo":"c7c8ebb234e8bd0771cfd7d2f715f06d86e5c472.1346108242.git.worldhello.net@gmail.com","subject":"[PATCH v3 5/7] Fix tests under GETTEXT_POISON on pack-object","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-08-27T22:59:15Z","receivedAt":"2012-08-27T22:59:15Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Use i18n-specific test functions in test scripts for pack-object.\nThis issue was was introduced in v1.7.10.2-556-g46140:\n\n    46140 index-pack: use streaming interface for collision test on large blobs\n    cf2ba pack-objects: use streaming interface for reading large loose blobs\n\nand been broken under GETTEXT_POISON=YesPlease since.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n t/t5300-pack-object.sh       | 4 ++--\n t/t5530-upload-pack-error.sh | 4 ++--\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex 2e52..a07c8 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -416,11 +416,11 @@ test_expect_success \\\n test_expect_success \\\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+     test_i18ngrep \"SHA1 COLLISION FOUND\" msg'\n \n test_expect_success \\\n     'make sure index-pack detects the SHA1 collision (large blobs)' \\\n     'test_must_fail git -c core.bigfilethreshold=1 index-pack -o bad.idx test-3.pack 2>msg &&\n-     grep \"SHA1 COLLISION FOUND\" msg'\n+     test_i18ngrep \"SHA1 COLLISION FOUND\" msg'\n \n test_done\ndiff --git a/t/t5530-upload-pack-error.sh b/t/t5530-upload-pack-error.sh\nindex 6b2a5f..c983d 100755\n--- a/t/t5530-upload-pack-error.sh\n+++ b/t/t5530-upload-pack-error.sh\n@@ -35,8 +35,8 @@ test_expect_success 'upload-pack fails due to error in pack-objects packing' '\n \tprintf \"0032want %s\\n00000009done\\n0000\" \\\n \t\t$(git rev-parse HEAD) >input &&\n \ttest_must_fail git upload-pack . <input >/dev/null 2>output.err &&\n-\tgrep \"unable to read\" output.err &&\n-\tgrep \"pack-objects died\" output.err\n+\ttest_i18ngrep \"unable to read\" output.err &&\n+\ttest_i18ngrep \"pack-objects died\" output.err\n '\n \n test_expect_success 'corrupt repo differently' '\n-- \n1.7.12.92.g949df84\n"},{"id":"197946","messageId":"89668a45ea6ffe2a537dc6116062d5994252534d.1346108242.git.worldhello.net@gmail.com","threadId":"31367","inReplyTo":"c89b2d6f6636e693c27ed52fb57231664a61336b.1346108242.git.worldhello.net@gmail.com","subject":"[PATCH v3 6/7] Fix tests under GETTEXT_POISON on git-remote","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-08-27T22:59:16Z","receivedAt":"2012-08-27T22:59:16Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Use i18n-specific test functions in test scripts for git-remote, and\nbypass some testcases using C_LOCALE_OUTPUT prereq flag. This issue\nwas was introduced in v1.7.10-233-gbb16d5:\n\n    bb16d5 i18n: remote: mark strings for translation\n\nand been broken under GETTEXT_POISON=YesPlease since.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n t/t5505-remote.sh | 28 +++++++++++++++++-----------\n 1 file changed, 17 insertions(+), 11 deletions(-)\n\ndiff --git a/t/t5505-remote.sh b/t/t5505-remote.sh\nindex e8af6..4b720 100755\n--- a/t/t5505-remote.sh\n+++ b/t/t5505-remote.sh\n@@ -52,7 +52,7 @@ test_expect_success setup '\n \n '\n \n-test_expect_success 'remote information for the origin' '\n+test_expect_success C_LOCALE_OUTPUT 'remote information for the origin' '\n (\n \tcd test &&\n \ttokens_match origin \"$(git remote)\" &&\n@@ -66,8 +66,6 @@ test_expect_success 'add another remote' '\n \tcd test &&\n \tgit remote add -f second ../two &&\n \ttokens_match \"origin second\" \"$(git remote)\" &&\n-\tcheck_remote_track origin master side &&\n-\tcheck_remote_track second master side another &&\n \tcheck_tracking_branch second master side another &&\n \tgit for-each-ref \"--format=%(refname)\" refs/remotes |\n \tsed -e \"/^refs\\/remotes\\/origin\\//d\" \\\n@@ -77,6 +75,14 @@ test_expect_success 'add another remote' '\n )\n '\n \n+test_expect_success C_LOCALE_OUTPUT 'check tracking for add another remote' '\n+(\n+\tcd test &&\n+\tcheck_remote_track origin master side &&\n+\tcheck_remote_track second master side another\n+)\n+'\n+\n test_expect_success 'remote forces tracking branches' '\n (\n \tcd test &&\n@@ -95,7 +101,7 @@ test_expect_success 'remove remote' '\n )\n '\n \n-test_expect_success 'remove remote' '\n+test_expect_success C_LOCALE_OUTPUT 'remove remote' '\n (\n \tcd test &&\n \ttokens_match origin \"$(git remote)\" &&\n@@ -131,8 +137,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 +198,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 +223,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 +261,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 +291,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@@ -705,7 +711,7 @@ test_expect_success 'remote prune to cause a dangling symref' '\n \t\tcd seven &&\n \t\tgit remote prune origin\n \t) >err 2>&1 &&\n-\tgrep \"has become dangling\" err &&\n+\ttest_i18ngrep \"has become dangling\" err &&\n \n \t: And the dangling symref will not cause other annoying errors &&\n \t(\n-- \n1.7.12.92.g949df84\n"},{"id":"197945","messageId":"57696d32bf6b3223067180f6b99f421060af3c2b.1346108242.git.worldhello.net@gmail.com","threadId":"31367","inReplyTo":"89668a45ea6ffe2a537dc6116062d5994252534d.1346108242.git.worldhello.net@gmail.com","subject":"[PATCH v3 7/7] Fix tests under GETTEXT_POISON on parseopt","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-08-27T22:59:17Z","receivedAt":"2012-08-27T22:59:17Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Use i18n-specific test functions in test scripts for parseopt tests.\nThis issue was was introduced in v1.7.10.1-488-g54e6d:\n\n    54e6d i18n: parseopt: lookup help and argument translations when showing usage\n\nand been broken under GETTEXT_POISON=YesPlease since.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n t/t0040-parse-options.sh        | 34 +++++++++++++++++++++++++++++-----\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/t4200-rerere.sh               |  4 ++--\n t/t6500-gc.sh                   |  4 ++--\n t/t7600-merge.sh                |  2 +-\n 11 files changed, 46 insertions(+), 22 deletions(-)\n\ndiff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh\nindex e3f35..244a4 100755\n--- a/t/t0040-parse-options.sh\n+++ b/t/t0040-parse-options.sh\n@@ -51,7 +51,7 @@ EOF\n test_expect_success '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+\ttest_i18ncmp expect output\n '\n \n mv expect expect.err\n@@ -79,6 +79,17 @@ check() {\n \ttest_cmp expect output\n }\n \n+check_i18n() {\n+\twhat=\"$1\" &&\n+\tshift &&\n+\texpect=\"$1\" &&\n+\tshift &&\n+\tsed \"s/^$what .*/$what $expect/\" <expect.template >expect &&\n+\ttest-parse-options $* >output 2>output.err &&\n+\ttest ! -s output.err &&\n+\ttest_i18ncmp expect output\n+}\n+\n check_unknown() {\n \tcase \"$1\" in\n \t--*)\n@@ -92,6 +103,19 @@ check_unknown() {\n \ttest_cmp expect output.err\n }\n \n+check_unknown_i18n() {\n+\tcase \"$1\" in\n+\t--*)\n+\t\techo error: unknown option \\`${1#--}\\' >expect ;;\n+\t-*)\n+\t\techo error: unknown switch \\`${1#-}\\' >expect ;;\n+\tesac &&\n+\tcat expect.err >>expect &&\n+\ttest_must_fail test-parse-options $* >output 2>output.err &&\n+\ttest ! -s output &&\n+\ttest_i18ncmp expect output.err\n+}\n+\n test_expect_success 'OPT_BOOL() #1' 'check boolean: 1 --yes'\n test_expect_success 'OPT_BOOL() #2' 'check boolean: 1 --no-doubt'\n test_expect_success 'OPT_BOOL() #3' 'check boolean: 1 -D'\n@@ -104,8 +128,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 'OPT_BOOL() no negation #1' 'check_unknown_i18n --fear'\n+test_expect_success 'OPT_BOOL() no negation #2' 'check_unknown_i18n --no-no-fear'\n \n test_expect_success 'OPT_BOOL() positivation' 'check boolean: 0 -D --doubt'\n \n@@ -310,8 +334,8 @@ EOF\n \n test_expect_success '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+\ttest_i18ncmp expect output &&\n+\ttest_i18ncmp expect.err output.err\n '\n \n cat > expect <<EOF\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex a477..e127f 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -391,7 +391,7 @@ test_expect_success 'get bool variable with empty value' \\\n \n test_expect_success 'no arguments, but no crash' '\n \ttest_must_fail git config >output 2>&1 &&\n-\tgrep usage output\n+\ttest_i18ngrep usage output\n '\n \n cat > .git/config << EOF\ndiff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh\nindex 1efd7..13c88 100755\n--- a/t/t1502-rev-parse-parseopt.sh\n+++ b/t/t1502-rev-parse-parseopt.sh\n@@ -41,7 +41,7 @@ EOF\n \n test_expect_success 'test --parseopt help output' '\n \ttest_expect_code 129 git rev-parse --parseopt -- -h > output < optionspec &&\n-\ttest_cmp expect output\n+\ttest_i18ncmp expect output\n '\n \n cat > expect <<EOF\ndiff --git a/t/t2006-checkout-index-basic.sh b/t/t2006-checkout-index-basic.sh\nindex b855..57cbd 100755\n--- a/t/t2006-checkout-index-basic.sh\n+++ b/t/t2006-checkout-index-basic.sh\n@@ -7,7 +7,7 @@ test_description='basic checkout-index tests\n \n test_expect_success 'checkout-index --gobbledegook' '\n \ttest_expect_code 129 git checkout-index --gobbledegook 2>err &&\n-\tgrep \"[Uu]sage\" err\n+\ttest_i18ngrep \"[Uu]sage\" err\n '\n \n test_expect_success 'checkout-index -h in broken repository' '\n@@ -18,7 +18,7 @@ test_expect_success 'checkout-index -h in broken repository' '\n \t\t>.git/index &&\n \t\ttest_expect_code 129 git checkout-index -h >usage 2>&1\n \t) &&\n-\tgrep \"[Uu]sage\" broken/usage\n+\ttest_i18ngrep \"[Uu]sage\" broken/usage\n '\n \n test_done\ndiff --git a/t/t2107-update-index-basic.sh b/t/t2107-update-index-basic.sh\nindex 809fa..17d69 100755\n--- a/t/t2107-update-index-basic.sh\n+++ b/t/t2107-update-index-basic.sh\n@@ -15,7 +15,7 @@ test_expect_success 'update-index --nonsense fails' '\n \n test_expect_success '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+\ttest_i18ngrep \"[Uu]sage: git update-index\" err\n '\n \n test_expect_success 'update-index -h with corrupt index' '\n@@ -26,7 +26,7 @@ test_expect_success 'update-index -h with corrupt index' '\n \t\t>.git/index &&\n \t\ttest_expect_code 129 git update-index -h >usage 2>&1\n \t) &&\n-\tgrep \"[Uu]sage: git update-index\" broken/usage\n+\ttest_i18ngrep \"[Uu]sage: git update-index\" broken/usage\n '\n \n test_done\ndiff --git a/t/t3004-ls-files-basic.sh b/t/t3004-ls-files-basic.sh\nindex 490e05..8d9bc 100755\n--- a/t/t3004-ls-files-basic.sh\n+++ b/t/t3004-ls-files-basic.sh\n@@ -22,7 +22,7 @@ test_expect_success 'ls-files with nonexistent path' '\n \n test_expect_success '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+\ttest_i18ngrep \"[Uu]sage: git ls-files\" actual\n '\n \n test_expect_success 'ls-files -h in corrupt repository' '\n@@ -33,7 +33,7 @@ test_expect_success 'ls-files -h in corrupt repository' '\n \t\t>.git/index &&\n \t\ttest_expect_code 129 git ls-files -h >usage 2>&1\n \t) &&\n-\tgrep \"[Uu]sage: git ls-files \" broken/usage\n+\ttest_i18ngrep \"[Uu]sage: git ls-files \" broken/usage\n '\n \n test_done\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex a17f8..1ffce 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -31,7 +31,7 @@ test_expect_success 'branch -h in broken repository' '\n \t\t>.git/refs/heads/master &&\n \t\ttest_expect_code 129 git branch -h >usage 2>&1\n \t) &&\n-\tgrep \"[Uu]sage\" broken/usage\n+\ttest_i18ngrep \"[Uu]sage\" broken/usage\n '\n \n test_expect_success \\\n@@ -74,7 +74,7 @@ test_expect_success \\\n test_expect_success \\\n     'git branch -m dumps usage' \\\n        'test_expect_code 129 git branch -m 2>err &&\n-\tgrep \"[Uu]sage: git branch\" err'\n+\ttest_i18ngrep \"[Uu]sage: git branch\" err'\n \n test_expect_success \\\n     'git branch -m m m/m should work' \\\ndiff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh\nindex 595d2..34c86e 100755\n--- a/t/t3501-revert-cherry-pick.sh\n+++ b/t/t3501-revert-cherry-pick.sh\n@@ -47,7 +47,7 @@ test_expect_success 'cherry-pick --nonsense' '\n \tgit diff --exit-code HEAD &&\n \ttest_must_fail git cherry-pick --nonsense 2>msg &&\n \tgit diff --exit-code HEAD \"$pos\" &&\n-\tgrep '[Uu]sage:' msg\n+\ttest_i18ngrep '[Uu]sage:' msg\n '\n \n test_expect_success 'revert --nonsense' '\n@@ -56,7 +56,7 @@ test_expect_success 'revert --nonsense' '\n \tgit diff --exit-code HEAD &&\n \ttest_must_fail git revert --nonsense 2>msg &&\n \tgit diff --exit-code HEAD \"$pos\" &&\n-\tgrep '[Uu]sage:' msg\n+\ttest_i18ngrep '[Uu]sage:' msg\n '\n \n test_expect_success 'cherry-pick after renaming branch' '\ndiff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh\nindex 3ab67..7f666 100755\n--- a/t/t4200-rerere.sh\n+++ b/t/t4200-rerere.sh\n@@ -382,13 +382,13 @@ test_expect_success 'rerere --no-no-rerere-autoupdate' '\n \tgit update-index --index-info <failedmerge &&\n \tcp file3.conflict file3 &&\n \ttest_must_fail git rerere --no-no-rerere-autoupdate 2>err &&\n-\tgrep [Uu]sage err &&\n+\ttest_i18ngrep [Uu]sage err &&\n \ttest_must_fail git update-index --refresh\n '\n \n test_expect_success 'rerere -h' '\n \ttest_must_fail git rerere -h >help &&\n-\tgrep [Uu]sage help\n+\ttest_i18ngrep [Uu]sage help\n '\n \n test_done\ndiff --git a/t/t6500-gc.sh b/t/t6500-gc.sh\nindex 82f36..b1a63 100755\n--- a/t/t6500-gc.sh\n+++ b/t/t6500-gc.sh\n@@ -11,7 +11,7 @@ test_expect_success 'gc empty repository' '\n \n test_expect_success 'gc --gobbledegook' '\n \ttest_expect_code 129 git gc --nonsense 2>err &&\n-\tgrep \"[Uu]sage: git gc\" err\n+\ttest_i18ngrep \"[Uu]sage: git gc\" err\n '\n \n test_expect_success 'gc -h with invalid configuration' '\n@@ -22,7 +22,7 @@ test_expect_success 'gc -h with invalid configuration' '\n \t\techo \"[gc] pruneexpire = CORRUPT\" >>.git/config &&\n \t\ttest_expect_code 129 git gc -h >usage 2>&1\n \t) &&\n-\tgrep \"[Uu]sage\" broken/usage\n+\ttest_i18ngrep \"[Uu]sage\" broken/usage\n '\n \n test_done\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex 9e27b..5e195 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -157,7 +157,7 @@ test_expect_success 'merge -h with invalid index' '\n \t\t>.git/index &&\n \t\ttest_expect_code 129 git merge -h 2>usage\n \t) &&\n-\tgrep \"[Uu]sage: git merge\" broken/usage\n+\ttest_i18ngrep \"[Uu]sage: git merge\" broken/usage\n '\n \n test_expect_success 'reject non-strategy with a git-merge-foo name' '\n-- \n1.7.12.92.g949df84\n"}]}