Gettext poison fixes
cover Gettext poison fixes
Not much to say. With this series, the test suite should pass again with gettext poison on. It's independent with the parseopt-i18n series I sent yesterday as the test suite was broken even before.
Jiang Xin (7):
Fix tests under GETTEXT_POISON on relative dates Fix tests under GETTEXT_POISON on git-stash Fix tests under GETTEXT_POISON on diffstat Fix tests under GETTEXT_POISON on git-apply Fix tests under GETTEXT_POISON on pack-object Fix tests under GETTEXT_POISON on git-remote Fix tests under GETTEXT_POISON on parseopt
t/t0006-date.sh | 2 +- t/t0040-parse-options.sh | 34 +++++++++++++++++++++++++++++----- t/t1300-repo-config.sh | 2 +- t/t1502-rev-parse-parseopt.sh | 2 +- t/t2006-checkout-index-basic.sh | 4 ++-- t/t2107-update-index-basic.sh | 4 ++-- t/t3004-ls-files-basic.sh | 4 ++-- t/t3200-branch.sh | 4 ++-- t/t3501-revert-cherry-pick.sh | 4 ++-- t/t3903-stash.sh | 2 +- t/t4006-diff-mode.sh | 8 ++++---- t/t4012-diff-binary.sh | 4 ++-- t/t4120-apply-popt.sh | 4 ++-- t/t4133-apply-filenames.sh | 4 ++-- t/t4200-rerere.sh | 4 ++-- t/t4202-log.sh | 2 +- t/t4205-log-pretty-formats.sh | 4 ++-- t/t5300-pack-object.sh | 4 ++-- t/t5505-remote.sh | 22 ++++++++++++++-------- t/t5530-upload-pack-error.sh | 2 +- t/t6500-gc.sh | 4 ++-- t/t7508-status.sh | 2 +- t/t7600-merge.sh | 2 +- 23 files changed, 79 insertions(+), 49 deletions(-)
Signature · 1 line
1.7.12.rc2
PATCH 1/7 Fix tests under GETTEXT_POISON on relative dates
From: Jiang Xin <[email protected]>
Use a i18n-specific test_i18ncmp in t/t0006-data.sh for relative dates tests. This issue was was introduced in v1.7.10-230-g7d29a:
7d29a i18n: mark relative dates for translation
and been broken under GETTEXT_POISON=YesPlease since.
--- t/t0006-date.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
t/t0006-date.sh +1 -1
@@ -11,7 +11,7 @@ check_show() { echo "$t -> $2" >expect test_expect_${3:-success} "relative date ($2)" " test-date show $t >actual && - test_cmp expect actual + test_i18ncmp expect actual " }
Signature · 1 line
1.7.12.rc2
PATCH 2/7 Fix tests under GETTEXT_POISON on git-stash
In reply to Nguyễn Thái Ngọc DuyFrom: Jiang Xin <[email protected]>
Use i18n-specific test functions in test scripts for git-stash. This issue was was introduced in v1.7.4.1-119-g355ec:
355ec i18n: git-status basic messages
and been broken under GETTEXT_POISON=YesPlease since.
--- t/t3903-stash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
t/t3903-stash.sh +1 -1
@@ -610,7 +610,7 @@ test_expect_success 'stash apply shows status same as git status (relative to cu git stash apply ) | sed -e 1,2d >actual && # drop "Saved..." and "HEAD is now..." - test_cmp expect actual + test_i18ncmp expect actual ' cat > expect << EOF
Signature · 1 line
1.7.12.rc2
PATCH 3/7 Fix tests under GETTEXT_POISON on diffstat
In reply to Nguyễn Thái Ngọc DuyFrom: Jiang Xin <[email protected]>
Use i18n-specific test functions in test scripts for diffstat. This issue was was introduced in v1.7.9-1-g7f814:
7f814 Use correct grammar in diffstat summary line
and been broken under GETTEXT_POISON=YesPlease since.
--- t/t4006-diff-mode.sh | 8 ++++---- t/t4202-log.sh | 2 +- t/t4205-log-pretty-formats.sh | 4 ++-- t/t7508-status.sh | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)
t/t4006-diff-mode.sh +4 -4
@@ -36,24 +36,24 @@ test_expect_success '--stat output after text chmod' ' test_chmod -x rezrov && echo " 0 files changed" >expect && git diff HEAD --stat >actual && - test_cmp expect actual + test_i18ncmp expect actual ' test_expect_success '--shortstat output after text chmod' ' git diff HEAD --shortstat >actual && - test_cmp expect actual + test_i18ncmp expect actual ' test_expect_success '--stat output after binary chmod' ' test_chmod +x binbin && echo " 0 files changed" >expect && git diff HEAD --stat >actual && - test_cmp expect actual + test_i18ncmp expect actual ' test_expect_success '--shortstat output after binary chmod' ' git diff HEAD --shortstat >actual && - test_cmp expect actual + test_i18ncmp expect actual ' test_done
t/t4202-log.sh +1 -1
@@ -803,7 +803,7 @@ sanitize_output () { test_expect_success 'log --graph with diff and stats' ' git log --graph --pretty=short --stat -p >actual && sanitize_output >actual.sanitized <actual && - test_cmp expect actual.sanitized + test_i18ncmp expect actual.sanitized ' test_done
t/t4205-log-pretty-formats.sh +2 -2
@@ -88,7 +88,7 @@ test_expect_success 'NUL separation with --stat' ' stat1_part=$(git diff --stat --root HEAD^) && printf "add bar\n$stat0_part\n\0initial\n$stat1_part\n" >expected && git log -z --stat --pretty="format:%s" >actual && - test_cmp expected actual + test_i18ncmp expected actual ' test_expect_failure 'NUL termination with --stat' '
@@ -96,7 +96,7 @@ test_expect_failure 'NUL termination with --stat' ' stat1_part=$(git diff --stat --root HEAD^) && printf "add bar\n$stat0_part\n\0initial\n$stat1_part\n\0" >expected && git log -z --stat --pretty="tformat:%s" >actual && - test_cmp expected actual + test_i18ncmp expected actual ' test_done
t/t7508-status.sh +1 -1
@@ -80,7 +80,7 @@ test_expect_success 'status --column' ' # dir1/untracked dir2/untracked untracked # dir2/modified output EOF - test_cmp expect output + test_i18ncmp expect output ' cat >expect <<\EOF
Signature · 1 line
1.7.12.rc2
PATCH 4/7 Fix tests under GETTEXT_POISON on git-apply
In reply to Nguyễn Thái Ngọc DuyFrom: Jiang Xin <[email protected]>
Use i18n-specific test functions in test scripts for git-apply. This issue was was introduced in the following commits:
de373 i18n: apply: mark parseopt strings for translation 3638e i18n: apply: mark strings for translation
and been broken under GETTEXT_POISON=YesPlease since.
--- t/t4012-diff-binary.sh | 4 ++-- t/t4120-apply-popt.sh | 4 ++-- t/t4133-apply-filenames.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
t/t4012-diff-binary.sh +2 -2
@@ -63,7 +63,7 @@ test_expect_success 'apply --numstat understands diff --binary format' ' # apply needs to be able to skip the binary material correctly # in order to report the line number of a corrupt patch. -test_expect_success 'apply detecting corrupt patch correctly' ' +test_expect_success C_LOCALE_OUTPUT 'apply detecting corrupt patch correctly' ' git diff >output && sed -e "s/-CIT/xCIT/" <output >broken && test_must_fail git apply --stat --summary broken 2>detected &&
@@ -73,7 +73,7 @@ test_expect_success 'apply detecting corrupt patch correctly' ' test "$detected" = xCIT ' -test_expect_success 'apply detecting corrupt patch correctly' ' +test_expect_success C_LOCALE_OUTPUT 'apply detecting corrupt patch correctly' ' git diff --binary | sed -e "s/-CIT/xCIT/" >broken && test_must_fail git apply --stat --summary broken 2>detected && detected=`cat detected` &&
t/t4120-apply-popt.sh +2 -2
@@ -32,7 +32,7 @@ test_expect_success 'apply git diff with -p2' ' test_expect_success 'apply with too large -p' ' cp file1.saved file1 && test_must_fail git apply --stat -p3 patch.file 2>err && - grep "removing 3 leading" err + test_i18ngrep "removing 3 leading" err ' test_expect_success 'apply (-p2) traditional diff with funny filenames' '
@@ -54,7 +54,7 @@ test_expect_success 'apply (-p2) traditional diff with funny filenames' ' test_expect_success 'apply with too large -p and fancy filename' ' cp file1.saved file1 && test_must_fail git apply --stat -p3 patch.escaped 2>err && - grep "removing 3 leading" err + test_i18ngrep "removing 3 leading" err ' test_expect_success 'apply (-p2) diff, mode change only' '
t/t4133-apply-filenames.sh +2 -2
@@ -30,9 +30,9 @@ EOF test_expect_success 'apply diff with inconsistent filenames in headers' ' test_must_fail git apply bad1.patch 2>err && - grep "inconsistent new filename" err && + test_i18ngrep "inconsistent new filename" err && test_must_fail git apply bad2.patch 2>err && - grep "inconsistent old filename" err + test_i18ngrep "inconsistent old filename" err ' test_done
Signature · 1 line
1.7.12.rc2
PATCH 5/7 Fix tests under GETTEXT_POISON on pack-object
In reply to Nguyễn Thái Ngọc DuyFrom: Jiang Xin <[email protected]>
Use i18n-specific test functions in test scripts for pack-object. This issue was was introduced in v1.7.10.2-556-g46140:
46140 index-pack: use streaming interface for collision test on large blobs cf2ba pack-objects: use streaming interface for reading large loose blobs
and been broken under GETTEXT_POISON=YesPlease since.
--- t/t5300-pack-object.sh | 4 ++-- t/t5530-upload-pack-error.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
t/t5300-pack-object.sh +2 -2
@@ -416,11 +416,11 @@ test_expect_success \ test_expect_success \ 'make sure index-pack detects the SHA1 collision' \ 'test_must_fail git index-pack -o bad.idx test-3.pack 2>msg && - grep "SHA1 COLLISION FOUND" msg' + test_i18ngrep "SHA1 COLLISION FOUND" msg' test_expect_success \ 'make sure index-pack detects the SHA1 collision (large blobs)' \ 'test_must_fail git -c core.bigfilethreshold=1 index-pack -o bad.idx test-3.pack 2>msg && - grep "SHA1 COLLISION FOUND" msg' + test_i18ngrep "SHA1 COLLISION FOUND" msg' test_done
t/t5530-upload-pack-error.sh +1 -1
@@ -35,7 +35,7 @@ test_expect_success 'upload-pack fails due to error in pack-objects packing' ' printf "0032want %s\n00000009done\n0000" \ $(git rev-parse HEAD) >input && test_must_fail git upload-pack . <input >/dev/null 2>output.err && - grep "unable to read" output.err && + test_i18ngrep "unable to read" output.err && grep "pack-objects died" output.err '
Signature · 1 line
1.7.12.rc2
Re: [PATCH 5/7] Fix tests under GETTEXT_POISON on pack-object
Hi,
Quoted 3 lines · Nguyễn Thái Ngọc Duy
From: Jiang Xin <[email protected]>
Use i18n-specific test functions in test scripts for pack-object.
Thanks for resending, and sorry I haven't made time to polish the translation-based poison implementation you sent before (which seemed very useful and pleasant to work with).
[...]
t/t5530-upload-pack-error.sh test_expect_success 'upload-pack fails due to error in pack-objects packing' ' · line 39
Quoted 9 lines
t/t5530-upload-pack-error.sh +1
-1@@ -35,7 +35,7 @@ test_expect_success 'upload-pack fails due to error in pack-objects packing' ' printf "0032want %s\n00000009done\n0000" \ $(git rev-parse HEAD) >input && test_must_fail git upload-pack . <input >/dev/null 2>output.err && - grep "unable to read" output.err && + test_i18ngrep "unable to read" output.err && grep "pack-objects died" output.err
Wouldn't it make sense to change the second "grep" of output intended for humans to test_i18ngrep while at it?
With or without that change, this and the rest of the series looks good.
Hope that helps,
Jonathan
Re: [PATCH 5/7] Fix tests under GETTEXT_POISON on pack-object
Quoted 4 lines · Jonathan Nieder
Quoted 4 lines
t/t5530-upload-pack-error.sh +0
-0@@ -35,7 +35,7 @@ test_expect_success 'upload-pack fails due to error in pack-objects packing' ' printf "0032want %s\n00000009done\n0000" \
Quoted 8 lines
t/t5530-upload-pack-error.sh test_expect_success 'upload-pack fails due to error in pack-objects packing' ' · line 39
Quoted 5 lines
t/t5530-upload-pack-error.sh +1
-1$(git rev-parse HEAD) >input && test_must_fail git upload-pack . <input >/dev/null 2>output.err && - grep "unable to read" output.err && + test_i18ngrep "unable to read" output.err && grep "pack-objects died" output.errWouldn't it make sense to change the second "grep" of output intended for humans to
test_i18ngrepwhile at it?
This comes from error("git upload-pack: git-pack-objects died with error.") in unpack-trees.c, which is not i18n-ized yet. There's another test in t5530 that does the same grep. I think we should leave it as is until we mark the string for translation, then gettext poison will spot it (verified) and we can fix it.
Signature · 1 line
Duy
Re: [PATCH 5/7] Fix tests under GETTEXT_POISON on pack-object
Quoted 13 lines · Nguyen Thai Ngoc Duy
Quoted 10 lines · Jonathan Nieder
t/t5530-upload-pack-error.sh test_expect_success 'upload-pack fails due to error in pack-objects packing' ' · line 39
Quoted 7 lines
t/t5530-upload-pack-error.sh +1
-1@@ -35,7 +35,7 @@ test_expect_success 'upload-pack fails due to error in pack-objects packing' ' printf "0032want %s\n00000009done\n0000" \ $(git rev-parse HEAD) >input && test_must_fail git upload-pack . <input >/dev/null 2>output.err && - grep "unable to read" output.err && + test_i18ngrep "unable to read" output.err && grep "pack-objects died" output.errWouldn't it make sense to change the second "grep" of output intended for humans to
test_i18ngrepwhile at it?
Quoted 5 lines
This comes from
error("git upload-pack: git-pack-objects died with error.")inunpack-trees.c, which is not i18n-ized yet. There's another test in t5530 that does the same grep. I think we should leave it as is until we mark the string for translation, then gettext poison will spot it (verified) and we can fix it.
I don't understand the distinction you're making. Isn't the message intended for humans, and wouldn't changing that one line to test_i18ngrep now save trouble later? Tests are meant to check git's intended behavior, not to exactly match its current behavior.
Jonathan
Re: [PATCH 5/7] Fix tests under GETTEXT_POISON on pack-object
Quoted 20 lines · Jonathan Nieder
Quoted 13 lines · Nguyen Thai Ngoc Duy
Quoted 10 lines · Jonathan Nieder
t/t5530-upload-pack-error.sh test_expect_success 'upload-pack fails due to error in pack-objects packing' ' · line 39
Quoted 7 lines
t/t5530-upload-pack-error.sh +1
-1@@ -35,7 +35,7 @@ test_expect_success 'upload-pack fails due to error in pack-objects packing' ' printf "0032want %s\n00000009done\n0000" \ $(git rev-parse HEAD) >input && test_must_fail git upload-pack . <input >/dev/null 2>output.err && - grep "unable to read" output.err && + test_i18ngrep "unable to read" output.err && grep "pack-objects died" output.errWouldn't it make sense to change the second "grep" of output intended for humans to
test_i18ngrepwhile at it?Quoted 5 lines
This comes from
error("git upload-pack: git-pack-objects died with error.")inunpack-trees.c, which is not i18n-ized yet. There's another test in t5530 that does the same grep. I think we should leave it as is until we mark the string for translation, then gettext poison will spot it (verified) and we can fix it.
Quoted 4 lines
I don't understand the distinction you're making. Isn't the message intended for humans, and wouldn't changing that one line to
test_i18ngrepnow save trouble later? Tests are meant to check git's intended behavior, not to exactly match its current behavior.
Correct; your suggestion is good.
PATCH 6/7 Fix tests under GETTEXT_POISON on git-remote
In reply to Nguyễn Thái Ngọc DuyFrom: Jiang Xin <[email protected]>
Use i18n-specific test functions in test scripts for git-remote. This issue was was introduced in v1.7.10-233-gbb16d5:
bb16d5 i18n: remote: mark strings for translation
and been broken under GETTEXT_POISON=YesPlease since.
--- t/t5505-remote.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
t/t5505-remote.sh +14 -8
@@ -27,10 +27,16 @@ tokens_match () { test_cmp expect actual } +tokens_i18nmatch () { + echo "$1" | tr ' ' '\012' | sort | sed -e '/^$/d' >expect && + echo "$2" | tr ' ' '\012' | sort | sed -e '/^$/d' >actual && + test_i18ncmp expect actual +} + check_remote_track () { actual=$(git remote show "$1" | sed -ne 's|^ \(.*\) tracked$|\1|p') shift && - tokens_match "$*" "$actual" + tokens_i18nmatch "$*" "$actual" } check_tracking_branch () {
@@ -131,8 +137,8 @@ EOF git remote rm oops 2>actual2 && git branch -d foobranch && git tag -d footag && - test_cmp expect1 actual1 && - test_cmp expect2 actual2 + test_i18ncmp expect1 actual1 && + test_i18ncmp expect2 actual2 ) '
@@ -192,7 +198,7 @@ test_expect_success 'show' ' git config --add remote.two.push refs/heads/master:refs/heads/another && git remote show origin two > output && git branch -d rebase octopus && - test_cmp expect output) + test_i18ncmp expect output) ' cat > test/expect << EOF
@@ -217,7 +223,7 @@ test_expect_success 'show -n' ' cd test && git remote show -n origin > output && mv ../one.unreachable ../one && - test_cmp expect output) + test_i18ncmp expect output) ' test_expect_success 'prune' '
@@ -255,7 +261,7 @@ EOF test_expect_success 'set-head --auto fails w/multiple HEADs' ' (cd test && test_must_fail git remote set-head --auto two >output 2>&1 && - test_cmp expect output) + test_i18ncmp expect output) ' cat >test/expect <<EOF
@@ -285,7 +291,7 @@ test_expect_success 'prune --dry-run' ' test_must_fail git rev-parse refs/remotes/origin/side && (cd ../one && git branch -m side side2) && - test_cmp expect output) + test_i18ncmp expect output) ' test_expect_success 'add --mirror && prune' '
@@ -705,7 +711,7 @@ test_expect_success 'remote prune to cause a dangling symref' ' cd seven && git remote prune origin ) >err 2>&1 && - grep "has become dangling" err && + test_i18ngrep "has become dangling" err && : And the dangling symref will not cause other annoying errors && (
Signature · 1 line
1.7.12.rc2
Re: [PATCH 6/7] Fix tests under GETTEXT_POISON on git-remote
Quoted 25 lines · Nguyễn Thái Ngọc Duy
From: Jiang Xin <[email protected]>
Use i18n-specific test functions in test scripts for git-remote. This issue was was introduced in v1.7.10-233-gbb16d5:
bb16d5 i18n: remote: mark strings for translation
and been broken under GETTEXT_POISON=YesPlease since.
Signed-off-by Jiang Xin <[email protected]>Signed-off-by Nguyễn Thái Ngọc Duy <[email protected]>--- t/t5505-remote.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)t/t5505-remote.sh +2
-0@@ -27,10 +27,16 @@ tokens_match () { test_cmp expect actual } +tokens_i18nmatch () { + echo "$1" | tr ' ' '\012' | sort | sed -e '/^$/d' >expect &&
t/t5505-remote.sh tokens_match () { · line 40
Quoted 10 lines
t/t5505-remote.sh +5
-1+ echo "$2" | tr ' ' '\012' | sort | sed -e '/^$/d' >actual && + test_i18ncmp expect actual +} + check_remote_track () { actual=$(git remote show "$1" | sed -ne 's|^ \(.*\) tracked$|\1|p') shift && - tokens_match "$*" "$actual" + tokens_i18nmatch "$*" "$actual" }
Which part of the output from "git remote show" does this test expect to be translated? Specifically, does "tracked" ever get translated?
It appears that _(" tracked") is indeed marked for translation in the source, so how can we expect value in $actual be any useful for any comparison?
Confused...
Re: [PATCH 6/7] Fix tests under GETTEXT_POISON on git-remote
2012/8/22 Junio C Hamano <[email protected]>:
Quoted 9 lines
Which part of the output from "git remote show" does this test expect to be translated? Specifically, does "tracked" ever get translated?
It appears that
_(" tracked")is indeed marked for translation in the source, so how can we expect value in $actual be any useful for any comparison?Confused...
Yes, because _("tracked") is marked for translation, check_remote_track() is hard to do right.
t/t5505-remote.sh tokens_match () { · line 40
Quoted 6 lines
check_remote_track () { actual=$(git remote show "$1" | sed -ne 's|^ \(.*\) tracked$|\1|p') shift &&t/t5505-remote.sh +1
-1- tokens_match "$*" "$actual" + tokens_i18nmatch "$*" "$actual" }
Output of command "git remote show origin" is:
# GETTEXT POISON #
# GETTEXT POISON #
# GETTEXT POISON #
# GETTEXT POISON #
# GETTEXT POISON #
master# GETTEXT POISON #
side # GETTEXT POISON #
Maybe we should bypass all testcases which calling check_remote_track(). Changing 'tokens_match' to 'tokens_i18nmatch' won't fix but hide the problem.
- test_expect_success 'remote information for the origin' '
+ test_expect_success C_LOCALE_OUTPUT 'remote information for the origin' '
- test_expect_succes 'remove remote' '
+ test_expect_success C_LOCALE_OUTPUT 'remove remote' '
- test_expect_success 'add another remote' '
+ test_expect_success C_LOCALE_OUTPUT 'add another remote' '
Signature · 1 line
Jiang Xin
Re: [PATCH 6/7] Fix tests under GETTEXT_POISON on git-remote
Quoted 1 line · Jiang Xin
Maybe we should bypass all testcases which calling
check_remote_track().
Sounds like it.
PATCH 7/7 Fix tests under GETTEXT_POISON on parseopt
In reply to Nguyễn Thái Ngọc DuyFrom: Jiang Xin <[email protected]>
Use i18n-specific test functions in test scripts for parseopt tests. This issue was was introduced in v1.7.10.1-488-g54e6d:
54e6d i18n: parseopt: lookup help and argument translations when showing usage
and been broken under GETTEXT_POISON=YesPlease since.
--- t/t0040-parse-options.sh | 34 +++++++++++++++++++++++++++++----- t/t1300-repo-config.sh | 2 +- t/t1502-rev-parse-parseopt.sh | 2 +- t/t2006-checkout-index-basic.sh | 4 ++-- t/t2107-update-index-basic.sh | 4 ++-- t/t3004-ls-files-basic.sh | 4 ++-- t/t3200-branch.sh | 4 ++-- t/t3501-revert-cherry-pick.sh | 4 ++-- t/t4200-rerere.sh | 4 ++-- t/t6500-gc.sh | 4 ++-- t/t7600-merge.sh | 2 +- 11 files changed, 46 insertions(+), 22 deletions(-)
t/t0040-parse-options.sh +29 -5
@@ -51,7 +51,7 @@ EOF test_expect_success 'test help' ' test_must_fail test-parse-options -h > output 2> output.err && test ! -s output.err && - test_cmp expect output + test_i18ncmp expect output ' mv expect expect.err
@@ -79,6 +79,17 @@ check() { test_cmp expect output } +check_i18n() { + what="$1" && + shift && + expect="$1" && + shift && + sed "s/^$what .*/$what $expect/" <expect.template >expect && + test-parse-options $* >output 2>output.err && + test ! -s output.err && + test_i18ncmp expect output +} + check_unknown() { case "$1" in --*)
@@ -92,6 +103,19 @@ check_unknown() { test_cmp expect output.err } +check_unknown_i18n() { + case "$1" in + --*) + echo error: unknown option \`${1#--}\' >expect ;; + -*) + echo error: unknown switch \`${1#-}\' >expect ;; + esac && + cat expect.err >>expect && + test_must_fail test-parse-options $* >output 2>output.err && + test ! -s output && + test_i18ncmp expect output.err +} + test_expect_success 'OPT_BOOL() #1' 'check boolean: 1 --yes' test_expect_success 'OPT_BOOL() #2' 'check boolean: 1 --no-doubt' test_expect_success 'OPT_BOOL() #3' 'check boolean: 1 -D'
@@ -104,8 +128,8 @@ test_expect_success 'OPT_BOOL() is idempotent #2' 'check boolean: 1 -DB' test_expect_success 'OPT_BOOL() negation #1' 'check boolean: 0 -D --no-yes' test_expect_success 'OPT_BOOL() negation #2' 'check boolean: 0 -D --no-no-doubt' -test_expect_success 'OPT_BOOL() no negation #1' 'check_unknown --fear' -test_expect_success 'OPT_BOOL() no negation #2' 'check_unknown --no-no-fear' +test_expect_success 'OPT_BOOL() no negation #1' 'check_unknown_i18n --fear' +test_expect_success 'OPT_BOOL() no negation #2' 'check_unknown_i18n --no-no-fear' test_expect_success 'OPT_BOOL() positivation' 'check boolean: 0 -D --doubt'
@@ -310,8 +334,8 @@ EOF test_expect_success 'OPT_CALLBACK() and callback errors work' ' test_must_fail test-parse-options --no-length > output 2> output.err && - test_cmp expect output && - test_cmp expect.err output.err + test_i18ncmp expect output && + test_i18ncmp expect.err output.err ' cat > expect <<EOF
t/t1300-repo-config.sh +1 -1
@@ -391,7 +391,7 @@ test_expect_success 'get bool variable with empty value' \ test_expect_success 'no arguments, but no crash' ' test_must_fail git config >output 2>&1 && - grep usage output + test_i18ngrep usage output ' cat > .git/config << EOF
t/t1502-rev-parse-parseopt.sh +1 -1
@@ -41,7 +41,7 @@ EOF test_expect_success 'test --parseopt help output' ' test_expect_code 129 git rev-parse --parseopt -- -h > output < optionspec && - test_cmp expect output + test_i18ncmp expect output ' cat > expect <<EOF
t/t2006-checkout-index-basic.sh +2 -2
@@ -7,7 +7,7 @@ test_description='basic checkout-index tests test_expect_success 'checkout-index --gobbledegook' ' test_expect_code 129 git checkout-index --gobbledegook 2>err && - grep "[Uu]sage" err + test_i18ngrep "[Uu]sage" err ' test_expect_success 'checkout-index -h in broken repository' '
@@ -18,7 +18,7 @@ test_expect_success 'checkout-index -h in broken repository' ' >.git/index && test_expect_code 129 git checkout-index -h >usage 2>&1 ) && - grep "[Uu]sage" broken/usage + test_i18ngrep "[Uu]sage" broken/usage ' test_done
t/t2107-update-index-basic.sh +2 -2
@@ -15,7 +15,7 @@ test_expect_success 'update-index --nonsense fails' ' test_expect_success 'update-index --nonsense dumps usage' ' test_expect_code 129 git update-index --nonsense 2>err && - grep "[Uu]sage: git update-index" err + test_i18ngrep "[Uu]sage: git update-index" err ' test_expect_success 'update-index -h with corrupt index' '
@@ -26,7 +26,7 @@ test_expect_success 'update-index -h with corrupt index' ' >.git/index && test_expect_code 129 git update-index -h >usage 2>&1 ) && - grep "[Uu]sage: git update-index" broken/usage + test_i18ngrep "[Uu]sage: git update-index" broken/usage ' test_done
t/t3004-ls-files-basic.sh +2 -2
@@ -22,7 +22,7 @@ test_expect_success 'ls-files with nonexistent path' ' test_expect_success 'ls-files with nonsense option' ' test_expect_code 129 git ls-files --nonsense 2>actual && - grep "[Uu]sage: git ls-files" actual + test_i18ngrep "[Uu]sage: git ls-files" actual ' test_expect_success 'ls-files -h in corrupt repository' '
@@ -33,7 +33,7 @@ test_expect_success 'ls-files -h in corrupt repository' ' >.git/index && test_expect_code 129 git ls-files -h >usage 2>&1 ) && - grep "[Uu]sage: git ls-files " broken/usage + test_i18ngrep "[Uu]sage: git ls-files " broken/usage ' test_done
t/t3200-branch.sh +2 -2
@@ -31,7 +31,7 @@ test_expect_success 'branch -h in broken repository' ' >.git/refs/heads/master && test_expect_code 129 git branch -h >usage 2>&1 ) && - grep "[Uu]sage" broken/usage + test_i18ngrep "[Uu]sage" broken/usage ' test_expect_success \
@@ -74,7 +74,7 @@ test_expect_success \ test_expect_success \ 'git branch -m dumps usage' \ 'test_expect_code 129 git branch -m 2>err && - grep "[Uu]sage: git branch" err' + test_i18ngrep "[Uu]sage: git branch" err' test_expect_success \ 'git branch -m m m/m should work' \
t/t3501-revert-cherry-pick.sh +2 -2
@@ -47,7 +47,7 @@ test_expect_success 'cherry-pick --nonsense' ' git diff --exit-code HEAD && test_must_fail git cherry-pick --nonsense 2>msg && git diff --exit-code HEAD "$pos" && - grep '[Uu]sage:' msg + test_i18ngrep '[Uu]sage:' msg ' test_expect_success 'revert --nonsense' '
@@ -56,7 +56,7 @@ test_expect_success 'revert --nonsense' ' git diff --exit-code HEAD && test_must_fail git revert --nonsense 2>msg && git diff --exit-code HEAD "$pos" && - grep '[Uu]sage:' msg + test_i18ngrep '[Uu]sage:' msg ' test_expect_success 'cherry-pick after renaming branch' '
t/t4200-rerere.sh +2 -2
@@ -382,13 +382,13 @@ test_expect_success 'rerere --no-no-rerere-autoupdate' ' git update-index --index-info <failedmerge && cp file3.conflict file3 && test_must_fail git rerere --no-no-rerere-autoupdate 2>err && - grep [Uu]sage err && + test_i18ngrep [Uu]sage err && test_must_fail git update-index --refresh ' test_expect_success 'rerere -h' ' test_must_fail git rerere -h >help && - grep [Uu]sage help + test_i18ngrep [Uu]sage help ' test_done
t/t6500-gc.sh +2 -2
@@ -11,7 +11,7 @@ test_expect_success 'gc empty repository' ' test_expect_success 'gc --gobbledegook' ' test_expect_code 129 git gc --nonsense 2>err && - grep "[Uu]sage: git gc" err + test_i18ngrep "[Uu]sage: git gc" err ' test_expect_success 'gc -h with invalid configuration' '
@@ -22,7 +22,7 @@ test_expect_success 'gc -h with invalid configuration' ' echo "[gc] pruneexpire = CORRUPT" >>.git/config && test_expect_code 129 git gc -h >usage 2>&1 ) && - grep "[Uu]sage" broken/usage + test_i18ngrep "[Uu]sage" broken/usage ' test_done
t/t7600-merge.sh +1 -1
@@ -157,7 +157,7 @@ test_expect_success 'merge -h with invalid index' ' >.git/index && test_expect_code 129 git merge -h 2>usage ) && - grep "[Uu]sage: git merge" broken/usage + test_i18ngrep "[Uu]sage: git merge" broken/usage ' test_expect_success 'reject non-strategy with a git-merge-foo name' '
Signature · 1 line
1.7.12.rc2
v2 cover Gettext poison fixes
In reply to Nguyễn Thái Ngọc DuyUpdate patch 5/7 (Fix tests under GETTEXT_POISON on pack-object) and patch 6/7 (Fix tests under GETTEXT_POISON on git-remote) in this new series of patches.
Not much to say. With this series, the test suite should pass again with gettext poison on. It's independent with the parseopt-i18n series I sent yesterday as the test suite was broken even before.
Jiang Xin (7):
Fix tests under GETTEXT_POISON on relative dates Fix tests under GETTEXT_POISON on git-stash Fix tests under GETTEXT_POISON on diffstat Fix tests under GETTEXT_POISON on git-apply Fix tests under GETTEXT_POISON on pack-object Fix tests under GETTEXT_POISON on git-remote Fix tests under GETTEXT_POISON on parseopt
t/t0006-date.sh | 2 +- t/t0040-parse-options.sh | 34 +++++++++++++++++++++++++++++----- t/t1300-repo-config.sh | 2 +- t/t1502-rev-parse-parseopt.sh | 2 +- t/t2006-checkout-index-basic.sh | 4 ++-- t/t2107-update-index-basic.sh | 4 ++-- t/t3004-ls-files-basic.sh | 4 ++-- t/t3200-branch.sh | 4 ++-- t/t3501-revert-cherry-pick.sh | 4 ++-- t/t3903-stash.sh | 2 +- t/t4006-diff-mode.sh | 8 ++++---- t/t4012-diff-binary.sh | 4 ++-- t/t4120-apply-popt.sh | 4 ++-- t/t4133-apply-filenames.sh | 4 ++-- t/t4200-rerere.sh | 4 ++-- t/t4202-log.sh | 2 +- t/t4205-log-pretty-formats.sh | 4 ++-- t/t5300-pack-object.sh | 4 ++-- t/t5505-remote.sh | 28 +++++++++++++++++----------- t/t5530-upload-pack-error.sh | 4 ++-- t/t6500-gc.sh | 4 ++-- t/t7508-status.sh | 2 +- t/t7600-merge.sh | 2 +- 23 files changed, 83 insertions(+), 53 deletions(-)
Signature · 1 line
1.7.12.92.gaa91cb5
PATCH v2 1/7 Fix tests under GETTEXT_POISON on relative dates
Use a i18n-specific test_i18ncmp in t/t0006-data.sh for relative dates tests. This issue was was introduced in v1.7.10-230-g7d29a:
7d29a i18n: mark relative dates for translation
and been broken under GETTEXT_POISON=YesPlease since.
--- t/t0006-date.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
t/t0006-date.sh +1 -1
@@ -11,7 +11,7 @@ check_show() { echo "$t -> $2" >expect test_expect_${3:-success} "relative date ($2)" " test-date show $t >actual && - test_cmp expect actual + test_i18ncmp expect actual " }
Signature · 1 line
1.7.12.92.gaa91cb5
PATCH v2 2/7 Fix tests under GETTEXT_POISON on git-stash
Use i18n-specific test functions in test scripts for git-stash. This issue was was introduced in v1.7.4.1-119-g355ec:
355ec i18n: git-status basic messages
and been broken under GETTEXT_POISON=YesPlease since.
--- t/t3903-stash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
t/t3903-stash.sh +1 -1
@@ -610,7 +610,7 @@ test_expect_success 'stash apply shows status same as git status (relative to cu git stash apply ) | sed -e 1,2d >actual && # drop "Saved..." and "HEAD is now..." - test_cmp expect actual + test_i18ncmp expect actual ' cat > expect << EOF
Signature · 1 line
1.7.12.92.gaa91cb5
PATCH v2 3/7 Fix tests under GETTEXT_POISON on diffstat
Use i18n-specific test functions in test scripts for diffstat. This issue was was introduced in v1.7.9-1-g7f814:
7f814 Use correct grammar in diffstat summary line
and been broken under GETTEXT_POISON=YesPlease since.
--- t/t4006-diff-mode.sh | 8 ++++---- t/t4202-log.sh | 2 +- t/t4205-log-pretty-formats.sh | 4 ++-- t/t7508-status.sh | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)
t/t4006-diff-mode.sh +4 -4
@@ -36,24 +36,24 @@ test_expect_success '--stat output after text chmod' ' test_chmod -x rezrov && echo " 0 files changed" >expect && git diff HEAD --stat >actual && - test_cmp expect actual + test_i18ncmp expect actual ' test_expect_success '--shortstat output after text chmod' ' git diff HEAD --shortstat >actual && - test_cmp expect actual + test_i18ncmp expect actual ' test_expect_success '--stat output after binary chmod' ' test_chmod +x binbin && echo " 0 files changed" >expect && git diff HEAD --stat >actual && - test_cmp expect actual + test_i18ncmp expect actual ' test_expect_success '--shortstat output after binary chmod' ' git diff HEAD --shortstat >actual && - test_cmp expect actual + test_i18ncmp expect actual ' test_done
t/t4202-log.sh +1 -1
@@ -803,7 +803,7 @@ sanitize_output () { test_expect_success 'log --graph with diff and stats' ' git log --graph --pretty=short --stat -p >actual && sanitize_output >actual.sanitized <actual && - test_cmp expect actual.sanitized + test_i18ncmp expect actual.sanitized ' test_done
t/t4205-log-pretty-formats.sh +2 -2
@@ -88,7 +88,7 @@ test_expect_success 'NUL separation with --stat' ' stat1_part=$(git diff --stat --root HEAD^) && printf "add bar\n$stat0_part\n\0initial\n$stat1_part\n" >expected && git log -z --stat --pretty="format:%s" >actual && - test_cmp expected actual + test_i18ncmp expected actual ' test_expect_failure 'NUL termination with --stat' '
@@ -96,7 +96,7 @@ test_expect_failure 'NUL termination with --stat' ' stat1_part=$(git diff --stat --root HEAD^) && printf "add bar\n$stat0_part\n\0initial\n$stat1_part\n\0" >expected && git log -z --stat --pretty="tformat:%s" >actual && - test_cmp expected actual + test_i18ncmp expected actual ' test_done
t/t7508-status.sh +1 -1
@@ -80,7 +80,7 @@ test_expect_success 'status --column' ' # dir1/untracked dir2/untracked untracked # dir2/modified output EOF - test_cmp expect output + test_i18ncmp expect output ' cat >expect <<\EOF
Signature · 1 line
1.7.12.92.gaa91cb5
PATCH v2 4/7 Fix tests under GETTEXT_POISON on git-apply
Use i18n-specific test functions in test scripts for git-apply. This issue was was introduced in the following commits:
de373 i18n: apply: mark parseopt strings for translation 3638e i18n: apply: mark strings for translation
and been broken under GETTEXT_POISON=YesPlease since.
--- t/t4012-diff-binary.sh | 4 ++-- t/t4120-apply-popt.sh | 4 ++-- t/t4133-apply-filenames.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
t/t4012-diff-binary.sh +2 -2
@@ -63,7 +63,7 @@ test_expect_success 'apply --numstat understands diff --binary format' ' # apply needs to be able to skip the binary material correctly # in order to report the line number of a corrupt patch. -test_expect_success 'apply detecting corrupt patch correctly' ' +test_expect_success C_LOCALE_OUTPUT 'apply detecting corrupt patch correctly' ' git diff >output && sed -e "s/-CIT/xCIT/" <output >broken && test_must_fail git apply --stat --summary broken 2>detected &&
@@ -73,7 +73,7 @@ test_expect_success 'apply detecting corrupt patch correctly' ' test "$detected" = xCIT ' -test_expect_success 'apply detecting corrupt patch correctly' ' +test_expect_success C_LOCALE_OUTPUT 'apply detecting corrupt patch correctly' ' git diff --binary | sed -e "s/-CIT/xCIT/" >broken && test_must_fail git apply --stat --summary broken 2>detected && detected=`cat detected` &&
t/t4120-apply-popt.sh +2 -2
@@ -32,7 +32,7 @@ test_expect_success 'apply git diff with -p2' ' test_expect_success 'apply with too large -p' ' cp file1.saved file1 && test_must_fail git apply --stat -p3 patch.file 2>err && - grep "removing 3 leading" err + test_i18ngrep "removing 3 leading" err ' test_expect_success 'apply (-p2) traditional diff with funny filenames' '
@@ -54,7 +54,7 @@ test_expect_success 'apply (-p2) traditional diff with funny filenames' ' test_expect_success 'apply with too large -p and fancy filename' ' cp file1.saved file1 && test_must_fail git apply --stat -p3 patch.escaped 2>err && - grep "removing 3 leading" err + test_i18ngrep "removing 3 leading" err ' test_expect_success 'apply (-p2) diff, mode change only' '
t/t4133-apply-filenames.sh +2 -2
@@ -30,9 +30,9 @@ EOF test_expect_success 'apply diff with inconsistent filenames in headers' ' test_must_fail git apply bad1.patch 2>err && - grep "inconsistent new filename" err && + test_i18ngrep "inconsistent new filename" err && test_must_fail git apply bad2.patch 2>err && - grep "inconsistent old filename" err + test_i18ngrep "inconsistent old filename" err ' test_done
Signature · 1 line
1.7.12.92.gaa91cb5
PATCH v2 5/7 Fix tests under GETTEXT_POISON on pack-object
Use i18n-specific test functions in test scripts for pack-object. This issue was was introduced in v1.7.10.2-556-g46140:
46140 index-pack: use streaming interface for collision test on large blobs cf2ba pack-objects: use streaming interface for reading large loose blobs
and been broken under GETTEXT_POISON=YesPlease since.
--- t/t5300-pack-object.sh | 4 ++-- t/t5530-upload-pack-error.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
t/t5300-pack-object.sh +2 -2
@@ -416,11 +416,11 @@ test_expect_success \ test_expect_success \ 'make sure index-pack detects the SHA1 collision' \ 'test_must_fail git index-pack -o bad.idx test-3.pack 2>msg && - grep "SHA1 COLLISION FOUND" msg' + test_i18ngrep "SHA1 COLLISION FOUND" msg' test_expect_success \ 'make sure index-pack detects the SHA1 collision (large blobs)' \ 'test_must_fail git -c core.bigfilethreshold=1 index-pack -o bad.idx test-3.pack 2>msg && - grep "SHA1 COLLISION FOUND" msg' + test_i18ngrep "SHA1 COLLISION FOUND" msg' test_done
t/t5530-upload-pack-error.sh +2 -2
@@ -35,8 +35,8 @@ test_expect_success 'upload-pack fails due to error in pack-objects packing' ' printf "0032want %s\n00000009done\n0000" \ $(git rev-parse HEAD) >input && test_must_fail git upload-pack . <input >/dev/null 2>output.err && - grep "unable to read" output.err && - grep "pack-objects died" output.err + test_i18ngrep "unable to read" output.err && + test_i18ngrep "pack-objects died" output.err ' test_expect_success 'corrupt repo differently' '
Signature · 1 line
1.7.12.92.gaa91cb5
PATCH v2 6/7 Fix tests under GETTEXT_POISON on git-remote
Use i18n-specific test functions in test scripts for git-remote. This issue was was introduced in v1.7.10-233-gbb16d5:
bb16d5 i18n: remote: mark strings for translation
and been broken under GETTEXT_POISON=YesPlease since.
--- t/t5505-remote.sh | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-)
t/t5505-remote.sh +17 -11
@@ -52,7 +52,7 @@ test_expect_success setup ' ' -test_expect_success 'remote information for the origin' ' +test_expect_success C_LOCALE_OUTPUT 'remote information for the origin' ' ( cd test && tokens_match origin "$(git remote)" &&
@@ -66,8 +66,6 @@ test_expect_success 'add another remote' ' cd test && git remote add -f second ../two && tokens_match "origin second" "$(git remote)" && - check_remote_track origin master side && - check_remote_track second master side another && check_tracking_branch second master side another && git for-each-ref "--format=%(refname)" refs/remotes | sed -e "/^refs\/remotes\/origin\//d" \
@@ -77,6 +75,14 @@ test_expect_success 'add another remote' ' ) ' +test_expect_success C_LOCALE_OUTPUT 'add another remote' ' +( + cd test && + check_remote_track origin master side && + check_remote_track second master side another && +) +' + test_expect_success 'remote forces tracking branches' ' ( cd test &&
@@ -95,7 +101,7 @@ test_expect_success 'remove remote' ' ) ' -test_expect_success 'remove remote' ' +test_expect_success C_LOCALE_OUTPUT 'remove remote' ' ( cd test && tokens_match origin "$(git remote)" &&
@@ -131,8 +137,8 @@ EOF git remote rm oops 2>actual2 && git branch -d foobranch && git tag -d footag && - test_cmp expect1 actual1 && - test_cmp expect2 actual2 + test_i18ncmp expect1 actual1 && + test_i18ncmp expect2 actual2 ) '
@@ -192,7 +198,7 @@ test_expect_success 'show' ' git config --add remote.two.push refs/heads/master:refs/heads/another && git remote show origin two > output && git branch -d rebase octopus && - test_cmp expect output) + test_i18ncmp expect output) ' cat > test/expect << EOF
@@ -217,7 +223,7 @@ test_expect_success 'show -n' ' cd test && git remote show -n origin > output && mv ../one.unreachable ../one && - test_cmp expect output) + test_i18ncmp expect output) ' test_expect_success 'prune' '
@@ -255,7 +261,7 @@ EOF test_expect_success 'set-head --auto fails w/multiple HEADs' ' (cd test && test_must_fail git remote set-head --auto two >output 2>&1 && - test_cmp expect output) + test_i18ncmp expect output) ' cat >test/expect <<EOF
@@ -285,7 +291,7 @@ test_expect_success 'prune --dry-run' ' test_must_fail git rev-parse refs/remotes/origin/side && (cd ../one && git branch -m side side2) && - test_cmp expect output) + test_i18ncmp expect output) ' test_expect_success 'add --mirror && prune' '
@@ -705,7 +711,7 @@ test_expect_success 'remote prune to cause a dangling symref' ' cd seven && git remote prune origin ) >err 2>&1 && - grep "has become dangling" err && + test_i18ngrep "has become dangling" err && : And the dangling symref will not cause other annoying errors && (
Signature · 1 line
1.7.12.92.gaa91cb5
Re: [PATCH v2 6/7] Fix tests under GETTEXT_POISON on git-remote
Quoted 12 lines · Jiang Xin
Use i18n-specific test functions in test scripts for git-remote. This issue was was introduced in v1.7.10-233-gbb16d5:
bb16d5 i18n: remote: mark strings for translation
and been broken under GETTEXT_POISON=YesPlease since.
Signed-off-by Jiang Xin <[email protected]>Signed-off-by Nguyễn Thái Ngọc Duy <[email protected]>---
...
t/t5505-remote.sh test_expect_success 'add another remote' ' · line 84
Quoted 10 lines
t/t5505-remote.sh +7
-0@@ -77,6 +75,14 @@ test_expect_success 'add another remote' ' ) ' +test_expect_success C_LOCALE_OUTPUT 'add another remote' ' +( + cd test && + check_remote_track origin master side && + check_remote_track second master side another && +) +'
This couldn't have possibly passed with the trailing &&, or am I missing something? There is already "add another remote" before this test that adds "second" remote. Is this test about "add yet another remote", or is it checking the result of adding "second" that was done in the previous step?
Will queue with an obvious fix-up with retitle, 'check tracking', or something.
Thanks.
Re: [PATCH v2 6/7] Fix tests under GETTEXT_POISON on git-remote
2012/8/28 Junio C Hamano <[email protected]>:
Quoted 17 lines
Quoted 15 lines · Jiang Xin
Use i18n-specific test functions in test scripts for git-remote. This issue was was introduced in v1.7.10-233-gbb16d5:
bb16d5 i18n: remote: mark strings for translation
and been broken under GETTEXT_POISON=YesPlease since.
Signed-off-by Jiang Xin <[email protected]>Signed-off-by Nguyễn Thái Ngọc Duy <[email protected]>---
...(quoted diff) +0
-0@@ -77,6 +75,14 @@ test_expect_success 'add another remote' ' ) '
Quoted 13 lines
t/t5505-remote.sh test_expect_success 'add another remote' ' · line 84
Quoted 7 lines
t/t5505-remote.sh +7
-0+test_expect_success C_LOCALE_OUTPUT 'add another remote' ' +( + cd test && + check_remote_track origin master side && + check_remote_track second master side another && +) +'This couldn't have possibly passed with the trailing &&, or am I missing something? There is already "add another remote" before this test that adds "second" remote. Is this test about "add yet another remote", or is it checking the result of adding "second" that was done in the previous step?
The trailing "&&“ is a copy & paste error. I only run my fixup in GIT_GETTEXT_POISON mode in a harry, not noticed the bypassed testcase has this serious bug.
I split the original "add another remote" into two blocks. One is a normal testcase, and another has a C_LOCALE_OUTPUT prereq flag. This is because other testcases depend on the operations in "add another remote" testcase ('git remote add -f second ../two'), and these testcases would fail if add C_LOCALE_OUTPUT prereq to the whole "add another remote" testcase.
Quoted 5 lines
Will queue with an obvious fix-up with retitle, 'check tracking', or something.
Thanks.
Signature · 8 lines
蒋鑫 北京群英汇信息技术有限公司 邮件: [email protected] 网址: http://www.ossxp.com/ 博客: http://www.worldhello.net/ 微博: http://weibo.com/gotgit/ 电话: 010-51262007, 18601196889
Re: [PATCH v2 6/7] Fix tests under GETTEXT_POISON on git-remote
Quoted 10 lines · Jiang Xin
Quoted 5 lines
This couldn't have possibly passed with the trailing &&, or am I missing something? There is already "add another remote" before this test that adds "second" remote. Is this test about "add yet another remote", or is it checking the result of adding "second" that was done in the previous step?
The trailing "&&“ is a copy & paste error. I only run my fixup in
GIT_GETTEXT_POISONmode in a harry, not noticed the bypassed testcase has this serious bug.
Quoted 6 lines
I split the original "add another remote" into two blocks. One is a normal testcase, and another has a
C_LOCALE_OUTPUTprereq flag. This is because other testcases depend on the operations in "add another remote" testcase ('git remote add -f second ../two'), and these testcases would fail if addC_LOCALE_OUTPUTprereq to the whole "add another remote" testcase.
OK, so in short, I think the fix-up I made while queuing (and the typofix in the commit log message for the other one) this round to 'pu' should match what you wanted to do. If you want to make further changes, I wouldn't mind re-queuing an update, but otherwise there is no need to resend this series (and it will be less work for me ;-).
Thanks.
PATCH v2 7/7 Fix tests under GETTEXT_POISON on parseopt
In reply to Jiang XinUse i18n-specific test functions in test scripts for parseopt tests. This issue was was introduced in v1.7.10.1-488-g54e6d:
54e6d i18n: parseopt: lookup help and argument translations when showing usage
and been broken under GETTEXT_POISON=YesPlease since.
--- t/t0040-parse-options.sh | 34 +++++++++++++++++++++++++++++----- t/t1300-repo-config.sh | 2 +- t/t1502-rev-parse-parseopt.sh | 2 +- t/t2006-checkout-index-basic.sh | 4 ++-- t/t2107-update-index-basic.sh | 4 ++-- t/t3004-ls-files-basic.sh | 4 ++-- t/t3200-branch.sh | 4 ++-- t/t3501-revert-cherry-pick.sh | 4 ++-- t/t4200-rerere.sh | 4 ++-- t/t6500-gc.sh | 4 ++-- t/t7600-merge.sh | 2 +- 11 files changed, 46 insertions(+), 22 deletions(-)
t/t0040-parse-options.sh +29 -5
@@ -51,7 +51,7 @@ EOF test_expect_success 'test help' ' test_must_fail test-parse-options -h > output 2> output.err && test ! -s output.err && - test_cmp expect output + test_i18ncmp expect output ' mv expect expect.err
@@ -79,6 +79,17 @@ check() { test_cmp expect output } +check_i18n() { + what="$1" && + shift && + expect="$1" && + shift && + sed "s/^$what .*/$what $expect/" <expect.template >expect && + test-parse-options $* >output 2>output.err && + test ! -s output.err && + test_i18ncmp expect output +} + check_unknown() { case "$1" in --*)
@@ -92,6 +103,19 @@ check_unknown() { test_cmp expect output.err } +check_unknown_i18n() { + case "$1" in + --*) + echo error: unknown option \`${1#--}\' >expect ;; + -*) + echo error: unknown switch \`${1#-}\' >expect ;; + esac && + cat expect.err >>expect && + test_must_fail test-parse-options $* >output 2>output.err && + test ! -s output && + test_i18ncmp expect output.err +} + test_expect_success 'OPT_BOOL() #1' 'check boolean: 1 --yes' test_expect_success 'OPT_BOOL() #2' 'check boolean: 1 --no-doubt' test_expect_success 'OPT_BOOL() #3' 'check boolean: 1 -D'
@@ -104,8 +128,8 @@ test_expect_success 'OPT_BOOL() is idempotent #2' 'check boolean: 1 -DB' test_expect_success 'OPT_BOOL() negation #1' 'check boolean: 0 -D --no-yes' test_expect_success 'OPT_BOOL() negation #2' 'check boolean: 0 -D --no-no-doubt' -test_expect_success 'OPT_BOOL() no negation #1' 'check_unknown --fear' -test_expect_success 'OPT_BOOL() no negation #2' 'check_unknown --no-no-fear' +test_expect_success 'OPT_BOOL() no negation #1' 'check_unknown_i18n --fear' +test_expect_success 'OPT_BOOL() no negation #2' 'check_unknown_i18n --no-no-fear' test_expect_success 'OPT_BOOL() positivation' 'check boolean: 0 -D --doubt'
@@ -310,8 +334,8 @@ EOF test_expect_success 'OPT_CALLBACK() and callback errors work' ' test_must_fail test-parse-options --no-length > output 2> output.err && - test_cmp expect output && - test_cmp expect.err output.err + test_i18ncmp expect output && + test_i18ncmp expect.err output.err ' cat > expect <<EOF
t/t1300-repo-config.sh +1 -1
@@ -391,7 +391,7 @@ test_expect_success 'get bool variable with empty value' \ test_expect_success 'no arguments, but no crash' ' test_must_fail git config >output 2>&1 && - grep usage output + test_i18ngrep usage output ' cat > .git/config << EOF
t/t1502-rev-parse-parseopt.sh +1 -1
@@ -41,7 +41,7 @@ EOF test_expect_success 'test --parseopt help output' ' test_expect_code 129 git rev-parse --parseopt -- -h > output < optionspec && - test_cmp expect output + test_i18ncmp expect output ' cat > expect <<EOF
t/t2006-checkout-index-basic.sh +2 -2
@@ -7,7 +7,7 @@ test_description='basic checkout-index tests test_expect_success 'checkout-index --gobbledegook' ' test_expect_code 129 git checkout-index --gobbledegook 2>err && - grep "[Uu]sage" err + test_i18ngrep "[Uu]sage" err ' test_expect_success 'checkout-index -h in broken repository' '
@@ -18,7 +18,7 @@ test_expect_success 'checkout-index -h in broken repository' ' >.git/index && test_expect_code 129 git checkout-index -h >usage 2>&1 ) && - grep "[Uu]sage" broken/usage + test_i18ngrep "[Uu]sage" broken/usage ' test_done
t/t2107-update-index-basic.sh +2 -2
@@ -15,7 +15,7 @@ test_expect_success 'update-index --nonsense fails' ' test_expect_success 'update-index --nonsense dumps usage' ' test_expect_code 129 git update-index --nonsense 2>err && - grep "[Uu]sage: git update-index" err + test_i18ngrep "[Uu]sage: git update-index" err ' test_expect_success 'update-index -h with corrupt index' '
@@ -26,7 +26,7 @@ test_expect_success 'update-index -h with corrupt index' ' >.git/index && test_expect_code 129 git update-index -h >usage 2>&1 ) && - grep "[Uu]sage: git update-index" broken/usage + test_i18ngrep "[Uu]sage: git update-index" broken/usage ' test_done
t/t3004-ls-files-basic.sh +2 -2
@@ -22,7 +22,7 @@ test_expect_success 'ls-files with nonexistent path' ' test_expect_success 'ls-files with nonsense option' ' test_expect_code 129 git ls-files --nonsense 2>actual && - grep "[Uu]sage: git ls-files" actual + test_i18ngrep "[Uu]sage: git ls-files" actual ' test_expect_success 'ls-files -h in corrupt repository' '
@@ -33,7 +33,7 @@ test_expect_success 'ls-files -h in corrupt repository' ' >.git/index && test_expect_code 129 git ls-files -h >usage 2>&1 ) && - grep "[Uu]sage: git ls-files " broken/usage + test_i18ngrep "[Uu]sage: git ls-files " broken/usage ' test_done
t/t3200-branch.sh +2 -2
@@ -31,7 +31,7 @@ test_expect_success 'branch -h in broken repository' ' >.git/refs/heads/master && test_expect_code 129 git branch -h >usage 2>&1 ) && - grep "[Uu]sage" broken/usage + test_i18ngrep "[Uu]sage" broken/usage ' test_expect_success \
@@ -74,7 +74,7 @@ test_expect_success \ test_expect_success \ 'git branch -m dumps usage' \ 'test_expect_code 129 git branch -m 2>err && - grep "[Uu]sage: git branch" err' + test_i18ngrep "[Uu]sage: git branch" err' test_expect_success \ 'git branch -m m m/m should work' \
t/t3501-revert-cherry-pick.sh +2 -2
@@ -47,7 +47,7 @@ test_expect_success 'cherry-pick --nonsense' ' git diff --exit-code HEAD && test_must_fail git cherry-pick --nonsense 2>msg && git diff --exit-code HEAD "$pos" && - grep '[Uu]sage:' msg + test_i18ngrep '[Uu]sage:' msg ' test_expect_success 'revert --nonsense' '
@@ -56,7 +56,7 @@ test_expect_success 'revert --nonsense' ' git diff --exit-code HEAD && test_must_fail git revert --nonsense 2>msg && git diff --exit-code HEAD "$pos" && - grep '[Uu]sage:' msg + test_i18ngrep '[Uu]sage:' msg ' test_expect_success 'cherry-pick after renaming branch' '
t/t4200-rerere.sh +2 -2
@@ -382,13 +382,13 @@ test_expect_success 'rerere --no-no-rerere-autoupdate' ' git update-index --index-info <failedmerge && cp file3.conflict file3 && test_must_fail git rerere --no-no-rerere-autoupdate 2>err && - grep [Uu]sage err && + test_i18ngrep [Uu]sage err && test_must_fail git update-index --refresh ' test_expect_success 'rerere -h' ' test_must_fail git rerere -h >help && - grep [Uu]sage help + test_i18ngrep [Uu]sage help ' test_done
t/t6500-gc.sh +2 -2
@@ -11,7 +11,7 @@ test_expect_success 'gc empty repository' ' test_expect_success 'gc --gobbledegook' ' test_expect_code 129 git gc --nonsense 2>err && - grep "[Uu]sage: git gc" err + test_i18ngrep "[Uu]sage: git gc" err ' test_expect_success 'gc -h with invalid configuration' '
@@ -22,7 +22,7 @@ test_expect_success 'gc -h with invalid configuration' ' echo "[gc] pruneexpire = CORRUPT" >>.git/config && test_expect_code 129 git gc -h >usage 2>&1 ) && - grep "[Uu]sage" broken/usage + test_i18ngrep "[Uu]sage" broken/usage ' test_done
t/t7600-merge.sh +1 -1
@@ -157,7 +157,7 @@ test_expect_success 'merge -h with invalid index' ' >.git/index && test_expect_code 129 git merge -h 2>usage ) && - grep "[Uu]sage: git merge" broken/usage + test_i18ngrep "[Uu]sage: git merge" broken/usage ' test_expect_success 'reject non-strategy with a git-merge-foo name' '
Signature · 1 line
1.7.12.92.gaa91cb5
Re: [PATCH v2 1/7] Fix tests under GETTEXT_POISON on relative dates
In reply to Jiang XinQuoted 10 lines · Jiang Xin
Use a i18n-specific
test_i18ncmpint/t0006-data.shfor relative dates tests. This issue was was introduced in v1.7.10-230-g7d29a:7d29a i18n: mark relative dates for translation
and been broken under GETTEXT_POISON=YesPlease since.
Signed-off-by Jiang Xin <[email protected]>Signed-off-by Nguyễn Thái Ngọc Duy <[email protected]>---
Thanks; will queue with s/0006-data/0006-date/
Quoted 15 lines
t/t0006-date.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)t/t0006-date.sh +1
-1@@ -11,7 +11,7 @@ check_show() { echo "$t -> $2" >expect test_expect_${3:-success} "relative date ($2)" " test-date show $t >actual && - test_cmp expect actual + test_i18ncmp expect actual " }