From 7f230afab0ba056fc2082a690b25653aacb15851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 25 Feb 2022 13:15:56 +0100 Subject: [PATCH 1/7] tests with #11 test_i18ngrep: replace it with 'grep' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For those tests that have 11 occurances of 'test_i18ngrep', replace it with 'grep'. Splitting this incremental conversion by number of occurances in the file is arbitrary, but help so keep the commit size down. The 'test_i18ngrep' wrapper has been deprecated since d162b25f956 (tests: remove support for GIT_TEST_GETTEXT_POISON, 2021-01-20). Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t1400-update-ref.sh | 22 +++++++++++----------- t/t1430-bad-ref-name.sh | 22 +++++++++++----------- t/t3206-range-diff.sh | 22 +++++++++++----------- t/t4047-diff-dirstat.sh | 22 +++++++++++----------- t/t5505-remote.sh | 22 +++++++++++----------- t/t5616-partial-clone.sh | 22 +++++++++++----------- 6 files changed, 66 insertions(+), 66 deletions(-) diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index cf58cf025cd2af..67564fce38ec50 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -410,7 +410,7 @@ test_expect_success 'Query "main@{2005-05-26 23:33:01}" (middle of history with git rev-parse --verify "main@{2005-05-26 23:33:01}" >o 2>e && echo "$B" >expect && test_cmp expect o && - test_i18ngrep -F "warning: log for ref $m has gap after $gd" e + grep -F "warning: log for ref $m has gap after $gd" e ' test_expect_success 'Query "main@{2005-05-26 23:38:00}" (middle of history)' ' test_when_finished "rm -f o e" && @@ -431,7 +431,7 @@ test_expect_success 'Query "main@{2005-05-28}" (past end of history)' ' git rev-parse --verify "main@{2005-05-28}" >o 2>e && echo "$D" >expect && test_cmp expect o && - test_i18ngrep -F "warning: log for ref $m unexpectedly ended on $ld" e + grep -F "warning: log for ref $m unexpectedly ended on $ld" e ' rm -f .git/$m .git/logs/$m expect @@ -486,7 +486,7 @@ test_expect_success 'git cat-file blob main@{2005-05-26 23:42}:F (expect OTHER)' test_expect_success 'given old value for missing pseudoref, do not create' ' test_must_fail git update-ref PSEUDOREF $A $B 2>err && test_must_fail git rev-parse PSEUDOREF && - test_i18ngrep "unable to resolve reference" err + grep "unable to resolve reference" err ' test_expect_success 'create pseudoref' ' @@ -507,7 +507,7 @@ test_expect_success 'overwrite pseudoref with correct old value' ' test_expect_success 'do not overwrite pseudoref with wrong old value' ' test_must_fail git update-ref PSEUDOREF $D $E 2>err && test $C = $(git rev-parse PSEUDOREF) && - test_i18ngrep "cannot lock ref.*expected" err + grep "cannot lock ref.*expected" err ' test_expect_success 'delete pseudoref' ' @@ -519,7 +519,7 @@ test_expect_success 'do not delete pseudoref with wrong old value' ' git update-ref PSEUDOREF $A && test_must_fail git update-ref -d PSEUDOREF $B 2>err && test $A = $(git rev-parse PSEUDOREF) && - test_i18ngrep "cannot lock ref.*expected" err + grep "cannot lock ref.*expected" err ' test_expect_success 'delete pseudoref with correct old value' ' @@ -536,7 +536,7 @@ test_expect_success 'do not overwrite pseudoref with old OID zero' ' test_when_finished git update-ref -d PSEUDOREF && test_must_fail git update-ref PSEUDOREF $B $Z 2>err && test $A = $(git rev-parse PSEUDOREF) && - test_i18ngrep "already exists" err + grep "already exists" err ' # Test --stdin @@ -556,7 +556,7 @@ test_expect_success 'stdin test setup' ' test_expect_success '-z fails without --stdin' ' test_must_fail git update-ref -z $m $m $m 2>err && - test_i18ngrep "usage: git update-ref" err + grep "usage: git update-ref" err ' test_expect_success 'stdin works with no input' ' @@ -674,7 +674,7 @@ test_expect_success 'stdin fails with duplicate refs' ' create $a $m EOF test_must_fail git update-ref --stdin err && - test_i18ngrep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err + grep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err ' test_expect_success 'stdin create ref works' ' @@ -1107,7 +1107,7 @@ test_expect_success 'stdin -z fails option with unknown name' ' test_expect_success 'stdin -z fails with duplicate refs' ' printf $F "create $a" "$m" "create $b" "$m" "create $a" "$m" >stdin && test_must_fail git update-ref -z --stdin err && - test_i18ngrep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err + grep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err ' test_expect_success 'stdin -z create ref works' ' @@ -1338,7 +1338,7 @@ test_expect_success 'fails with duplicate HEAD update' ' update HEAD $B EOF test_must_fail git update-ref --stdin err && - test_i18ngrep "fatal: multiple updates for '\''HEAD'\'' (including one via its referent .refs/heads/target1.) are not allowed" err && + grep "fatal: multiple updates for '\''HEAD'\'' (including one via its referent .refs/heads/target1.) are not allowed" err && echo "refs/heads/target1" >expect && git symbolic-ref HEAD >actual && test_cmp expect actual && @@ -1355,7 +1355,7 @@ test_expect_success 'fails with duplicate ref update via symref' ' update refs/heads/symref2 $B EOF test_must_fail git update-ref --stdin err && - test_i18ngrep "fatal: multiple updates for '\''refs/heads/target2'\'' (including one via symref .refs/heads/symref2.) are not allowed" err && + grep "fatal: multiple updates for '\''refs/heads/target2'\'' (including one via symref .refs/heads/symref2.) are not allowed" err && echo "refs/heads/target2" >expect && git symbolic-ref refs/heads/symref2 >actual && test_cmp expect actual && diff --git a/t/t1430-bad-ref-name.sh b/t/t1430-bad-ref-name.sh index ff1c967d550318..4414ef4ea1555b 100755 --- a/t/t1430-bad-ref-name.sh +++ b/t/t1430-bad-ref-name.sh @@ -47,7 +47,7 @@ test_expect_success 'git branch shows badly named ref as warning' ' test-tool ref-store main update-ref msg "refs/heads/broken...ref" $main_sha1 $ZERO_OID REF_SKIP_REFNAME_VERIFICATION && test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...ref" && git branch >output 2>error && - test_i18ngrep -e "ignoring ref with broken name refs/heads/broken\.\.\.ref" error && + grep -e "ignoring ref with broken name refs/heads/broken\.\.\.ref" error && ! grep -e "broken\.\.\.ref" output ' @@ -158,7 +158,7 @@ test_expect_success 'rev-parse skips symref pointing to broken name' ' git rev-parse --verify one >expect && git rev-parse --verify shadow >actual 2>err && test_cmp expect actual && - test_i18ngrep "ignoring dangling symref refs/tags/shadow" err + grep "ignoring dangling symref refs/tags/shadow" err ' test_expect_success 'for-each-ref emits warnings for broken names' ' @@ -172,9 +172,9 @@ test_expect_success 'for-each-ref emits warnings for broken names' ' ! grep -e "broken\.\.\.ref" output && ! grep -e "badname" output && ! grep -e "broken\.\.\.symref" output && - test_i18ngrep "ignoring ref with broken name refs/heads/broken\.\.\.ref" error && - test_i18ngrep ! "ignoring broken ref refs/heads/badname" error && - test_i18ngrep "ignoring ref with broken name refs/heads/broken\.\.\.symref" error + grep "ignoring ref with broken name refs/heads/broken\.\.\.ref" error && + ! grep "ignoring broken ref refs/heads/badname" error && + grep "ignoring ref with broken name refs/heads/broken\.\.\.symref" error ' test_expect_success 'update-ref -d can delete broken name' ' @@ -192,7 +192,7 @@ test_expect_success 'branch -d can delete broken name' ' test-tool ref-store main update-ref msg "refs/heads/broken...ref" $main_sha1 $ZERO_OID REF_SKIP_REFNAME_VERIFICATION && test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...ref" && git branch -d broken...ref >output 2>error && - test_i18ngrep "Deleted branch broken...ref (was broken)" output && + grep "Deleted branch broken...ref (was broken)" output && test_must_be_empty error && git branch >output 2>error && ! grep -e "broken\.\.\.ref" error && @@ -218,7 +218,7 @@ test_expect_success 'branch -d can delete symref to broken name' ' test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/badname" && git branch -d badname >output 2>error && test_path_is_missing .git/refs/heads/badname && - test_i18ngrep "Deleted branch badname (was refs/heads/broken\.\.\.ref)" output && + grep "Deleted branch badname (was refs/heads/broken\.\.\.ref)" output && test_must_be_empty error ' @@ -236,7 +236,7 @@ test_expect_success 'branch -d can delete dangling symref to broken name' ' test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/badname" && git branch -d badname >output 2>error && test_path_is_missing .git/refs/heads/badname && - test_i18ngrep "Deleted branch badname (was refs/heads/broken\.\.\.ref)" output && + grep "Deleted branch badname (was refs/heads/broken\.\.\.ref)" output && test_must_be_empty error ' @@ -265,7 +265,7 @@ test_expect_success 'branch -d can delete symref with broken name' ' test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...symref" && git branch -d broken...symref >output 2>error && test_path_is_missing .git/refs/heads/broken...symref && - test_i18ngrep "Deleted branch broken...symref (was refs/heads/main)" output && + grep "Deleted branch broken...symref (was refs/heads/main)" output && test_must_be_empty error ' @@ -283,7 +283,7 @@ test_expect_success 'branch -d can delete dangling symref with broken name' ' test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...symref" && git branch -d broken...symref >output 2>error && test_path_is_missing .git/refs/heads/broken...symref && - test_i18ngrep "Deleted branch broken...symref (was refs/heads/idonotexist)" output && + grep "Deleted branch broken...symref (was refs/heads/idonotexist)" output && test_must_be_empty error ' @@ -292,7 +292,7 @@ test_expect_success 'update-ref -d cannot delete non-ref in .git dir' ' echo precious >expect && test_must_fail git update-ref -d my-private-file >output 2>error && test_must_be_empty output && - test_i18ngrep -e "refusing to update ref with bad name" error && + grep -e "refusing to update ref with bad name" error && test_cmp expect .git/my-private-file ' diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh index 84dd0cd26d02cb..bef5a10674e933 100755 --- a/t/t3206-range-diff.sh +++ b/t/t3206-range-diff.sh @@ -163,7 +163,7 @@ test_expect_success 'A^! and A^- (unmodified)' ' test_expect_success 'A^{/..} is not mistaken for a range' ' test_must_fail git range-diff topic^.. topic^{/..} -- 2>error && - test_i18ngrep "not a commit range" error + grep "not a commit range" error ' test_expect_success 'trivial reordering' ' @@ -505,7 +505,7 @@ do main..unmodified >actual && test_when_finished "rm 000?-*" && test_line_count = 5 actual && - test_i18ngrep "^Range-diff:$" 0000-* && + grep "^Range-diff:$" 0000-* && grep "= 1: .* s/5/A" 0000-* && grep "= 2: .* s/4/A" 0000-* && grep "= 3: .* s/11/B" 0000-* && @@ -517,7 +517,7 @@ test_expect_success 'format-patch --range-diff as commentary' ' git format-patch --range-diff=HEAD~1 HEAD~1 >actual && test_when_finished "rm 0001-*" && test_line_count = 1 actual && - test_i18ngrep "^Range-diff:$" 0001-* && + grep "^Range-diff:$" 0001-* && grep "> 1: .* new message" 0001-* ' @@ -525,7 +525,7 @@ test_expect_success 'format-patch --range-diff reroll-count with a non-integer' git format-patch --range-diff=HEAD~1 -v2.9 HEAD~1 >actual && test_when_finished "rm v2.9-0001-*" && test_line_count = 1 actual && - test_i18ngrep "^Range-diff:$" v2.9-0001-* && + grep "^Range-diff:$" v2.9-0001-* && grep "> 1: .* new message" v2.9-0001-* ' @@ -533,7 +533,7 @@ test_expect_success 'format-patch --range-diff reroll-count with a integer' ' git format-patch --range-diff=HEAD~1 -v2 HEAD~1 >actual && test_when_finished "rm v2-0001-*" && test_line_count = 1 actual && - test_i18ngrep "^Range-diff ..* v1:$" v2-0001-* && + grep "^Range-diff ..* v1:$" v2-0001-* && grep "> 1: .* new message" v2-0001-* ' @@ -541,7 +541,7 @@ test_expect_success 'format-patch --range-diff with v0' ' git format-patch --range-diff=HEAD~1 -v0 HEAD~1 >actual && test_when_finished "rm v0-0001-*" && test_line_count = 1 actual && - test_i18ngrep "^Range-diff:$" v0-0001-* && + grep "^Range-diff:$" v0-0001-* && grep "> 1: .* new message" v0-0001-* ' @@ -638,7 +638,7 @@ test_expect_success 'format-patch --range-diff does not compare notes by default main..unmodified >actual && test_when_finished "rm 000?-*" && test_line_count = 5 actual && - test_i18ngrep "^Range-diff:$" 0000-* && + grep "^Range-diff:$" 0000-* && grep "= 1: .* s/5/A" 0000-* && grep "= 2: .* s/4/A" 0000-* && grep "= 3: .* s/11/B" 0000-* && @@ -655,7 +655,7 @@ test_expect_success 'format-patch --range-diff with --no-notes' ' main..unmodified >actual && test_when_finished "rm 000?-*" && test_line_count = 5 actual && - test_i18ngrep "^Range-diff:$" 0000-* && + grep "^Range-diff:$" 0000-* && grep "= 1: .* s/5/A" 0000-* && grep "= 2: .* s/4/A" 0000-* && grep "= 3: .* s/11/B" 0000-* && @@ -672,7 +672,7 @@ test_expect_success 'format-patch --range-diff with --notes' ' main..unmodified >actual && test_when_finished "rm 000?-*" && test_line_count = 5 actual && - test_i18ngrep "^Range-diff:$" 0000-* && + grep "^Range-diff:$" 0000-* && grep "= 1: .* s/5/A" 0000-* && grep "= 2: .* s/4/A" 0000-* && grep "= 3: .* s/11/B" 0000-* && @@ -701,7 +701,7 @@ test_expect_success 'format-patch --range-diff with format.notes config' ' main..unmodified >actual && test_when_finished "rm 000?-*" && test_line_count = 5 actual && - test_i18ngrep "^Range-diff:$" 0000-* && + grep "^Range-diff:$" 0000-* && grep "= 1: .* s/5/A" 0000-* && grep "= 2: .* s/4/A" 0000-* && grep "= 3: .* s/11/B" 0000-* && @@ -732,7 +732,7 @@ test_expect_success 'format-patch --range-diff with multiple notes' ' main..unmodified >actual && test_when_finished "rm 000?-*" && test_line_count = 5 actual && - test_i18ngrep "^Range-diff:$" 0000-* && + grep "^Range-diff:$" 0000-* && grep "= 1: .* s/5/A" 0000-* && grep "= 2: .* s/4/A" 0000-* && grep "= 3: .* s/11/B" 0000-* && diff --git a/t/t4047-diff-dirstat.sh b/t/t4047-diff-dirstat.sh index 7fec2cb9cd783f..ad069511a6a763 100755 --- a/t/t4047-diff-dirstat.sh +++ b/t/t4047-diff-dirstat.sh @@ -941,37 +941,37 @@ test_expect_success '--dirstat=future_param,lines,0 should fail loudly' ' test_must_fail git diff --dirstat=future_param,lines,0 HEAD^..HEAD >actual_diff_dirstat 2>actual_error && test_debug "cat actual_error" && test_must_be_empty actual_diff_dirstat && - test_i18ngrep -q "future_param" actual_error && - test_i18ngrep -q "\--dirstat" actual_error + grep -q "future_param" actual_error && + grep -q "\--dirstat" actual_error ' test_expect_success '--dirstat=dummy1,cumulative,2dummy should report both unrecognized parameters' ' test_must_fail git diff --dirstat=dummy1,cumulative,2dummy HEAD^..HEAD >actual_diff_dirstat 2>actual_error && test_debug "cat actual_error" && test_must_be_empty actual_diff_dirstat && - test_i18ngrep -q "dummy1" actual_error && - test_i18ngrep -q "2dummy" actual_error && - test_i18ngrep -q "\--dirstat" actual_error + grep -q "dummy1" actual_error && + grep -q "2dummy" actual_error && + grep -q "\--dirstat" actual_error ' test_expect_success 'diff.dirstat=future_param,0,lines should warn, but still work' ' git -c diff.dirstat=future_param,0,lines diff --dirstat HEAD^..HEAD >actual_diff_dirstat 2>actual_error && test_debug "cat actual_error" && test_cmp expect_diff_dirstat actual_diff_dirstat && - test_i18ngrep -q "future_param" actual_error && - test_i18ngrep -q "diff\\.dirstat" actual_error && + grep -q "future_param" actual_error && + grep -q "diff\\.dirstat" actual_error && git -c diff.dirstat=future_param,0,lines diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M 2>actual_error && test_debug "cat actual_error" && test_cmp expect_diff_dirstat_M actual_diff_dirstat_M && - test_i18ngrep -q "future_param" actual_error && - test_i18ngrep -q "diff\\.dirstat" actual_error && + grep -q "future_param" actual_error && + grep -q "diff\\.dirstat" actual_error && git -c diff.dirstat=future_param,0,lines diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC 2>actual_error && test_debug "cat actual_error" && test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC && - test_i18ngrep -q "future_param" actual_error && - test_i18ngrep -q "diff\\.dirstat" actual_error + grep -q "future_param" actual_error && + grep -q "diff\\.dirstat" actual_error ' test_expect_success '--shortstat --dirstat should output only one dirstat' ' diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index 43b7bcd7159c25..60de90d5ce1379 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -1075,7 +1075,7 @@ test_expect_success 'remote prune to cause a dangling symref' ' cd eight && git remote prune origin ) >err 2>&1 && - test_i18ngrep "has become dangling" err && + grep "has become dangling" err && : And the dangling symref will not cause other annoying errors && ( @@ -1087,7 +1087,7 @@ test_expect_success 'remote prune to cause a dangling symref' ' cd eight && test_must_fail git branch nomore origin ) 2>err && - test_i18ngrep "dangling symref" err + grep "dangling symref" err ' test_expect_success 'show empty remote' ' @@ -1419,7 +1419,7 @@ test_expect_success 'extra args: setup' ' test_extra_arg () { test_expect_success "extra args: $*" " test_must_fail git remote $* bogus_extra_arg 2>actual && - test_i18ngrep '^usage:' actual + grep '^usage:' actual " } @@ -1453,12 +1453,12 @@ test_expect_success 'unqualified refspec DWIM and advice' ' oid=$(git rev-parse some-tag^{$type}) fi && test_must_fail git push origin $oid:dst 2>err && - test_i18ngrep "error: The destination you" err && - test_i18ngrep "hint: Did you mean" err && + grep "error: The destination you" err && + grep "hint: Did you mean" err && test_must_fail git -c advice.pushUnqualifiedRefName=false \ push origin $oid:dst 2>err && - test_i18ngrep "error: The destination you" err && - test_i18ngrep ! "hint: Did you mean" err || + grep "error: The destination you" err && + ! grep "hint: Did you mean" err || exit 1 done ) @@ -1479,16 +1479,16 @@ test_expect_success 'refs/remotes/* refspec and unqualified DWIM and git fetch --no-tags two && test_must_fail git push origin refs/remotes/two/another:dst 2>err && - test_i18ngrep "error: The destination you" err && + grep "error: The destination you" err && test_must_fail git push origin refs/remotes/tags-from-two/my-tag:dst-tag 2>err && - test_i18ngrep "error: The destination you" err && + grep "error: The destination you" err && test_must_fail git push origin refs/remotes/trees-from-two/my-head-tree:dst-tree 2>err && - test_i18ngrep "error: The destination you" err && + grep "error: The destination you" err && test_must_fail git push origin refs/remotes/blobs-from-two/my-file-blob:dst-blob 2>err && - test_i18ngrep "error: The destination you" err + grep "error: The destination you" err ) ' diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh index f519d2a87a7d84..ee02dec3f90945 100755 --- a/t/t5616-partial-clone.sh +++ b/t/t5616-partial-clone.sh @@ -347,14 +347,14 @@ test_expect_success 'upload-pack complains of bogus filter config' ' test_must_fail git \ -c uploadpackfilter.tree.maxdepth \ upload-pack . >/dev/null 2>err && - test_i18ngrep "unable to parse.*tree.maxdepth" err + grep "unable to parse.*tree.maxdepth" err ' test_expect_success 'upload-pack fails banned object filters' ' test_config -C srv.bare uploadpackfilter.blob:none.allow false && test_must_fail ok=sigpipe git clone --no-checkout --filter=blob:none \ "file://$(pwd)/srv.bare" pc3 2>err && - test_i18ngrep "filter '\''blob:none'\'' not supported" err + grep "filter '\''blob:none'\'' not supported" err ' test_expect_success 'upload-pack fails banned combine object filters' ' @@ -364,14 +364,14 @@ test_expect_success 'upload-pack fails banned combine object filters' ' test_config -C srv.bare uploadpackfilter.blob:none.allow false && test_must_fail ok=sigpipe git clone --no-checkout --filter=tree:1 \ --filter=blob:none "file://$(pwd)/srv.bare" pc3 2>err && - test_i18ngrep "filter '\''blob:none'\'' not supported" err + grep "filter '\''blob:none'\'' not supported" err ' test_expect_success 'upload-pack fails banned object filters with fallback' ' test_config -C srv.bare uploadpackfilter.allow false && test_must_fail ok=sigpipe git clone --no-checkout --filter=blob:none \ "file://$(pwd)/srv.bare" pc3 2>err && - test_i18ngrep "filter '\''blob:none'\'' not supported" err + grep "filter '\''blob:none'\'' not supported" err ' test_expect_success 'upload-pack limits tree depth filters' ' @@ -380,7 +380,7 @@ test_expect_success 'upload-pack limits tree depth filters' ' test_config -C srv.bare uploadpackfilter.tree.maxDepth 0 && test_must_fail ok=sigpipe git clone --no-checkout --filter=tree:1 \ "file://$(pwd)/srv.bare" pc3 2>err && - test_i18ngrep "tree filter allows max depth 0, but got 1" err && + grep "tree filter allows max depth 0, but got 1" err && git clone --no-checkout --filter=tree:0 "file://$(pwd)/srv.bare" pc4 && @@ -388,7 +388,7 @@ test_expect_success 'upload-pack limits tree depth filters' ' git clone --no-checkout --filter=tree:5 "file://$(pwd)/srv.bare" pc5 && test_must_fail ok=sigpipe git clone --no-checkout --filter=tree:6 \ "file://$(pwd)/srv.bare" pc6 2>err && - test_i18ngrep "tree filter allows max depth 5, but got 6" err + grep "tree filter allows max depth 5, but got 6" err ' test_expect_success 'partial clone fetches blobs pointed to by refs even if normally filtered out' ' @@ -453,11 +453,11 @@ test_expect_success 'partial clone with unresolvable sparse filter fails cleanly test_must_fail git clone --no-local --bare \ --filter=sparse:oid=main:no-such-name \ sparse-src dst.git 2>err && - test_i18ngrep "unable to access sparse blob in .main:no-such-name" err && + grep "unable to access sparse blob in .main:no-such-name" err && test_must_fail git clone --no-local --bare \ --filter=sparse:oid=main \ sparse-src dst.git 2>err && - test_i18ngrep "unable to parse sparse filter data in" err + grep "unable to parse sparse filter data in" err ' setup_triangle () { @@ -487,8 +487,8 @@ setup_triangle () { TREE_HASH=$(git -C server rev-parse HEAD~1^{tree}) && git -C promisor-remote fetch --keep "file://$(pwd)/server" "$TREE_HASH" && git -C promisor-remote count-objects -v >object-count && - test_i18ngrep "count: 0" object-count && - test_i18ngrep "in-pack: 2" object-count && + grep "count: 0" object-count && + grep "in-pack: 2" object-count && # Set it as the promisor remote of client. Thus, whenever # the client lazy fetches, the lazy fetch will succeed only if it is @@ -742,7 +742,7 @@ test_expect_success 'upon cloning, check that all refs point to objects' ' test_must_fail git -c protocol.version=2 clone \ --filter=blob:none $HTTPD_URL/one_time_perl/server repo 2>err && - test_i18ngrep "did not send all necessary objects" err && + grep "did not send all necessary objects" err && # Ensure that the one-time-perl script was used. ! test -e "$HTTPD_ROOT_PATH/one-time-perl" From e3e33b6359d0998a44a043d92e3d6c1f130c4571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 25 Feb 2022 13:15:57 +0100 Subject: [PATCH 2/7] tests with #12 test_i18ngrep: replace it with 'grep' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For those tests that have 12 occurances of 'test_i18ngrep', replace it with 'grep'. Splitting this incremental conversion by number of occurances in the file is arbitrary, but help so keep the commit size down. The 'test_i18ngrep' wrapper has been deprecated since d162b25f956 (tests: remove support for GIT_TEST_GETTEXT_POISON, 2021-01-20). Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t2406-worktree-repair.sh | 24 ++++++++++++------------ t/t6030-bisect-porcelain.sh | 24 ++++++++++++------------ t/t7508-status.sh | 24 ++++++++++++------------ t/t7612-merge-verify-signatures.sh | 24 ++++++++++++------------ 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/t/t2406-worktree-repair.sh b/t/t2406-worktree-repair.sh index 5c44453e1c1332..ba748e5367de41 100755 --- a/t/t2406-worktree-repair.sh +++ b/t/t2406-worktree-repair.sh @@ -24,7 +24,7 @@ test_expect_success 'worktree path not directory' ' >notdir && test_must_fail git worktree repair >out 2>err && test_must_be_empty out && - test_i18ngrep "not a directory" err + grep "not a directory" err ' test_expect_success "don't clobber .git repo" ' @@ -34,7 +34,7 @@ test_expect_success "don't clobber .git repo" ' test_create_repo repo && test_must_fail git worktree repair >out 2>err && test_must_be_empty out && - test_i18ngrep ".git is not a file" err + grep ".git is not a file" err ' test_corrupt_gitfile () { @@ -46,7 +46,7 @@ test_corrupt_gitfile () { git -C corrupt rev-parse --absolute-git-dir >expect && eval "$butcher" && git -C "$repairdir" worktree repair 2>err && - test_i18ngrep "$problem" err && + grep "$problem" err && git -C corrupt rev-parse --absolute-git-dir >actual && test_cmp expect actual } @@ -92,7 +92,7 @@ test_expect_success 'repair .git file from bare.git' ' test_expect_success 'invalid worktree path' ' test_must_fail git worktree repair /notvalid >out 2>err && test_must_be_empty out && - test_i18ngrep "not a valid path" err + grep "not a valid path" err ' test_expect_success 'repo not found; .git not file' ' @@ -100,7 +100,7 @@ test_expect_success 'repo not found; .git not file' ' test_create_repo not-a-worktree && test_must_fail git worktree repair not-a-worktree >out 2>err && test_must_be_empty out && - test_i18ngrep ".git is not a file" err + grep ".git is not a file" err ' test_expect_success 'repo not found; .git not referencing repo' ' @@ -110,7 +110,7 @@ test_expect_success 'repo not found; .git not referencing repo' ' mv side/.newgit side/.git && mkdir not-a-repo && test_must_fail git worktree repair side 2>err && - test_i18ngrep ".git file does not reference a repository" err + grep ".git file does not reference a repository" err ' test_expect_success 'repo not found; .git file broken' ' @@ -120,7 +120,7 @@ test_expect_success 'repo not found; .git file broken' ' mv orig moved && test_must_fail git worktree repair moved >out 2>err && test_must_be_empty out && - test_i18ngrep ".git file broken" err + grep ".git file broken" err ' test_expect_success 'repair broken gitdir' ' @@ -131,7 +131,7 @@ test_expect_success 'repair broken gitdir' ' mv orig moved && git worktree repair moved 2>err && test_cmp expect .git/worktrees/orig/gitdir && - test_i18ngrep "gitdir unreadable" err + grep "gitdir unreadable" err ' test_expect_success 'repair incorrect gitdir' ' @@ -141,7 +141,7 @@ test_expect_success 'repair incorrect gitdir' ' mv orig moved && git worktree repair moved 2>err && test_cmp expect .git/worktrees/orig/gitdir && - test_i18ngrep "gitdir incorrect" err + grep "gitdir incorrect" err ' test_expect_success 'repair gitdir (implicit) from linked worktree' ' @@ -151,7 +151,7 @@ test_expect_success 'repair gitdir (implicit) from linked worktree' ' mv orig moved && git -C moved worktree repair 2>err && test_cmp expect .git/worktrees/orig/gitdir && - test_i18ngrep "gitdir incorrect" err + grep "gitdir incorrect" err ' test_expect_success 'unable to repair gitdir (implicit) from main worktree' ' @@ -176,8 +176,8 @@ test_expect_success 'repair multiple gitdir files' ' git worktree repair moved1 moved2 2>err && test_cmp expect1 .git/worktrees/orig1/gitdir && test_cmp expect2 .git/worktrees/orig2/gitdir && - test_i18ngrep "gitdir incorrect:.*orig1/gitdir$" err && - test_i18ngrep "gitdir incorrect:.*orig2/gitdir$" err + grep "gitdir incorrect:.*orig1/gitdir$" err && + grep "gitdir incorrect:.*orig2/gitdir$" err ' test_expect_success 'repair moved main and linked worktrees' ' diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh index 3ba4fdf6153b69..af49dcdc850e73 100755 --- a/t/t6030-bisect-porcelain.sh +++ b/t/t6030-bisect-porcelain.sh @@ -197,7 +197,7 @@ test_expect_success 'bisect start: existing ".git/BISECT_START" not modified if cp .git/BISECT_START saved && test_must_fail git bisect start $HASH4 foo -- && git branch > branch.output && - test_i18ngrep "* (no branch, bisect started on other)" branch.output > /dev/null && + grep "* (no branch, bisect started on other)" branch.output > /dev/null && test_cmp saved .git/BISECT_START ' test_expect_success 'bisect start: no ".git/BISECT_START" if mistaken rev' ' @@ -565,7 +565,7 @@ test_expect_success 'bisect starting with a detached HEAD' ' test_expect_success 'bisect errors out if bad and good are mistaken' ' git bisect reset && test_must_fail git bisect start $HASH2 $HASH4 2> rev_list_error && - test_i18ngrep "mistook good and bad" rev_list_error && + grep "mistook good and bad" rev_list_error && git bisect reset ' @@ -607,7 +607,7 @@ test_expect_success 'side branch creation' ' test_expect_success 'good merge base when good and bad are siblings' ' git bisect start "$HASH7" "$SIDE_HASH7" > my_bisect_log.txt && - test_i18ngrep "merge base must be tested" my_bisect_log.txt && + grep "merge base must be tested" my_bisect_log.txt && grep $HASH4 my_bisect_log.txt && git bisect good > my_bisect_log.txt && ! grep "merge base must be tested" my_bisect_log.txt && @@ -616,7 +616,7 @@ test_expect_success 'good merge base when good and bad are siblings' ' ' test_expect_success 'skipped merge base when good and bad are siblings' ' git bisect start "$SIDE_HASH7" "$HASH7" > my_bisect_log.txt && - test_i18ngrep "merge base must be tested" my_bisect_log.txt && + grep "merge base must be tested" my_bisect_log.txt && grep $HASH4 my_bisect_log.txt && git bisect skip > my_bisect_log.txt 2>&1 && grep "warning" my_bisect_log.txt && @@ -626,11 +626,11 @@ test_expect_success 'skipped merge base when good and bad are siblings' ' test_expect_success 'bad merge base when good and bad are siblings' ' git bisect start "$HASH7" HEAD > my_bisect_log.txt && - test_i18ngrep "merge base must be tested" my_bisect_log.txt && + grep "merge base must be tested" my_bisect_log.txt && grep $HASH4 my_bisect_log.txt && test_must_fail git bisect bad > my_bisect_log.txt 2>&1 && - test_i18ngrep "merge base $HASH4 is bad" my_bisect_log.txt && - test_i18ngrep "fixed between $HASH4 and \[$SIDE_HASH7\]" my_bisect_log.txt && + grep "merge base $HASH4 is bad" my_bisect_log.txt && + grep "fixed between $HASH4 and \[$SIDE_HASH7\]" my_bisect_log.txt && git bisect reset ' @@ -681,9 +681,9 @@ test_expect_success '"git bisect run --first-parent" simple case' ' test_expect_success 'good merge bases when good and bad are siblings' ' git bisect start "$B_HASH" "$A_HASH" > my_bisect_log.txt && - test_i18ngrep "merge base must be tested" my_bisect_log.txt && + grep "merge base must be tested" my_bisect_log.txt && git bisect good > my_bisect_log2.txt && - test_i18ngrep "merge base must be tested" my_bisect_log2.txt && + grep "merge base must be tested" my_bisect_log2.txt && { { grep "$SIDE_HASH5" my_bisect_log.txt && @@ -698,14 +698,14 @@ test_expect_success 'good merge bases when good and bad are siblings' ' test_expect_success 'optimized merge base checks' ' git bisect start "$HASH7" "$SIDE_HASH7" > my_bisect_log.txt && - test_i18ngrep "merge base must be tested" my_bisect_log.txt && + grep "merge base must be tested" my_bisect_log.txt && grep "$HASH4" my_bisect_log.txt && git bisect good > my_bisect_log2.txt && test -f ".git/BISECT_ANCESTORS_OK" && test "$HASH6" = $(git rev-parse --verify HEAD) && git bisect bad && git bisect good "$A_HASH" > my_bisect_log4.txt && - test_i18ngrep "merge base must be tested" my_bisect_log4.txt && + grep "merge base must be tested" my_bisect_log4.txt && test_path_is_missing ".git/BISECT_ANCESTORS_OK" ' @@ -783,7 +783,7 @@ test_expect_success 'skipping away from skipped commit' ' test_expect_success 'erroring out when using bad path arguments' ' test_must_fail git bisect start $PARA_HASH7 $HASH1 -- foobar 2> error.txt && - test_i18ngrep "bad path arguments" error.txt + grep "bad path arguments" error.txt ' test_expect_success 'test bisection on bare repo - --no-checkout specified' ' diff --git a/t/t7508-status.sh b/t/t7508-status.sh index aed07c5b622e9a..9c7b471cb31f28 100755 --- a/t/t7508-status.sh +++ b/t/t7508-status.sh @@ -18,7 +18,7 @@ test_expect_success 'status -h in broken repository' ' echo "[status] showuntrackedfiles = CORRUPT" >>.git/config && test_expect_code 129 git status -h >usage 2>&1 ) && - test_i18ngrep "[Uu]sage" broken/usage + grep "[Uu]sage" broken/usage ' test_expect_success 'commit -h in broken repository' ' @@ -30,7 +30,7 @@ test_expect_success 'commit -h in broken repository' ' echo "[status] showuntrackedfiles = CORRUPT" >>.git/config && test_expect_code 129 git commit -h >usage 2>&1 ) && - test_i18ngrep "[Uu]sage" broken/usage + grep "[Uu]sage" broken/usage ' test_expect_success 'create upstream branch' ' @@ -71,7 +71,7 @@ test_expect_success 'setup' ' ' test_expect_success 'status (1)' ' - test_i18ngrep "use \"git rm --cached \.\.\.\" to unstage" output + grep "use \"git rm --cached \.\.\.\" to unstage" output ' strip_comments () { @@ -1542,12 +1542,12 @@ test_expect_success 'git commit will commit a staged but ignored submodule' ' git config --add -f .gitmodules submodule.subname.path sm && git config --add submodule.subname.ignore all && git status -s --ignore-submodules=dirty >output && - test_i18ngrep "^M. sm" output && + grep "^M. sm" output && GIT_EDITOR="echo hello >>\"\$1\"" && export GIT_EDITOR && git commit -uno && git status -s --ignore-submodules=dirty >output && - test_i18ngrep ! "^M. sm" output + ! grep "^M. sm" output ' test_expect_success 'git commit --dry-run will show a staged but ignored submodule' ' @@ -1573,13 +1573,13 @@ EOF git commit -uno --dry-run >output && test_cmp expect output && git status -s --ignore-submodules=dirty >output && - test_i18ngrep "^M. sm" output + grep "^M. sm" output ' test_expect_success 'git commit -m will commit a staged but ignored submodule' ' git commit -uno -m message && git status -s --ignore-submodules=dirty >output && - test_i18ngrep ! "^M. sm" output && + ! grep "^M. sm" output && git config --remove-section submodule.subname && git config -f .gitmodules --remove-section submodule.subname ' @@ -1592,7 +1592,7 @@ test_expect_success 'show stash info with "--show-stash"' ' git stash && git status >expected_default && git status --show-stash >expected_with_stash && - test_i18ngrep "^Your stash currently has 1 entry$" expected_with_stash + grep "^Your stash currently has 1 entry$" expected_with_stash ' test_expect_success 'no stash info with "--show-stash --no-show-stash"' ' @@ -1619,14 +1619,14 @@ test_expect_success 'no additional info if no stash entries' ' test_expect_success '"No commits yet" should be noted in status output' ' git checkout --orphan empty-branch-1 && git status >output && - test_i18ngrep "No commits yet" output + grep "No commits yet" output ' test_expect_success '"No commits yet" should not be noted in status output' ' git checkout --orphan empty-branch-2 && test_commit test-commit-1 && git status >output && - test_i18ngrep ! "No commits yet" output + ! grep "No commits yet" output ' test_expect_success '"Initial commit" should be noted in commit template' ' @@ -1634,7 +1634,7 @@ test_expect_success '"Initial commit" should be noted in commit template' ' touch to_be_committed_1 && git add to_be_committed_1 && git commit --dry-run >output && - test_i18ngrep "Initial commit" output + grep "Initial commit" output ' test_expect_success '"Initial commit" should not be noted in commit template' ' @@ -1643,7 +1643,7 @@ test_expect_success '"Initial commit" should not be noted in commit template' ' touch to_be_committed_2 && git add to_be_committed_2 && git commit --dry-run >output && - test_i18ngrep ! "Initial commit" output + ! grep "Initial commit" output ' test_expect_success '--no-optional-locks prevents index update' ' diff --git a/t/t7612-merge-verify-signatures.sh b/t/t7612-merge-verify-signatures.sh index 61330f71b1749c..2b3c1158f7a81e 100755 --- a/t/t7612-merge-verify-signatures.sh +++ b/t/t7612-merge-verify-signatures.sh @@ -40,54 +40,54 @@ test_expect_success GPG 'create signed commits' ' test_expect_success GPG 'merge unsigned commit with verification' ' test_when_finished "git reset --hard && git checkout initial" && test_must_fail git merge --ff-only --verify-signatures side-unsigned 2>mergeerror && - test_i18ngrep "does not have a GPG signature" mergeerror + grep "does not have a GPG signature" mergeerror ' test_expect_success GPG 'merge unsigned commit with merge.verifySignatures=true' ' test_when_finished "git reset --hard && git checkout initial" && test_config merge.verifySignatures true && test_must_fail git merge --ff-only side-unsigned 2>mergeerror && - test_i18ngrep "does not have a GPG signature" mergeerror + grep "does not have a GPG signature" mergeerror ' test_expect_success GPG 'merge commit with bad signature with verification' ' test_when_finished "git reset --hard && git checkout initial" && test_must_fail git merge --ff-only --verify-signatures $(cat forged.commit) 2>mergeerror && - test_i18ngrep "has a bad GPG signature" mergeerror + grep "has a bad GPG signature" mergeerror ' test_expect_success GPG 'merge commit with bad signature with merge.verifySignatures=true' ' test_when_finished "git reset --hard && git checkout initial" && test_config merge.verifySignatures true && test_must_fail git merge --ff-only $(cat forged.commit) 2>mergeerror && - test_i18ngrep "has a bad GPG signature" mergeerror + grep "has a bad GPG signature" mergeerror ' test_expect_success GPG 'merge commit with untrusted signature with verification' ' test_when_finished "git reset --hard && git checkout initial" && test_must_fail git merge --ff-only --verify-signatures side-untrusted 2>mergeerror && - test_i18ngrep "has an untrusted GPG signature" mergeerror + grep "has an untrusted GPG signature" mergeerror ' test_expect_success GPG 'merge commit with untrusted signature with verification and high minTrustLevel' ' test_when_finished "git reset --hard && git checkout initial" && test_config gpg.minTrustLevel marginal && test_must_fail git merge --ff-only --verify-signatures side-untrusted 2>mergeerror && - test_i18ngrep "has an untrusted GPG signature" mergeerror + grep "has an untrusted GPG signature" mergeerror ' test_expect_success GPG 'merge commit with untrusted signature with verification and low minTrustLevel' ' test_when_finished "git reset --hard && git checkout initial" && test_config gpg.minTrustLevel undefined && git merge --ff-only --verify-signatures side-untrusted >mergeoutput && - test_i18ngrep "has a good GPG signature" mergeoutput + grep "has a good GPG signature" mergeoutput ' test_expect_success GPG 'merge commit with untrusted signature with merge.verifySignatures=true' ' test_when_finished "git reset --hard && git checkout initial" && test_config merge.verifySignatures true && test_must_fail git merge --ff-only side-untrusted 2>mergeerror && - test_i18ngrep "has an untrusted GPG signature" mergeerror + grep "has an untrusted GPG signature" mergeerror ' test_expect_success GPG 'merge commit with untrusted signature with merge.verifySignatures=true and minTrustLevel' ' @@ -95,20 +95,20 @@ test_expect_success GPG 'merge commit with untrusted signature with merge.verify test_config merge.verifySignatures true && test_config gpg.minTrustLevel marginal && test_must_fail git merge --ff-only side-untrusted 2>mergeerror && - test_i18ngrep "has an untrusted GPG signature" mergeerror + grep "has an untrusted GPG signature" mergeerror ' test_expect_success GPG 'merge signed commit with verification' ' test_when_finished "git reset --hard && git checkout initial" && git merge --verbose --ff-only --verify-signatures side-signed >mergeoutput && - test_i18ngrep "has a good GPG signature" mergeoutput + grep "has a good GPG signature" mergeoutput ' test_expect_success GPG 'merge signed commit with merge.verifySignatures=true' ' test_when_finished "git reset --hard && git checkout initial" && test_config merge.verifySignatures true && git merge --verbose --ff-only side-signed >mergeoutput && - test_i18ngrep "has a good GPG signature" mergeoutput + grep "has a good GPG signature" mergeoutput ' test_expect_success GPG 'merge commit with bad signature without verification' ' @@ -132,7 +132,7 @@ test_expect_success GPG 'merge unsigned commit into unborn branch' ' test_when_finished "git checkout initial" && git checkout --orphan unborn && test_must_fail git merge --verify-signatures side-unsigned 2>mergeerror && - test_i18ngrep "does not have a GPG signature" mergeerror + grep "does not have a GPG signature" mergeerror ' test_done From b896fb8f2f127eb5ea8490ce0aadffc79ac2b7fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 25 Feb 2022 13:15:57 +0100 Subject: [PATCH 3/7] tests with #13 test_i18ngrep: replace it with 'grep' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For those tests that have 13 occurances of 'test_i18ngrep', replace it with 'grep'. Splitting this incremental conversion by number of occurances in the file is arbitrary, but help so keep the commit size down. The 'test_i18ngrep' wrapper has been deprecated since d162b25f956 (tests: remove support for GIT_TEST_GETTEXT_POISON, 2021-01-20). Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t5504-fetch-receive-strict.sh | 26 +++++++++++++------------- t/t5573-pull-verify-signatures.sh | 26 +++++++++++++------------- t/t9300-fast-import.sh | 26 +++++++++++++------------- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh index 88d3c56750accc..c2a14d18710072 100755 --- a/t/t5504-fetch-receive-strict.sh +++ b/t/t5504-fetch-receive-strict.sh @@ -143,7 +143,7 @@ test_expect_success 'setup bogus commit' ' test_expect_success 'fsck with no skipList input' ' test_must_fail git fsck 2>err && - test_i18ngrep "missingEmail" err + grep "missingEmail" err ' test_expect_success 'setup sorted and unsorted skipLists' ' @@ -168,9 +168,9 @@ test_expect_success 'fsck with unsorted skipList' ' test_expect_success 'fsck with invalid or bogus skipList input' ' git -c fsck.skipList=/dev/null -c fsck.missingEmail=ignore fsck && test_must_fail git -c fsck.skipList=does-not-exist -c fsck.missingEmail=ignore fsck 2>err && - test_i18ngrep "could not open.*: does-not-exist" err && + grep "could not open.*: does-not-exist" err && test_must_fail git -c fsck.skipList=.git/config -c fsck.missingEmail=ignore fsck 2>err && - test_i18ngrep "invalid object name: \[core\]" err + grep "invalid object name: \[core\]" err ' test_expect_success 'fsck with other accepted skipList input (comments & empty lines)' ' @@ -179,14 +179,14 @@ test_expect_success 'fsck with other accepted skipList input (comments & empty l $(test_oid 001) EOF test_must_fail git -c fsck.skipList=SKIP.with-comment fsck 2>err-with-comment && - test_i18ngrep "missingEmail" err-with-comment && + grep "missingEmail" err-with-comment && cat >SKIP.with-empty-line <<-EOF && $(test_oid 001) $(test_oid 002) EOF test_must_fail git -c fsck.skipList=SKIP.with-empty-line fsck 2>err-with-empty-line && - test_i18ngrep "missingEmail" err-with-empty-line + grep "missingEmail" err-with-empty-line ' test_expect_success 'fsck no garbage output from comments & empty lines errors' ' @@ -197,7 +197,7 @@ test_expect_success 'fsck no garbage output from comments & empty lines errors' test_expect_success 'fsck with invalid abbreviated skipList input' ' echo $commit | test_copy_bytes 20 >SKIP.abbreviated && test_must_fail git -c fsck.skipList=SKIP.abbreviated fsck 2>err-abbreviated && - test_i18ngrep "^fatal: invalid object name: " err-abbreviated + grep "^fatal: invalid object name: " err-abbreviated ' test_expect_success 'fsck with exhaustive accepted skipList input (various types of comments etc.)' ' @@ -230,10 +230,10 @@ test_expect_success 'push with receive.fsck.skipList' ' test_must_fail git push --porcelain dst bogus && git --git-dir=dst/.git config receive.fsck.skipList does-not-exist && test_must_fail git push --porcelain dst bogus 2>err && - test_i18ngrep "could not open.*: does-not-exist" err && + grep "could not open.*: does-not-exist" err && git --git-dir=dst/.git config receive.fsck.skipList config && test_must_fail git push --porcelain dst bogus 2>err && - test_i18ngrep "invalid object name: \[core\]" err && + grep "invalid object name: \[core\]" err && git --git-dir=dst/.git config receive.fsck.skipList SKIP && git push --porcelain dst bogus @@ -259,10 +259,10 @@ test_expect_success 'fetch with fetch.fsck.skipList' ' test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec && git --git-dir=dst/.git config fetch.fsck.skipList does-not-exist && test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec 2>err && - test_i18ngrep "could not open.*: does-not-exist" err && + grep "could not open.*: does-not-exist" err && git --git-dir=dst/.git config fetch.fsck.skipList dst/.git/config && test_must_fail git --git-dir=dst/.git fetch "file://$(pwd)" $refspec 2>err && - test_i18ngrep "invalid object name: \[core\]" err && + grep "invalid object name: \[core\]" err && git --git-dir=dst/.git config fetch.fsck.skipList dst/.git/SKIP && git --git-dir=dst/.git fetch "file://$(pwd)" $refspec @@ -270,7 +270,7 @@ test_expect_success 'fetch with fetch.fsck.skipList' ' test_expect_success 'fsck. dies' ' test_must_fail git -c fsck.whatEver=ignore fsck 2>err && - test_i18ngrep "Unhandled message id: whatever" err + grep "Unhandled message id: whatever" err ' test_expect_success 'push with receive.fsck.missingEmail=warn' ' @@ -292,7 +292,7 @@ test_expect_success 'push with receive.fsck.missingEmail=warn' ' receive.fsck.missingEmail warn && git push --porcelain dst bogus >act 2>&1 && grep "missingEmail" act && - test_i18ngrep "skipping unknown msg id.*whatever" act && + grep "skipping unknown msg id.*whatever" act && git --git-dir=dst/.git branch -D bogus && git --git-dir=dst/.git config --add \ receive.fsck.missingEmail ignore && @@ -320,7 +320,7 @@ test_expect_success 'fetch with fetch.fsck.missingEmail=warn' ' fetch.fsck.missingEmail warn && git --git-dir=dst/.git fetch "file://$(pwd)" $refspec >act 2>&1 && grep "missingEmail" act && - test_i18ngrep "Skipping unknown msg id.*whatever" act && + grep "Skipping unknown msg id.*whatever" act && rm -rf dst && git init dst && git --git-dir=dst/.git config fetch.fsckobjects true && diff --git a/t/t5573-pull-verify-signatures.sh b/t/t5573-pull-verify-signatures.sh index a53dd8550d0b8c..c1fd649c909548 100755 --- a/t/t5573-pull-verify-signatures.sh +++ b/t/t5573-pull-verify-signatures.sh @@ -45,46 +45,46 @@ test_expect_success GPG 'create repositories with signed commits' ' test_expect_success GPG 'pull unsigned commit with --verify-signatures' ' test_when_finished "git reset --hard && git checkout initial" && test_must_fail git pull --ff-only --verify-signatures unsigned 2>pullerror && - test_i18ngrep "does not have a GPG signature" pullerror + grep "does not have a GPG signature" pullerror ' test_expect_success GPG 'pull commit with bad signature with --verify-signatures' ' test_when_finished "git reset --hard && git checkout initial" && test_must_fail git pull --ff-only --verify-signatures bad 2>pullerror && - test_i18ngrep "has a bad GPG signature" pullerror + grep "has a bad GPG signature" pullerror ' test_expect_success GPG 'pull commit with untrusted signature with --verify-signatures' ' test_when_finished "git reset --hard && git checkout initial" && test_must_fail git pull --ff-only --verify-signatures untrusted 2>pullerror && - test_i18ngrep "has an untrusted GPG signature" pullerror + grep "has an untrusted GPG signature" pullerror ' test_expect_success GPG 'pull commit with untrusted signature with --verify-signatures and minTrustLevel=ultimate' ' test_when_finished "git reset --hard && git checkout initial" && test_config gpg.minTrustLevel ultimate && test_must_fail git pull --ff-only --verify-signatures untrusted 2>pullerror && - test_i18ngrep "has an untrusted GPG signature" pullerror + grep "has an untrusted GPG signature" pullerror ' test_expect_success GPG 'pull commit with untrusted signature with --verify-signatures and minTrustLevel=marginal' ' test_when_finished "git reset --hard && git checkout initial" && test_config gpg.minTrustLevel marginal && test_must_fail git pull --ff-only --verify-signatures untrusted 2>pullerror && - test_i18ngrep "has an untrusted GPG signature" pullerror + grep "has an untrusted GPG signature" pullerror ' test_expect_success GPG 'pull commit with untrusted signature with --verify-signatures and minTrustLevel=undefined' ' test_when_finished "git reset --hard && git checkout initial" && test_config gpg.minTrustLevel undefined && git pull --ff-only --verify-signatures untrusted >pulloutput && - test_i18ngrep "has a good GPG signature" pulloutput + grep "has a good GPG signature" pulloutput ' test_expect_success GPG 'pull signed commit with --verify-signatures' ' test_when_finished "git reset --hard && git checkout initial" && git pull --verify-signatures signed >pulloutput && - test_i18ngrep "has a good GPG signature" pulloutput + grep "has a good GPG signature" pulloutput ' test_expect_success GPG 'pull commit with bad signature without verification' ' @@ -104,7 +104,7 @@ test_expect_success GPG 'pull unsigned commit into unborn branch' ' git init empty-repo && test_must_fail \ git -C empty-repo pull --verify-signatures .. 2>pullerror && - test_i18ngrep "does not have a GPG signature" pullerror + grep "does not have a GPG signature" pullerror ' test_expect_success GPG 'pull commit into unborn branch with bad signature and --verify-signatures' ' @@ -112,7 +112,7 @@ test_expect_success GPG 'pull commit into unborn branch with bad signature and - git init empty-repo && test_must_fail \ git -C empty-repo pull --ff-only --verify-signatures ../bad 2>pullerror && - test_i18ngrep "has a bad GPG signature" pullerror + grep "has a bad GPG signature" pullerror ' test_expect_success GPG 'pull commit into unborn branch with untrusted signature and --verify-signatures' ' @@ -120,7 +120,7 @@ test_expect_success GPG 'pull commit into unborn branch with untrusted signature git init empty-repo && test_must_fail \ git -C empty-repo pull --ff-only --verify-signatures ../untrusted 2>pullerror && - test_i18ngrep "has an untrusted GPG signature" pullerror + grep "has an untrusted GPG signature" pullerror ' test_expect_success GPG 'pull commit into unborn branch with untrusted signature and --verify-signatures and minTrustLevel=ultimate' ' @@ -129,7 +129,7 @@ test_expect_success GPG 'pull commit into unborn branch with untrusted signature test_config_global gpg.minTrustLevel ultimate && test_must_fail \ git -C empty-repo pull --ff-only --verify-signatures ../untrusted 2>pullerror && - test_i18ngrep "has an untrusted GPG signature" pullerror + grep "has an untrusted GPG signature" pullerror ' test_expect_success GPG 'pull commit into unborn branch with untrusted signature and --verify-signatures and minTrustLevel=marginal' ' @@ -138,7 +138,7 @@ test_expect_success GPG 'pull commit into unborn branch with untrusted signature test_config_global gpg.minTrustLevel marginal && test_must_fail \ git -C empty-repo pull --ff-only --verify-signatures ../untrusted 2>pullerror && - test_i18ngrep "has an untrusted GPG signature" pullerror + grep "has an untrusted GPG signature" pullerror ' test_expect_success GPG 'pull commit into unborn branch with untrusted signature and --verify-signatures and minTrustLevel=undefined' ' @@ -146,7 +146,7 @@ test_expect_success GPG 'pull commit into unborn branch with untrusted signature git init empty-repo && test_config_global gpg.minTrustLevel undefined && git -C empty-repo pull --ff-only --verify-signatures ../untrusted >pulloutput && - test_i18ngrep "has a good GPG signature" pulloutput + grep "has a good GPG signature" pulloutput ' test_done diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index aa55b41b9a97ea..760da15bb875a1 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -2884,7 +2884,7 @@ test_expect_success 'S: filemodify with garbage after mark must fail' ' COMMIT M 100644 :403x hello.c EOF - test_i18ngrep "space after mark" err + grep "space after mark" err ' # inline is misspelled; fast-import thinks it is some unknown dataref @@ -2900,7 +2900,7 @@ test_expect_success 'S: filemodify with garbage after inline must fail' ' inline BLOB EOF - test_i18ngrep "nvalid dataref" err + grep "nvalid dataref" err ' test_expect_success 'S: filemodify with garbage after sha1 must fail' ' @@ -2913,7 +2913,7 @@ test_expect_success 'S: filemodify with garbage after sha1 must fail' ' COMMIT M 100644 ${sha1}x hello.c EOF - test_i18ngrep "space after SHA1" err + grep "space after SHA1" err ' # @@ -2928,7 +2928,7 @@ test_expect_success 'S: notemodify with garbage after mark dataref must fail' ' COMMIT N :202x :302 EOF - test_i18ngrep "space after mark" err + grep "space after mark" err ' test_expect_success 'S: notemodify with garbage after inline dataref must fail' ' @@ -2943,7 +2943,7 @@ test_expect_success 'S: notemodify with garbage after inline dataref must fail' note blob BLOB EOF - test_i18ngrep "nvalid dataref" err + grep "nvalid dataref" err ' test_expect_success 'S: notemodify with garbage after sha1 dataref must fail' ' @@ -2956,7 +2956,7 @@ test_expect_success 'S: notemodify with garbage after sha1 dataref must fail' ' COMMIT N ${sha1}x :302 EOF - test_i18ngrep "space after SHA1" err + grep "space after SHA1" err ' # @@ -2971,7 +2971,7 @@ test_expect_success 'S: notemodify with garbage after mark commit-ish must fail' COMMIT N :202 :302x EOF - test_i18ngrep "after mark" err + grep "after mark" err ' # @@ -3004,7 +3004,7 @@ test_expect_success 'S: from with garbage after mark must fail' ' EOF # now evaluate the error - test_i18ngrep "after mark" err + grep "after mark" err ' @@ -3023,7 +3023,7 @@ test_expect_success 'S: merge with garbage after mark must fail' ' merge :303x M 100644 :403 hello.c EOF - test_i18ngrep "after mark" err + grep "after mark" err ' # @@ -3038,7 +3038,7 @@ test_expect_success 'S: tag with garbage after mark must fail' ' tag S TAG EOF - test_i18ngrep "after mark" err + grep "after mark" err ' # @@ -3048,7 +3048,7 @@ test_expect_success 'S: cat-blob with garbage after mark must fail' ' test_must_fail git fast-import --import-marks=marks <<-EOF 2>err && cat-blob :403x EOF - test_i18ngrep "after mark" err + grep "after mark" err ' # @@ -3058,7 +3058,7 @@ test_expect_success 'S: ls with garbage after mark must fail' ' test_must_fail git fast-import --import-marks=marks <<-EOF 2>err && ls :302x hello.c EOF - test_i18ngrep "space after mark" err + grep "space after mark" err ' test_expect_success 'S: ls with garbage after sha1 must fail' ' @@ -3066,7 +3066,7 @@ test_expect_success 'S: ls with garbage after sha1 must fail' ' test_must_fail git fast-import --import-marks=marks <<-EOF 2>err && ls ${sha1}x hello.c EOF - test_i18ngrep "space after tree-ish" err + grep "space after tree-ish" err ' ### From a9bf64e16797a13ea8dca31293357877ede385f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 25 Feb 2022 13:15:57 +0100 Subject: [PATCH 4/7] tests with #14 test_i18ngrep: replace it with 'grep' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For those tests that have 14 occurances of 'test_i18ngrep', replace it with 'grep'. Splitting this incremental conversion by number of occurances in the file is arbitrary, but help so keep the commit size down. The 'test_i18ngrep' wrapper has been deprecated since d162b25f956 (tests: remove support for GIT_TEST_GETTEXT_POISON, 2021-01-20). Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t4068-diff-symmetric-merge-base.sh | 28 ++++++++++++++-------------- t/t7506-status-submodule.sh | 28 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/t/t4068-diff-symmetric-merge-base.sh b/t/t4068-diff-symmetric-merge-base.sh index 2d650d8f1032ca..4d2862607c6da0 100755 --- a/t/t4068-diff-symmetric-merge-base.sh +++ b/t/t4068-diff-symmetric-merge-base.sh @@ -68,27 +68,27 @@ test_expect_success 'diff with two merge bases' ' test_expect_success 'diff with no merge bases' ' test_must_fail git diff br2...br3 2>err && - test_i18ngrep "fatal: br2...br3: no merge base" err + grep "fatal: br2...br3: no merge base" err ' test_expect_success 'diff with too many symmetric differences' ' test_must_fail git diff br1...main br2...br3 2>err && - test_i18ngrep "usage" err + grep "usage" err ' test_expect_success 'diff with symmetric difference and extraneous arg' ' test_must_fail git diff main br1...main 2>err && - test_i18ngrep "usage" err + grep "usage" err ' test_expect_success 'diff with two ranges' ' test_must_fail git diff main br1..main br2..br3 2>err && - test_i18ngrep "usage" err + grep "usage" err ' test_expect_success 'diff with ranges and extra arg' ' test_must_fail git diff main br1..main commit-D 2>err && - test_i18ngrep "usage" err + grep "usage" err ' test_expect_success 'diff --merge-base with no commits' ' @@ -97,7 +97,7 @@ test_expect_success 'diff --merge-base with no commits' ' test_expect_success 'diff --merge-base with three commits' ' test_must_fail git diff --merge-base br1 br2 main 2>err && - test_i18ngrep "usage" err + grep "usage" err ' for cmd in diff-index diff @@ -143,19 +143,19 @@ do test_expect_success "$cmd --merge-base with non-commit" ' git checkout main && test_must_fail git $cmd --merge-base main^{tree} 2>err && - test_i18ngrep "fatal: --merge-base only works with commits" err + grep "fatal: --merge-base only works with commits" err ' test_expect_success "$cmd --merge-base with no merge bases and one commit" ' git checkout main && test_must_fail git $cmd --merge-base br3 2>err && - test_i18ngrep "fatal: no merge base found" err + grep "fatal: no merge base found" err ' test_expect_success "$cmd --merge-base with multiple merge bases and one commit" ' git checkout main && test_must_fail git $cmd --merge-base br1 2>err && - test_i18ngrep "fatal: multiple merge bases found" err + grep "fatal: multiple merge bases found" err ' done @@ -169,28 +169,28 @@ do test_expect_success "$cmd --merge-base commit and non-commit" ' test_must_fail git $cmd --merge-base br2 main^{tree} 2>err && - test_i18ngrep "fatal: --merge-base only works with commits" err + grep "fatal: --merge-base only works with commits" err ' test_expect_success "$cmd --merge-base with no merge bases and two commits" ' test_must_fail git $cmd --merge-base br2 br3 2>err && - test_i18ngrep "fatal: no merge base found" err + grep "fatal: no merge base found" err ' test_expect_success "$cmd --merge-base with multiple merge bases and two commits" ' test_must_fail git $cmd --merge-base main br1 2>err && - test_i18ngrep "fatal: multiple merge bases found" err + grep "fatal: multiple merge bases found" err ' done test_expect_success 'diff-tree --merge-base with one commit' ' test_must_fail git diff-tree --merge-base main 2>err && - test_i18ngrep "fatal: --merge-base only works with two commits" err + grep "fatal: --merge-base only works with two commits" err ' test_expect_success 'diff --merge-base with range' ' test_must_fail git diff --merge-base br2..br3 2>err && - test_i18ngrep "fatal: --merge-base does not work with ranges" err + grep "fatal: --merge-base does not work with ranges" err ' test_done diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh index d050091345b392..68724b0428cb76 100755 --- a/t/t7506-status-submodule.sh +++ b/t/t7506-status-submodule.sh @@ -37,19 +37,19 @@ test_expect_success 'setup' ' test_expect_success 'status clean' ' git status >output && - test_i18ngrep "nothing to commit" output + grep "nothing to commit" output ' test_expect_success 'commit --dry-run -a clean' ' test_must_fail git commit --dry-run -a >output && - test_i18ngrep "nothing to commit" output + grep "nothing to commit" output ' test_expect_success 'status with modified file in submodule' ' (cd sub && git reset --hard) && echo "changed" >sub/foo && git status >output && - test_i18ngrep "modified: sub (modified content)" output + grep "modified: sub (modified content)" output ' test_expect_success 'status with modified file in submodule (porcelain)' ' @@ -73,7 +73,7 @@ test_expect_success 'status with modified file in submodule (short)' ' test_expect_success 'status with added file in submodule' ' (cd sub && git reset --hard && echo >foo && git add foo) && git status >output && - test_i18ngrep "modified: sub (modified content)" output + grep "modified: sub (modified content)" output ' test_expect_success 'status with added file in submodule (porcelain)' ' @@ -96,12 +96,12 @@ test_expect_success 'status with untracked file in submodule' ' (cd sub && git reset --hard) && echo "content" >sub/new-file && git status >output && - test_i18ngrep "modified: sub (untracked content)" output + grep "modified: sub (untracked content)" output ' test_expect_success 'status -uno with untracked file in submodule' ' git status -uno >output && - test_i18ngrep "^nothing to commit" output + grep "^nothing to commit" output ' test_expect_success 'status with untracked file in submodule (porcelain)' ' @@ -122,7 +122,7 @@ test_expect_success 'status with added and untracked file in submodule' ' (cd sub && git reset --hard && echo >foo && git add foo) && echo "content" >sub/new-file && git status >output && - test_i18ngrep "modified: sub (modified content, untracked content)" output + grep "modified: sub (modified content, untracked content)" output ' test_expect_success 'status with added and untracked file in submodule (porcelain)' ' @@ -140,7 +140,7 @@ test_expect_success 'status with modified file in modified submodule' ' (cd sub && echo "next change" >foo && git commit -m "next change" foo) && echo "changed" >sub/foo && git status >output && - test_i18ngrep "modified: sub (new commits, modified content)" output + grep "modified: sub (new commits, modified content)" output ' test_expect_success 'status with modified file in modified submodule (porcelain)' ' @@ -155,7 +155,7 @@ test_expect_success 'status with modified file in modified submodule (porcelain) test_expect_success 'status with added file in modified submodule' ' (cd sub && git reset --hard && echo >foo && git add foo) && git status >output && - test_i18ngrep "modified: sub (new commits, modified content)" output + grep "modified: sub (new commits, modified content)" output ' test_expect_success 'status with added file in modified submodule (porcelain)' ' @@ -170,7 +170,7 @@ test_expect_success 'status with untracked file in modified submodule' ' (cd sub && git reset --hard) && echo "content" >sub/new-file && git status >output && - test_i18ngrep "modified: sub (new commits, untracked content)" output + grep "modified: sub (new commits, untracked content)" output ' test_expect_success 'status with untracked file in modified submodule (porcelain)' ' @@ -184,7 +184,7 @@ test_expect_success 'status with added and untracked file in modified submodule' (cd sub && git reset --hard && echo >foo && git add foo) && echo "content" >sub/new-file && git status >output && - test_i18ngrep "modified: sub (new commits, modified content, untracked content)" output + grep "modified: sub (new commits, modified content, untracked content)" output ' test_expect_success 'status with added and untracked file in modified submodule (porcelain)' ' @@ -209,7 +209,7 @@ test_expect_success 'setup .git file for sub' ' test_expect_success 'status with added file in modified submodule with .git file' ' (cd sub && git reset --hard && echo >foo && git add foo) && git status >output && - test_i18ngrep "modified: sub (new commits, modified content)" output + grep "modified: sub (new commits, modified content)" output ' test_expect_success 'status with a lot of untracked files in the submodule' ' @@ -234,12 +234,12 @@ test_expect_success 'rm submodule contents' ' test_expect_success 'status clean (empty submodule dir)' ' git status >output && - test_i18ngrep "nothing to commit" output + grep "nothing to commit" output ' test_expect_success 'status -a clean (empty submodule dir)' ' test_must_fail git commit --dry-run -a >output && - test_i18ngrep "nothing to commit" output + grep "nothing to commit" output ' cat >status_expect <<\EOF From 05e7a178ce7c722b35c782af5b1c5ba9e80530d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 25 Feb 2022 13:15:57 +0100 Subject: [PATCH 5/7] tests with #15 test_i18ngrep: replace it with 'grep' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For those tests that have 15 occurances of 'test_i18ngrep', replace it with 'grep'. Splitting this incremental conversion by number of occurances in the file is arbitrary, but help so keep the commit size down. The 'test_i18ngrep' wrapper has been deprecated since d162b25f956 (tests: remove support for GIT_TEST_GETTEXT_POISON, 2021-01-20). Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t3403-rebase-skip.sh | 30 +++++++++++++++--------------- t/t7600-merge.sh | 30 +++++++++++++++--------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh index f6e48644978b63..87c800538ec9d6 100755 --- a/t/t3403-rebase-skip.sh +++ b/t/t3403-rebase-skip.sh @@ -108,10 +108,10 @@ test_expect_success 'correct advice upon picking empty commit' ' test_when_finished "git rebase --abort" && test_must_fail git rebase -i --onto goodbye \ amended-goodbye^ amended-goodbye 2>err && - test_i18ngrep "previous cherry-pick is now empty" err && - test_i18ngrep "git rebase --skip" err && + grep "previous cherry-pick is now empty" err && + grep "git rebase --skip" err && test_must_fail git commit && - test_i18ngrep "git rebase --skip" err + grep "git rebase --skip" err ' test_expect_success 'correct authorship when committing empty pick' ' @@ -131,10 +131,10 @@ test_expect_success 'correct advice upon rewording empty commit' ' test_must_fail env FAKE_LINES="reword 1" git rebase -i \ --onto goodbye amended-goodbye^ amended-goodbye 2>err ) && - test_i18ngrep "previous cherry-pick is now empty" err && - test_i18ngrep "git rebase --skip" err && + grep "previous cherry-pick is now empty" err && + grep "git rebase --skip" err && test_must_fail git commit && - test_i18ngrep "git rebase --skip" err + grep "git rebase --skip" err ' test_expect_success 'correct advice upon editing empty commit' ' @@ -144,10 +144,10 @@ test_expect_success 'correct advice upon editing empty commit' ' test_must_fail env FAKE_LINES="edit 1" git rebase -i \ --onto goodbye amended-goodbye^ amended-goodbye 2>err ) && - test_i18ngrep "previous cherry-pick is now empty" err && - test_i18ngrep "git rebase --skip" err && + grep "previous cherry-pick is now empty" err && + grep "git rebase --skip" err && test_must_fail git commit && - test_i18ngrep "git rebase --skip" err + grep "git rebase --skip" err ' test_expect_success 'correct advice upon cherry-picking an empty commit during a rebase' ' @@ -157,10 +157,10 @@ test_expect_success 'correct advice upon cherry-picking an empty commit during a test_must_fail env FAKE_LINES="1 exec_git_cherry-pick_amended-goodbye" \ git rebase -i goodbye^ goodbye 2>err ) && - test_i18ngrep "previous cherry-pick is now empty" err && - test_i18ngrep "git cherry-pick --skip" err && + grep "previous cherry-pick is now empty" err && + grep "git cherry-pick --skip" err && test_must_fail git commit 2>err && - test_i18ngrep "git cherry-pick --skip" err + grep "git cherry-pick --skip" err ' test_expect_success 'correct advice upon multi cherry-pick picking an empty commit during a rebase' ' @@ -170,10 +170,10 @@ test_expect_success 'correct advice upon multi cherry-pick picking an empty comm test_must_fail env FAKE_LINES="1 exec_git_cherry-pick_goodbye_amended-goodbye" \ git rebase -i goodbye^^ goodbye 2>err ) && - test_i18ngrep "previous cherry-pick is now empty" err && - test_i18ngrep "git cherry-pick --skip" err && + grep "previous cherry-pick is now empty" err && + grep "git cherry-pick --skip" err && test_must_fail git commit 2>err && - test_i18ngrep "git cherry-pick --skip" err + grep "git cherry-pick --skip" err ' test_expect_success 'fixup that empties commit fails' ' diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh index 060e145957f3ad..b04b68abedcd3b 100755 --- a/t/t7600-merge.sh +++ b/t/t7600-merge.sh @@ -175,7 +175,7 @@ test_expect_success 'merge -h with invalid index' ' >.git/index && test_expect_code 129 git merge -h 2>usage ) && - test_i18ngrep "[Uu]sage: git merge" broken/usage + grep "[Uu]sage: git merge" broken/usage ' test_expect_success 'reject non-strategy with a git-merge-foo name' ' @@ -681,7 +681,7 @@ test_debug 'git log --graph --decorate --oneline --all' test_expect_success 'in-index merge' ' git reset --hard c0 && git merge --no-ff -s resolve c1 >out && - test_i18ngrep "Wonderful." out && + grep "Wonderful." out && verify_parents $c0 $c1 ' @@ -697,7 +697,7 @@ test_expect_success 'merge with --autostash' ' git reset --hard c1 && git merge-file file file.orig file.9 && git merge --autostash c2 2>err && - test_i18ngrep "Applied autostash." err && + grep "Applied autostash." err && git show HEAD:file >merge-result && test_cmp result.1-5 merge-result && test_cmp result.1-5-9 file @@ -708,7 +708,7 @@ test_expect_success 'merge with merge.autoStash' ' git reset --hard c1 && git merge-file file file.orig file.9 && git merge c2 2>err && - test_i18ngrep "Applied autostash." err && + grep "Applied autostash." err && git show HEAD:file >merge-result && test_cmp result.1-5 merge-result && test_cmp result.1-5-9 file @@ -718,7 +718,7 @@ test_expect_success 'fast-forward merge with --autostash' ' git reset --hard c0 && git merge-file file file.orig file.5 && git merge --autostash c1 2>err && - test_i18ngrep "Applied autostash." err && + grep "Applied autostash." err && test_cmp result.1-5 file ' @@ -728,7 +728,7 @@ test_expect_success 'failed fast-forward merge with --autostash' ' cp file.5 other && test_when_finished "rm other" && test_must_fail git merge --autostash c1 2>err && - test_i18ngrep "Applied autostash." err && + grep "Applied autostash." err && test_cmp file.5 file ' @@ -736,7 +736,7 @@ test_expect_success 'octopus merge with --autostash' ' git reset --hard c1 && git merge-file file file.orig file.3 && git merge --autostash c2 c3 2>err && - test_i18ngrep "Applied autostash." err && + grep "Applied autostash." err && git show HEAD:file >merge-result && test_cmp result.1-5-9 merge-result && test_cmp result.1-3-5-9 file @@ -746,7 +746,7 @@ test_expect_success 'failed merge (exit 2) with --autostash' ' git reset --hard c1 && git merge-file file file.orig file.5 && test_must_fail git merge -s recursive --autostash c2 c3 2>err && - test_i18ngrep "Applied autostash." err && + grep "Applied autostash." err && test_cmp result.1-5 file ' @@ -755,7 +755,7 @@ test_expect_success 'conflicted merge with --autostash, --abort restores stash' cp file.1 file && test_must_fail git merge --autostash c7 && git merge --abort 2>err && - test_i18ngrep "Applied autostash." err && + grep "Applied autostash." err && test_cmp file.1 file ' @@ -767,7 +767,7 @@ test_expect_success 'completed merge (git commit) with --no-commit and --autosta git stash show -p MERGE_AUTOSTASH >actual && test_cmp expect actual && git commit 2>err && - test_i18ngrep "Applied autostash." err && + grep "Applied autostash." err && git show HEAD:file >merge-result && test_cmp result.1-5 merge-result && test_cmp result.1-5-9 file @@ -781,7 +781,7 @@ test_expect_success 'completed merge (git merge --continue) with --no-commit and git stash show -p MERGE_AUTOSTASH >actual && test_cmp expect actual && git merge --continue 2>err && - test_i18ngrep "Applied autostash." err && + grep "Applied autostash." err && git show HEAD:file >merge-result && test_cmp result.1-5 merge-result && test_cmp result.1-5-9 file @@ -795,7 +795,7 @@ test_expect_success 'aborted merge (merge --abort) with --no-commit and --autost git stash show -p MERGE_AUTOSTASH >actual && test_cmp expect actual && git merge --abort 2>err && - test_i18ngrep "Applied autostash." err && + grep "Applied autostash." err && git diff >actual && test_cmp expect actual ' @@ -808,7 +808,7 @@ test_expect_success 'aborted merge (reset --hard) with --no-commit and --autosta git stash show -p MERGE_AUTOSTASH >actual && test_cmp expect actual && git reset --hard 2>err && - test_i18ngrep "Autostash exists; creating a new stash entry." err && + grep "Autostash exists; creating a new stash entry." err && git diff --exit-code ' @@ -821,7 +821,7 @@ test_expect_success 'quit merge with --no-commit and --autostash' ' test_cmp expect actual && git diff HEAD >expect && git merge --quit 2>err && - test_i18ngrep "Autostash exists; creating a new stash entry." err && + grep "Autostash exists; creating a new stash entry." err && git diff HEAD >actual && test_cmp expect actual ' @@ -832,7 +832,7 @@ test_expect_success 'merge with conflicted --autostash changes' ' git diff >expect && test_when_finished "test_might_fail git stash drop" && git merge --autostash c3 2>err && - test_i18ngrep "Applying autostash resulted in conflicts." err && + grep "Applying autostash resulted in conflicts." err && git show HEAD:file >merge-result && test_cmp result.1-9 merge-result && git stash show -p >actual && From 78a371e22f150e9bd5e5404ec4dc03f23055c32c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 25 Feb 2022 13:15:57 +0100 Subject: [PATCH 6/7] tests with #16 test_i18ngrep: replace it with 'grep' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For those tests that have 16 occurances of 'test_i18ngrep', replace it with 'grep'. Splitting this incremental conversion by number of occurances in the file is arbitrary, but help so keep the commit size down. The 'test_i18ngrep' wrapper has been deprecated since d162b25f956 (tests: remove support for GIT_TEST_GETTEXT_POISON, 2021-01-20). Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t0028-working-tree-encoding.sh | 32 ++++++++++++++++---------------- t/t0041-usage.sh | 32 ++++++++++++++++---------------- t/t7502-commit-porcelain.sh | 32 ++++++++++++++++---------------- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh index c196fdb0ee21a2..a3affa7e023fc6 100755 --- a/t/t0028-working-tree-encoding.sh +++ b/t/t0028-working-tree-encoding.sh @@ -92,23 +92,23 @@ do # In these cases the BOM is prohibited. cp bebom.utf${i}be.raw bebom.utf${i}be && test_must_fail git add bebom.utf${i}be 2>err.out && - test_i18ngrep "fatal: BOM is prohibited .* utf-${i}be" err.out && - test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out && + grep "fatal: BOM is prohibited .* utf-${i}be" err.out && + grep "use UTF-${i} as working-tree-encoding" err.out && cp lebom.utf${i}le.raw lebom.utf${i}be && test_must_fail git add lebom.utf${i}be 2>err.out && - test_i18ngrep "fatal: BOM is prohibited .* utf-${i}be" err.out && - test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out && + grep "fatal: BOM is prohibited .* utf-${i}be" err.out && + grep "use UTF-${i} as working-tree-encoding" err.out && cp bebom.utf${i}be.raw bebom.utf${i}le && test_must_fail git add bebom.utf${i}le 2>err.out && - test_i18ngrep "fatal: BOM is prohibited .* utf-${i}LE" err.out && - test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out && + grep "fatal: BOM is prohibited .* utf-${i}LE" err.out && + grep "use UTF-${i} as working-tree-encoding" err.out && cp lebom.utf${i}le.raw lebom.utf${i}le && test_must_fail git add lebom.utf${i}le 2>err.out && - test_i18ngrep "fatal: BOM is prohibited .* utf-${i}LE" err.out && - test_i18ngrep "use UTF-${i} as working-tree-encoding" err.out + grep "fatal: BOM is prohibited .* utf-${i}LE" err.out && + grep "use UTF-${i} as working-tree-encoding" err.out ' test_expect_success "check required UTF-${i} BOM" ' @@ -118,13 +118,13 @@ do cp nobom.utf${i}be.raw nobom.utf${i} && test_must_fail git add nobom.utf${i} 2>err.out && - test_i18ngrep "fatal: BOM is required .* utf-${i}" err.out && - test_i18ngrep "use UTF-${i}BE or UTF-${i}LE" err.out && + grep "fatal: BOM is required .* utf-${i}" err.out && + grep "use UTF-${i}BE or UTF-${i}LE" err.out && cp nobom.utf${i}le.raw nobom.utf${i} && test_must_fail git add nobom.utf${i} 2>err.out && - test_i18ngrep "fatal: BOM is required .* utf-${i}" err.out && - test_i18ngrep "use UTF-${i}BE or UTF-${i}LE" err.out + grep "fatal: BOM is required .* utf-${i}" err.out && + grep "use UTF-${i}BE or UTF-${i}LE" err.out ' test_expect_success "eol conversion for UTF-${i} encoded files on checkout" ' @@ -169,7 +169,7 @@ test_expect_success 'check unsupported encodings' ' echo "*.set text working-tree-encoding" >.gitattributes && printf "set" >t.set && test_must_fail git add t.set 2>err.out && - test_i18ngrep "true/false are no valid working-tree-encodings" err.out && + grep "true/false are no valid working-tree-encodings" err.out && echo "*.unset text -working-tree-encoding" >.gitattributes && printf "unset" >t.unset && @@ -182,7 +182,7 @@ test_expect_success 'check unsupported encodings' ' echo "*.garbage text working-tree-encoding=garbage" >.gitattributes && printf "garbage" >t.garbage && test_must_fail git add t.garbage 2>err.out && - test_i18ngrep "failed to encode" err.out + grep "failed to encode" err.out ' test_expect_success 'error if encoding round trip is not the same during refresh' ' @@ -201,7 +201,7 @@ test_expect_success 'error if encoding round trip is not the same during refresh git update-ref refs/heads/main $COMMIT && test_must_fail git checkout HEAD^ 2>err.out && - test_i18ngrep "error: .* overwritten by checkout:" err.out + grep "error: .* overwritten by checkout:" err.out ' test_expect_success 'error if encoding garbage is already in Git' ' @@ -217,7 +217,7 @@ test_expect_success 'error if encoding garbage is already in Git' ' git update-ref refs/heads/main $COMMIT && git diff 2>err.out && - test_i18ngrep "error: BOM is required" err.out + grep "error: BOM is required" err.out ' test_lazy_prereq ICONV_SHIFT_JIS ' diff --git a/t/t0041-usage.sh b/t/t0041-usage.sh index c4fc34eb18eb14..5ba71740197654 100755 --- a/t/t0041-usage.sh +++ b/t/t0041-usage.sh @@ -20,8 +20,8 @@ test_expect_success 'tag --contains ' ' test_expect_success 'tag --contains ' ' test_must_fail git tag --contains "notag" >actual 2>actual.err && test_line_count = 0 actual && - test_i18ngrep "error" actual.err && - test_i18ngrep ! "usage" actual.err + grep "error" actual.err && + ! grep "usage" actual.err ' test_expect_success 'tag --no-contains ' ' @@ -33,27 +33,27 @@ test_expect_success 'tag --no-contains ' ' test_expect_success 'tag --no-contains ' ' test_must_fail git tag --no-contains "notag" >actual 2>actual.err && test_line_count = 0 actual && - test_i18ngrep "error" actual.err && - test_i18ngrep ! "usage" actual.err + grep "error" actual.err && + ! grep "usage" actual.err ' test_expect_success 'tag usage error' ' test_must_fail git tag --noopt >actual 2>actual.err && test_line_count = 0 actual && - test_i18ngrep "usage" actual.err + grep "usage" actual.err ' test_expect_success 'branch --contains ' ' git branch --contains "main" >actual 2>actual.err && - test_i18ngrep "main" actual && + grep "main" actual && test_line_count = 0 actual.err ' test_expect_success 'branch --contains ' ' test_must_fail git branch --no-contains "nocommit" >actual 2>actual.err && test_line_count = 0 actual && - test_i18ngrep "error" actual.err && - test_i18ngrep ! "usage" actual.err + grep "error" actual.err && + ! grep "usage" actual.err ' test_expect_success 'branch --no-contains ' ' @@ -65,14 +65,14 @@ test_expect_success 'branch --no-contains ' ' test_expect_success 'branch --no-contains ' ' test_must_fail git branch --no-contains "nocommit" >actual 2>actual.err && test_line_count = 0 actual && - test_i18ngrep "error" actual.err && - test_i18ngrep ! "usage" actual.err + grep "error" actual.err && + ! grep "usage" actual.err ' test_expect_success 'branch usage error' ' test_must_fail git branch --noopt >actual 2>actual.err && test_line_count = 0 actual && - test_i18ngrep "usage" actual.err + grep "usage" actual.err ' test_expect_success 'for-each-ref --contains ' ' @@ -84,8 +84,8 @@ test_expect_success 'for-each-ref --contains ' ' test_expect_success 'for-each-ref --contains ' ' test_must_fail git for-each-ref --no-contains "noobject" >actual 2>actual.err && test_line_count = 0 actual && - test_i18ngrep "error" actual.err && - test_i18ngrep ! "usage" actual.err + grep "error" actual.err && + ! grep "usage" actual.err ' test_expect_success 'for-each-ref --no-contains ' ' @@ -97,14 +97,14 @@ test_expect_success 'for-each-ref --no-contains ' ' test_expect_success 'for-each-ref --no-contains ' ' test_must_fail git for-each-ref --no-contains "noobject" >actual 2>actual.err && test_line_count = 0 actual && - test_i18ngrep "error" actual.err && - test_i18ngrep ! "usage" actual.err + grep "error" actual.err && + ! grep "usage" actual.err ' test_expect_success 'for-each-ref usage error' ' test_must_fail git for-each-ref --noopt >actual 2>actual.err && test_line_count = 0 actual && - test_i18ngrep "usage" actual.err + grep "usage" actual.err ' test_done diff --git a/t/t7502-commit-porcelain.sh b/t/t7502-commit-porcelain.sh index 38a532d81ccd06..b49d7e7f4763e3 100755 --- a/t/t7502-commit-porcelain.sh +++ b/t/t7502-commit-porcelain.sh @@ -687,14 +687,14 @@ test_expect_success 'cleanup commit message (whitespace config, -m)' ' test_expect_success 'message shows author when it is not equal to committer' ' echo >>negative && git commit -e -m "sample" -a && - test_i18ngrep \ + grep \ "^# Author: *A U Thor \$" \ .git/COMMIT_EDITMSG ' test_expect_success 'message shows date when it is explicitly set' ' git commit --allow-empty -e -m foo --date="2010-01-02T03:04:05" && - test_i18ngrep \ + grep \ "^# Date: *Sat Jan 2 03:04:05 2010 +0000" \ .git/COMMIT_EDITMSG ' @@ -709,7 +709,7 @@ test_expect_success AUTOIDENT 'message shows committer when it is automatic' ' ) && # the ident is calculated from the system, so we cannot # check the actual value, only that it is there - test_i18ngrep "^# Committer: " .git/COMMIT_EDITMSG + grep "^# Committer: " .git/COMMIT_EDITMSG ' write_script .git/FAKE_EDITOR < Date: Fri, 25 Feb 2022 13:15:57 +0100 Subject: [PATCH 7/7] tests with #17 test_i18ngrep: replace it with 'grep' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For those tests that have 17 occurances of 'test_i18ngrep', replace it with 'grep'. Splitting this incremental conversion by number of occurances in the file is arbitrary, but help so keep the commit size down. The 'test_i18ngrep' wrapper has been deprecated since d162b25f956 (tests: remove support for GIT_TEST_GETTEXT_POISON, 2021-01-20). Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t1506-rev-parse-diagnosis.sh | 34 +++++++++++++++++----------------- t/t4001-diff-rename.sh | 34 +++++++++++++++++----------------- t/t5520-pull.sh | 34 +++++++++++++++++----------------- t/t5702-protocol-v2.sh | 34 +++++++++++++++++----------------- 4 files changed, 68 insertions(+), 68 deletions(-) diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh index 18688cae17d57e..d9d8f41442870d 100755 --- a/t/t1506-rev-parse-diagnosis.sh +++ b/t/t1506-rev-parse-diagnosis.sh @@ -107,16 +107,16 @@ test_expect_success 'correct relative file objects (6)' ' test_expect_success 'incorrect revision id' ' test_must_fail git rev-parse foobar:file.txt 2>error && - test_i18ngrep "invalid object name .foobar." error && + grep "invalid object name .foobar." error && test_must_fail git rev-parse foobar 2>error && - test_i18ngrep "unknown revision or path not in the working tree." error + grep "unknown revision or path not in the working tree." error ' test_expect_success 'incorrect file in sha1:path' ' test_must_fail git rev-parse HEAD:nothing.txt 2>error && - test_i18ngrep "path .nothing.txt. does not exist in .HEAD." error && + grep "path .nothing.txt. does not exist in .HEAD." error && test_must_fail git rev-parse HEAD:index-only.txt 2>error && - test_i18ngrep "path .index-only.txt. exists on disk, but not in .HEAD." error && + grep "path .index-only.txt. exists on disk, but not in .HEAD." error && (cd subdir && test_must_fail git rev-parse HEAD:file2.txt 2>error && test_did_you_mean HEAD subdir/ file2.txt exists ) @@ -124,9 +124,9 @@ test_expect_success 'incorrect file in sha1:path' ' test_expect_success 'incorrect file in :path and :N:path' ' test_must_fail git rev-parse :nothing.txt 2>error && - test_i18ngrep "path .nothing.txt. does not exist (neither on disk nor in the index)" error && + grep "path .nothing.txt. does not exist (neither on disk nor in the index)" error && test_must_fail git rev-parse :1:nothing.txt 2>error && - test_i18ngrep "path .nothing.txt. does not exist (neither on disk nor in the index)" error && + grep "path .nothing.txt. does not exist (neither on disk nor in the index)" error && test_must_fail git rev-parse :1:file.txt 2>error && test_did_you_mean ":0" "" file.txt "is in the index" "at stage 1" && (cd subdir && @@ -137,42 +137,42 @@ test_expect_success 'incorrect file in :path and :N:path' ' test_must_fail git rev-parse :2:file2.txt 2>error && test_did_you_mean :0 subdir/ file2.txt "is in the index") && test_must_fail git rev-parse :disk-only.txt 2>error && - test_i18ngrep "path .disk-only.txt. exists on disk, but not in the index" error + grep "path .disk-only.txt. exists on disk, but not in the index" error ' test_expect_success 'invalid @{n} reference' ' test_must_fail git rev-parse main@{99999} >output 2>error && test_must_be_empty output && - test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error && + grep "log for [^ ]* only has [0-9][0-9]* entries" error && test_must_fail git rev-parse --verify main@{99999} >output 2>error && test_must_be_empty output && - test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error + grep "log for [^ ]* only has [0-9][0-9]* entries" error ' test_expect_success 'relative path not found' ' ( cd subdir && test_must_fail git rev-parse HEAD:./nonexistent.txt 2>error && - test_i18ngrep subdir/nonexistent.txt error + grep subdir/nonexistent.txt error ) ' test_expect_success 'relative path outside worktree' ' test_must_fail git rev-parse HEAD:../file.txt >output 2>error && test_must_be_empty output && - test_i18ngrep "outside repository" error + grep "outside repository" error ' test_expect_success 'relative path when cwd is outside worktree' ' test_must_fail git --git-dir=.git --work-tree=subdir rev-parse HEAD:./file.txt >output 2>error && test_must_be_empty output && - test_i18ngrep "relative path syntax can.t be used outside working tree" error + grep "relative path syntax can.t be used outside working tree" error ' test_expect_success ':file correctly diagnosed after a pathname' ' test_must_fail git rev-parse file.txt HEAD:file.txt 1>actual 2>error && - test_i18ngrep ! "exists on disk" error && - test_i18ngrep "no such path in the working tree" error && + ! grep "exists on disk" error && + grep "no such path in the working tree" error && cat >expect <<-\EOF && file.txt HEAD:file.txt @@ -214,13 +214,13 @@ test_expect_success 'dotdot does not peel endpoints' ' test_expect_success 'arg before dashdash must be a revision (missing)' ' test_must_fail git rev-parse foobar -- 2>stderr && - test_i18ngrep "bad revision" stderr + grep "bad revision" stderr ' test_expect_success 'arg before dashdash must be a revision (file)' ' >foobar && test_must_fail git rev-parse foobar -- 2>stderr && - test_i18ngrep "bad revision" stderr + grep "bad revision" stderr ' test_expect_success 'arg before dashdash must be a revision (ambiguous)' ' @@ -269,7 +269,7 @@ test_expect_success 'arg after dashdash not interpreted as option' ' test_expect_success 'arg after end-of-options not interpreted as option' ' test_must_fail git rev-parse --end-of-options --not-real -- 2>err && - test_i18ngrep bad.revision.*--not-real err + grep bad.revision.*--not-real err ' test_expect_success 'end-of-options still allows --' ' diff --git a/t/t4001-diff-rename.sh b/t/t4001-diff-rename.sh index 3dc90470446dbb..13b5f320deecb6 100755 --- a/t/t4001-diff-rename.sh +++ b/t/t4001-diff-rename.sh @@ -135,25 +135,25 @@ test_expect_success 'favour same basenames over different ones' ' mkdir subdir && git mv another-path subdir/path1 && git status >out && - test_i18ngrep "renamed: .*path1 -> subdir/path1" out + grep "renamed: .*path1 -> subdir/path1" out ' test_expect_success 'test diff.renames=true for git status' ' git -c diff.renames=true status >out && - test_i18ngrep "renamed: .*path1 -> subdir/path1" out + grep "renamed: .*path1 -> subdir/path1" out ' test_expect_success 'test diff.renames=false for git status' ' git -c diff.renames=false status >out && - test_i18ngrep ! "renamed: .*path1 -> subdir/path1" out && - test_i18ngrep "new file: .*subdir/path1" out && - test_i18ngrep "deleted: .*[^/]path1" out + ! grep "renamed: .*path1 -> subdir/path1" out && + grep "new file: .*subdir/path1" out && + grep "deleted: .*[^/]path1" out ' test_expect_success 'favour same basenames even with minor differences' ' git show HEAD:path1 | sed "s/15/16/" > subdir/path1 && git status >out && - test_i18ngrep "renamed: .*path1 -> subdir/path1" out + grep "renamed: .*path1 -> subdir/path1" out ' test_expect_success 'two files with same basename and same content' ' @@ -165,7 +165,7 @@ test_expect_success 'two files with same basename and same content' ' git commit -m 2 && git mv dir other-dir && git status >out && - test_i18ngrep "renamed: .*dir/A/file -> other-dir/A/file" out + grep "renamed: .*dir/A/file -> other-dir/A/file" out ' test_expect_success 'setup for many rename source candidates' ' @@ -202,9 +202,9 @@ test_expect_success 'rename pretty print with nothing in common' ' git mv a/b/c c/b/a && git commit -m "a/b/c -> c/b/a" && git diff -M --summary HEAD^ HEAD >output && - test_i18ngrep " a/b/c => c/b/a " output && + grep " a/b/c => c/b/a " output && git diff -M --stat HEAD^ HEAD >output && - test_i18ngrep " a/b/c => c/b/a " output + grep " a/b/c => c/b/a " output ' test_expect_success 'rename pretty print with common prefix' ' @@ -212,9 +212,9 @@ test_expect_success 'rename pretty print with common prefix' ' git mv c/b/a c/d/e && git commit -m "c/b/a -> c/d/e" && git diff -M --summary HEAD^ HEAD >output && - test_i18ngrep " c/{b/a => d/e} " output && + grep " c/{b/a => d/e} " output && git diff -M --stat HEAD^ HEAD >output && - test_i18ngrep " c/{b/a => d/e} " output + grep " c/{b/a => d/e} " output ' test_expect_success 'rename pretty print with common suffix' ' @@ -222,9 +222,9 @@ test_expect_success 'rename pretty print with common suffix' ' git mv c/d/e d/e && git commit -m "c/d/e -> d/e" && git diff -M --summary HEAD^ HEAD >output && - test_i18ngrep " {c/d => d}/e " output && + grep " {c/d => d}/e " output && git diff -M --stat HEAD^ HEAD >output && - test_i18ngrep " {c/d => d}/e " output + grep " {c/d => d}/e " output ' test_expect_success 'rename pretty print with common prefix and suffix' ' @@ -232,9 +232,9 @@ test_expect_success 'rename pretty print with common prefix and suffix' ' git mv d/e d/f/e && git commit -m "d/e -> d/f/e" && git diff -M --summary HEAD^ HEAD >output && - test_i18ngrep " d/{ => f}/e " output && + grep " d/{ => f}/e " output && git diff -M --stat HEAD^ HEAD >output && - test_i18ngrep " d/{ => f}/e " output + grep " d/{ => f}/e " output ' test_expect_success 'rename pretty print common prefix and suffix overlap' ' @@ -242,9 +242,9 @@ test_expect_success 'rename pretty print common prefix and suffix overlap' ' git mv d/f/e d/f/f/e && git commit -m "d/f/e d/f/f/e" && git diff -M --summary HEAD^ HEAD >output && - test_i18ngrep " d/f/{ => f}/e " output && + grep " d/f/{ => f}/e " output && git diff -M --stat HEAD^ HEAD >output && - test_i18ngrep " d/f/{ => f}/e " output + grep " d/f/{ => f}/e " output ' test_expect_success 'diff-tree -l0 defaults to a big rename limit, not zero' ' diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index 0b72112fb10759..f249084517e211 100755 --- a/t/t5520-pull.sh +++ b/t/t5520-pull.sh @@ -31,7 +31,7 @@ test_pull_autostash_fail () { echo dirty >new_file && git add new_file && test_must_fail git pull "$@" . copy 2>err && - test_i18ngrep -E "uncommitted changes.|overwritten by merge:" err + grep -E "uncommitted changes.|overwritten by merge:" err } test_expect_success setup ' @@ -151,7 +151,7 @@ test_expect_success 'fail if wildcard spec does not match any refs' ' echo file >expect && test_cmp expect file && test_must_fail git pull . "refs/nonexisting1/*:refs/nonexisting2/*" 2>err && - test_i18ngrep "no candidates for merging" err && + grep "no candidates for merging" err && test_cmp expect file ' @@ -164,7 +164,7 @@ test_expect_success 'fail if no branches specified with non-default remote' ' test_cmp expect file && test_config branch.test.remote origin && test_must_fail git pull test_remote 2>err && - test_i18ngrep "specify a branch on the command line" err && + grep "specify a branch on the command line" err && test_cmp expect file ' @@ -176,7 +176,7 @@ test_expect_success 'fail if not on a branch' ' echo file >expect && test_cmp expect file && test_must_fail git pull 2>err && - test_i18ngrep "not currently on a branch" err && + grep "not currently on a branch" err && test_cmp expect file ' @@ -189,7 +189,7 @@ test_expect_success 'fail if no configuration for current branch' ' echo file >expect && test_cmp expect file && test_must_fail git pull 2>err && - test_i18ngrep "no tracking information" err && + grep "no tracking information" err && test_cmp expect file ' @@ -202,7 +202,7 @@ test_expect_success 'pull --all: fail if no configuration for current branch' ' echo file >expect && test_cmp expect file && test_must_fail git pull --all 2>err && - test_i18ngrep "There is no tracking information" err && + grep "There is no tracking information" err && test_cmp expect file ' @@ -214,7 +214,7 @@ test_expect_success 'fail if upstream branch does not exist' ' echo file >expect && test_cmp expect file && test_must_fail git pull 2>err && - test_i18ngrep "no such ref was fetched" err && + grep "no such ref was fetched" err && test_cmp expect file ' @@ -248,13 +248,13 @@ test_expect_success 'fail if the index has unresolved entries' ' test_file_not_empty unmerged && cp file expected && test_must_fail git pull . second 2>err && - test_i18ngrep "Pulling is not possible because you have unmerged files." err && + grep "Pulling is not possible because you have unmerged files." err && test_cmp expected file && git add file && git ls-files -u >unmerged && test_must_be_empty unmerged && test_must_fail git pull . second 2>err && - test_i18ngrep "You have not concluded your merge" err && + grep "You have not concluded your merge" err && test_cmp expected file ' @@ -264,7 +264,7 @@ test_expect_success 'fast-forwards working tree if branch head is updated' ' echo file >expect && test_cmp expect file && git pull . second:third 2>err && - test_i18ngrep "fetch updated the current branch head" err && + grep "fetch updated the current branch head" err && echo modified >expect && test_cmp expect file && test_cmp_rev third second @@ -277,7 +277,7 @@ test_expect_success 'fast-forward fails with conflicting work tree' ' test_cmp expect file && echo conflict >file && test_must_fail git pull . second:third 2>err && - test_i18ngrep "Cannot fast-forward your working tree" err && + grep "Cannot fast-forward your working tree" err && echo conflict >expect && test_cmp expect file && test_cmp_rev third second @@ -375,7 +375,7 @@ test_expect_success '--rebase with conflicts shows advice' ' test_tick && git commit -m "Create conflict" seq.txt && test_must_fail git pull --rebase . seq 2>err >out && - test_i18ngrep "Resolve all conflicts manually" err + grep "Resolve all conflicts manually" err ' test_expect_success 'failed --rebase shows advice' ' @@ -389,14 +389,14 @@ test_expect_success 'failed --rebase shows advice' ' git checkout -f -b fails-to-rebase HEAD^ && test_commit v2-without-cr file "2" file2-lf && test_must_fail git pull --rebase . diverging 2>err >out && - test_i18ngrep "Resolve all conflicts manually" err + grep "Resolve all conflicts manually" err ' test_expect_success '--rebase fails with multiple branches' ' git reset --hard before-rebase && test_must_fail git pull --rebase . copy main 2>err && test_cmp_rev HEAD before-rebase && - test_i18ngrep "Cannot rebase onto multiple branches" err && + grep "Cannot rebase onto multiple branches" err && echo modified >expect && git show HEAD:file >actual && test_cmp expect actual @@ -520,7 +520,7 @@ test_expect_success 'pull --rebase warns on --verify-signatures' ' echo new >expect && git show HEAD:file2 >actual && test_cmp expect actual && - test_i18ngrep "ignoring --verify-signatures for rebase" err + grep "ignoring --verify-signatures for rebase" err ' test_expect_success 'pull --rebase does not warn on --no-verify-signatures' ' @@ -530,7 +530,7 @@ test_expect_success 'pull --rebase does not warn on --no-verify-signatures' ' echo new >expect && git show HEAD:file2 >actual && test_cmp expect actual && - test_i18ngrep ! "verify-signatures" err + ! grep "verify-signatures" err ' # add a feature branch, keep-merge, that is merged into main, so the @@ -740,7 +740,7 @@ test_expect_success 'pull --rebase fails on unborn branch with staged changes' ' test_cmp expect actual && git show :staged-file >actual && test_cmp expect actual && - test_i18ngrep "unborn branch with changes added to the index" err + grep "unborn branch with changes added to the index" err ) ' diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh index e4db7513f42192..c50bfadee35f8d 100755 --- a/t/t5702-protocol-v2.sh +++ b/t/t5702-protocol-v2.sh @@ -189,8 +189,8 @@ test_expect_success 'warn if using server-option with ls-remote with legacy prot test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -c protocol.version=0 \ ls-remote -o hello -o world "file://$(pwd)/file_parent" main 2>err && - test_i18ngrep "see protocol.version in" err && - test_i18ngrep "server options require protocol version 2 or later" err + grep "see protocol.version in" err && + grep "server options require protocol version 2 or later" err ' test_expect_success 'clone with file:// using protocol v2' ' @@ -366,8 +366,8 @@ test_expect_success 'warn if using server-option with fetch with legacy protocol test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 git -C temp_child -c protocol.version=0 \ fetch -o hello -o world "file://$(pwd)/file_parent" main 2>err && - test_i18ngrep "see protocol.version in" err && - test_i18ngrep "server options require protocol version 2 or later" err + grep "see protocol.version in" err && + grep "server options require protocol version 2 or later" err ' test_expect_success 'server-options are sent when cloning' ' @@ -388,8 +388,8 @@ test_expect_success 'warn if using server-option with clone with legacy protocol clone --server-option=hello --server-option=world \ "file://$(pwd)/file_parent" myclone 2>err && - test_i18ngrep "see protocol.version in" err && - test_i18ngrep "server options require protocol version 2 or later" err + grep "see protocol.version in" err && + grep "server options require protocol version 2 or later" err ' test_expect_success 'upload-pack respects config using protocol v2' ' @@ -484,7 +484,7 @@ test_expect_success 'partial clone warns if filter is not advertised' ' git -C server config uploadpack.allowfilter 0 && git -c protocol.version=2 \ clone --filter=blob:none "file://$(pwd)/server" client 2>err && - test_i18ngrep "filtering not recognized by server, ignoring" err + grep "filtering not recognized by server, ignoring" err ' test_expect_success 'even with handcrafted request, filter does not work if not advertised' ' @@ -725,7 +725,7 @@ test_expect_success 'file:// --negotiate-only with protocol v0' ' --negotiate-only \ --negotiation-tip=$(git -C client rev-parse HEAD) \ origin 2>err && - test_i18ngrep "negotiate-only requires protocol v2" err + grep "negotiate-only requires protocol v2" err ' # Test protocol v2 with 'http://' transport @@ -771,7 +771,7 @@ test_expect_success 'clone repository with http:// using protocol v2 with incomp # Server responded using protocol v2 grep "git< version 2" log && # Client reported appropriate failure - test_i18ngrep "bytes of length header were received" err + grep "bytes of length header were received" err ' test_expect_success 'clone repository with http:// using protocol v2 with incomplete pktline body' ' @@ -788,7 +788,7 @@ test_expect_success 'clone repository with http:// using protocol v2 with incomp # Server responded using protocol v2 grep "git< version 2" log && # Client reported appropriate failure - test_i18ngrep "bytes of body are still expected" err + grep "bytes of body are still expected" err ' test_expect_success 'clone with http:// using protocol v2 and invalid parameters' ' @@ -935,7 +935,7 @@ test_expect_success 'when server sends "ready", expect DELIM' ' test_must_fail git -C http_child -c protocol.version=2 \ fetch "$HTTPD_URL/one_time_perl/http_parent" 2> err && - test_i18ngrep "expected packfile to be sent after .ready." err + grep "expected packfile to be sent after .ready." err ' test_expect_success 'when server does not send "ready", expect FLUSH' ' @@ -963,7 +963,7 @@ test_expect_success 'when server does not send "ready", expect FLUSH' ' fetch "$HTTPD_URL/one_time_perl/http_parent" 2> err && grep "fetch< .*acknowledgments" log && ! grep "fetch< .*ready" log && - test_i18ngrep "expected no other sections to be sent after no .ready." err + grep "expected no other sections to be sent after no .ready." err ' configure_exclusion () { @@ -1073,7 +1073,7 @@ test_expect_success 'fetching with valid packfile URI but invalid hash fails' ' git -c protocol.version=2 \ -c fetch.uriprotocols=http,https \ clone "$HTTPD_URL/smart/http_parent" http_child 2>err && - test_i18ngrep "pack downloaded from.*does not match expected hash" err + grep "pack downloaded from.*does not match expected hash" err ' test_expect_success 'packfile-uri with transfer.fsckobjects' ' @@ -1127,7 +1127,7 @@ test_expect_success 'packfile-uri with transfer.fsckobjects fails on bad object' test_must_fail git -c protocol.version=2 -c transfer.fsckobjects=1 \ -c fetch.uriprotocols=http,https \ clone "$HTTPD_URL/smart/http_parent" http_child 2>error && - test_i18ngrep "invalid author/committer line - missing email" error + grep "invalid author/committer line - missing email" error ' test_expect_success 'packfile-uri with transfer.fsckobjects succeeds when .gitmodules is separate from tree' ' @@ -1175,7 +1175,7 @@ test_expect_success 'packfile-uri with transfer.fsckobjects fails when .gitmodul test_must_fail git -c protocol.version=2 -c transfer.fsckobjects=1 \ -c fetch.uriprotocols=http,https \ clone "$HTTPD_URL/smart/http_parent" http_child 2>err && - test_i18ngrep "disallowed submodule name" err + grep "disallowed submodule name" err ' test_expect_success 'packfile-uri path redacted in trace' ' @@ -1258,7 +1258,7 @@ test_expect_success 'http:// --negotiate-only without wait-for-done support' ' --negotiate-only \ --negotiation-tip=$(git -C client rev-parse HEAD) \ origin 2>err && - test_i18ngrep "server does not support wait-for-done" err + grep "server does not support wait-for-done" err ' test_expect_success 'http:// --negotiate-only with protocol v0' ' @@ -1272,7 +1272,7 @@ test_expect_success 'http:// --negotiate-only with protocol v0' ' --negotiate-only \ --negotiation-tip=$(git -C client rev-parse HEAD) \ origin 2>err && - test_i18ngrep "negotiate-only requires protocol v2" err + grep "negotiate-only requires protocol v2" err ' # DO NOT add non-httpd-specific tests here, because the last part of this