{"thread":{"id":"61057","subject":"[PATCH 01/22] doc: avoid redundant use of cat","startedAt":"2024-03-05T21:26:29Z","lastAt":"2024-03-16T18:07:04Z","messageCount":78,"participants":["Beat Bolli","Junio C Hamano","Rubén Justo","Eric Sunshine","Todd Zullinger","Taylor Blau"],"isPatch":true,"patchVersion":1,"patchTotal":22},"messages":[{"id":"489994","messageId":"20240305212533.12947-2-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 01/22] doc: avoid redundant use of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:00Z","receivedAt":"2024-03-05T21:26:29Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"The update-hook-example.txt script uses this anti-pattern twice. Call grep\nwith the input file name directy. While at it, merge the two consecutive\ngrep calls.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n Documentation/howto/update-hook-example.txt | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/howto/update-hook-example.txt b/Documentation/howto/update-hook-example.txt\nindex 151ee84cebce..4e727deedd21 100644\n--- a/Documentation/howto/update-hook-example.txt\n+++ b/Documentation/howto/update-hook-example.txt\n@@ -100,7 +100,7 @@ info \"The user is: '$username'\"\n \n if test -f \"$allowed_users_file\"\n then\n-  rc=$(cat $allowed_users_file | grep -v '^#' | grep -v '^$' |\n+  rc=$(grep -Ev '^(#|$)' $allowed_users_file |\n     while read heads user_patterns\n     do\n       # does this rule apply to us?\n@@ -138,7 +138,7 @@ info \"'$groups'\"\n \n if test -f \"$allowed_groups_file\"\n then\n-  rc=$(cat $allowed_groups_file | grep -v '^#' | grep -v '^$' |\n+  rc=$(grep -Ev '^(#|$)' $allowed_groups_file |\n     while read heads group_patterns\n     do\n       # does this rule apply to us?\n-- \n2.44.0\n\n"},{"id":"489997","messageId":"20240305212533.12947-3-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 02/22] contrib/subtree/t: avoid redundant use of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:01Z","receivedAt":"2024-03-05T21:26:31Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n contrib/subtree/t/t7900-subtree.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh\nindex ca4df5be8324..c3bd2a58b941 100755\n--- a/contrib/subtree/t/t7900-subtree.sh\n+++ b/contrib/subtree/t/t7900-subtree.sh\n@@ -63,7 +63,7 @@ test_create_pre2_32_repo () {\n \tgit -C \"$1\" log -1 --format=%B HEAD^2 >msg &&\n \ttest_commit -C \"$1-sub\" --annotate sub2 &&\n \tgit clone --no-local \"$1\" \"$1-clone\" &&\n-\tnew_commit=$(cat msg | sed -e \"s/$commit/$tag/\" | git -C \"$1-clone\" commit-tree HEAD^2^{tree}) &&\n+\tnew_commit=$(sed -e \"s/$commit/$tag/\" msg | git -C \"$1-clone\" commit-tree HEAD^2^{tree}) &&\n \tgit -C \"$1-clone\" replace HEAD^2 $new_commit\n }\n \n-- \n2.44.0\n\n"},{"id":"489995","messageId":"20240305212533.12947-4-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 03/22] t/lib-cvs.sh: avoid redundant use of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:02Z","receivedAt":"2024-03-05T21:26:32Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/lib-cvs.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/lib-cvs.sh b/t/lib-cvs.sh\nindex 32b347337908..57b9b2db9b3f 100644\n--- a/t/lib-cvs.sh\n+++ b/t/lib-cvs.sh\n@@ -71,8 +71,8 @@ test_cmp_branch_tree () {\n \t\tfind . -type d -name .git -prune -o -type f -print\n \t) | sort >module-git-\"$1\".list &&\n \ttest_cmp module-cvs-\"$1\".list module-git-\"$1\".list &&\n-\tcat module-cvs-\"$1\".list | while read f\n+\twhile read f\n \tdo\n \t\ttest_cmp_branch_file \"$1\" \"$f\" || return 1\n-\tdone\n+\tdone <module-cvs-\"$1\".list\n }\n-- \n2.44.0\n\n"},{"id":"489996","messageId":"20240305212533.12947-5-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 04/22] t/annotate-tests.sh: avoid redundant use of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:03Z","receivedAt":"2024-03-05T21:26:32Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/annotate-tests.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/annotate-tests.sh b/t/annotate-tests.sh\nindex 5e21e84f3884..87572459e4b8 100644\n--- a/t/annotate-tests.sh\n+++ b/t/annotate-tests.sh\n@@ -532,7 +532,7 @@ test_expect_success 'blame -L :funcname with userdiff driver' '\n \t\t\"$(cat file.template)\" &&\n \ttest_commit --author \"B <B@test.git>\" \\\n \t\t\"change\" \"$fortran_file\" \\\n-\t\t\"$(cat file.template | sed -e s/ChangeMe/IWasChanged/)\" &&\n+\t\t\"$(sed -e s/ChangeMe/IWasChanged/ file.template)\" &&\n \tcheck_count -f \"$fortran_file\" -L:RIGHT A 3 B 1\n '\n \n-- \n2.44.0\n\n"},{"id":"489998","messageId":"20240305212533.12947-6-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 05/22] t/perf: avoid redundant use of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:04Z","receivedAt":"2024-03-05T21:26:34Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Take care to redirect stdin, otherwise the output of wc would also contain\nthe file name.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/perf/repos/inflate-repo.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/perf/repos/inflate-repo.sh b/t/perf/repos/inflate-repo.sh\nindex fcfc992b5b02..412e4b450b16 100755\n--- a/t/perf/repos/inflate-repo.sh\n+++ b/t/perf/repos/inflate-repo.sh\n@@ -33,7 +33,7 @@ do\n done\n \n git ls-tree -r HEAD >GEN_src_list\n-nr_src_files=$(cat GEN_src_list | wc -l)\n+nr_src_files=$(wc -l <GEN_src_list)\n \n src_branch=$(git symbolic-ref --short HEAD)\n \n-- \n2.44.0\n\n"},{"id":"489999","messageId":"20240305212533.12947-7-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 06/22] t/t0*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:05Z","receivedAt":"2024-03-05T21:26:35Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t0002-gitfile.sh                 | 2 +-\n t/t0011-hashmap.sh                 | 2 +-\n t/t0028-working-tree-encoding.sh   | 4 ++--\n t/t0204-gettext-reencode-sanity.sh | 2 +-\n 4 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh\nindex 736516cc6a47..bf3bf604abe3 100755\n--- a/t/t0002-gitfile.sh\n+++ b/t/t0002-gitfile.sh\n@@ -40,7 +40,7 @@ test_expect_success 'final setup + check rev-parse --git-dir' '\n \n test_expect_success 'check hash-object' '\n \techo \"foo\" >bar &&\n-\tSHA=$(cat bar | git hash-object -w --stdin) &&\n+\tSHA=$(git hash-object -w --stdin <bar) &&\n \ttest_path_is_file \"$REAL/objects/$(objpath $SHA)\"\n '\n \ndiff --git a/t/t0011-hashmap.sh b/t/t0011-hashmap.sh\nindex 1cb6aa682432..46e74ad1072b 100755\n--- a/t/t0011-hashmap.sh\n+++ b/t/t0011-hashmap.sh\n@@ -239,7 +239,7 @@ test_expect_success 'grow / shrink' '\n \techo value40 >> expect &&\n \techo size >> in &&\n \techo 64 39 >> expect &&\n-\tcat in | test-tool hashmap > out &&\n+\ttest-tool hashmap <in >out &&\n \ttest_cmp expect out\n \n '\ndiff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh\nindex 1b55f59c237c..ad151a346708 100755\n--- a/t/t0028-working-tree-encoding.sh\n+++ b/t/t0028-working-tree-encoding.sh\n@@ -131,8 +131,8 @@ do\n \t\ttest_when_finished \"rm -f crlf.utf${i}.raw lf.utf${i}.raw\" &&\n \t\ttest_when_finished \"git reset --hard HEAD^\" &&\n \n-\t\tcat lf.utf8.raw | write_utf${i} >lf.utf${i}.raw &&\n-\t\tcat crlf.utf8.raw | write_utf${i} >crlf.utf${i}.raw &&\n+\t\twrite_utf${i} <lf.utf8.raw >lf.utf${i}.raw &&\n+\t\twrite_utf${i} <crlf.utf8.raw >crlf.utf${i}.raw &&\n \t\tcp crlf.utf${i}.raw eol.utf${i} &&\n \n \t\tcat >expectIndexLF <<-EOF &&\ndiff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh\nindex 4f2e0dcb02bd..310a4500125f 100755\n--- a/t/t0204-gettext-reencode-sanity.sh\n+++ b/t/t0204-gettext-reencode-sanity.sh\n@@ -82,7 +82,7 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext.c: git init UTF-8 -> ISO-8859-1'\n     printf \"Bjó til tóma Git lind\" >expect &&\n     LANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" git init repo >actual &&\n     test_when_finished \"rm -rf repo\" &&\n-    grep \"^$(cat expect | iconv -f UTF-8 -t ISO8859-1) \" actual\n+    grep \"^$(iconv -f UTF-8 -t ISO8859-1 <expect) \" actual\n '\n \n test_done\n-- \n2.44.0\n\n"},{"id":"490000","messageId":"20240305212533.12947-8-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 07/22] t/t1*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:06Z","receivedAt":"2024-03-05T21:26:36Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t1007-hash-object.sh             | 6 +++---\n t/t1091-sparse-checkout-builtin.sh | 2 +-\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh\nindex ac3d173767ae..64aea3848606 100755\n--- a/t/t1007-hash-object.sh\n+++ b/t/t1007-hash-object.sh\n@@ -124,8 +124,8 @@ test_expect_success 'check that appropriate filter is invoke when --path is used\n \tpath0_sha=$(git hash-object --path=file0 file1) &&\n \ttest \"$file0_sha\" = \"$path0_sha\" &&\n \ttest \"$file1_sha\" = \"$path1_sha\" &&\n-\tpath1_sha=$(cat file0 | git hash-object --path=file1 --stdin) &&\n-\tpath0_sha=$(cat file1 | git hash-object --path=file0 --stdin) &&\n+\tpath1_sha=$(git hash-object --path=file1 --stdin <file0) &&\n+\tpath0_sha=$(git hash-object --path=file0 --stdin <file1) &&\n \ttest \"$file0_sha\" = \"$path0_sha\" &&\n \ttest \"$file1_sha\" = \"$path1_sha\"\n '\n@@ -154,7 +154,7 @@ test_expect_success '--path works in a subdirectory' '\n test_expect_success 'check that --no-filters option works' '\n \tnofilters_file1=$(git hash-object --no-filters file1) &&\n \ttest \"$file0_sha\" = \"$nofilters_file1\" &&\n-\tnofilters_file1=$(cat file1 | git hash-object --stdin) &&\n+\tnofilters_file1=$(git hash-object --stdin <file1) &&\n \ttest \"$file0_sha\" = \"$nofilters_file1\"\n '\n \ndiff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh\nindex e49b8024ac53..ab3a105ffff2 100755\n--- a/t/t1091-sparse-checkout-builtin.sh\n+++ b/t/t1091-sparse-checkout-builtin.sh\n@@ -968,7 +968,7 @@ test_expect_success 'check-rules non-cone mode' '\n \tgit -C bare sparse-checkout check-rules --no-cone --rules-file ../rules\\\n \t\t>check-rules-file <all-files &&\n \n-\tcat rules | git -C repo sparse-checkout set --no-cone --stdin &&\n+\tgit -C repo sparse-checkout set --no-cone --stdin <rules &&\n \tgit -C repo ls-files -t >out &&\n \tsed -n \"/^S /!s/^. //p\" out >ls-files &&\n \n-- \n2.44.0\n\n"},{"id":"490001","messageId":"20240305212533.12947-9-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 08/22] t/t3*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:07Z","receivedAt":"2024-03-05T21:26:37Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t3200-branch.sh           | 2 +-\n t/t3321-notes-stripspace.sh | 8 ++++----\n t/t3920-crlf-messages.sh    | 2 +-\n 3 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex e36f4d15f2dd..c394273527cb 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -579,7 +579,7 @@ EOF\n \n \t# ...and that the comments for those sections are also\n \t# preserved.\n-\tcat config.branch | sed \"s/\\\"source\\\"/\\\"dest\\\"/\" >expect &&\n+\tsed \"s/\\\"source\\\"/\\\"dest\\\"/\" config.branch >expect &&\n \tsed -n -e \"/Note the lack/,\\$p\" .git/config >actual &&\n \ttest_cmp expect actual\n '\ndiff --git a/t/t3321-notes-stripspace.sh b/t/t3321-notes-stripspace.sh\nindex 088a852dd47a..beca34605672 100755\n--- a/t/t3321-notes-stripspace.sh\n+++ b/t/t3321-notes-stripspace.sh\n@@ -442,7 +442,7 @@ test_expect_success 'add note by specifying \"-C\", \"--no-stripspace\" is the defau\n \t${LF}\n \tEOF\n \n-\tcat expect | git hash-object -w --stdin >blob &&\n+\tgit hash-object -w --stdin <expect >blob &&\n \tgit notes add -C $(cat blob) &&\n \tgit notes show >actual &&\n \ttest_cmp expect actual &&\n@@ -468,7 +468,7 @@ test_expect_success 'reuse note by specifying \"-C\" and \"--stripspace\"' '\n \tsecond-line\n \tEOF\n \n-\tcat data | git hash-object -w --stdin >blob &&\n+\tgit hash-object -w --stdin <data >blob &&\n \tgit notes add --stripspace -C $(cat blob) &&\n \tgit notes show >actual &&\n \ttest_cmp expect actual\n@@ -492,7 +492,7 @@ test_expect_success 'reuse with \"-C\" and add note with \"-m\", \"-m\" will stripspac\n \tthird-line\n \tEOF\n \n-\tcat data | git hash-object -w --stdin >blob &&\n+\tgit hash-object -w --stdin <data >blob &&\n \tgit notes add -C $(cat blob) -m \"third-line\" &&\n \tgit notes show >actual &&\n \ttest_cmp expect actual\n@@ -511,7 +511,7 @@ test_expect_success 'add note with \"-m\" and reuse note with \"-C\", \"-C\" will not\n \tsecond-line\n \tEOF\n \n-\tcat data | git hash-object -w --stdin >blob &&\n+\tgit hash-object -w --stdin <data >blob &&\n \tgit notes add -m \"first-line\" -C $(cat blob)  &&\n \tgit notes show >actual &&\n \ttest_cmp expect actual\ndiff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh\nindex 67fd2345affd..5eed640a6825 100755\n--- a/t/t3920-crlf-messages.sh\n+++ b/t/t3920-crlf-messages.sh\n@@ -10,7 +10,7 @@ LIB_CRLF_BRANCHES=\"\"\n create_crlf_ref () {\n \tbranch=\"$1\" &&\n \tcat >.crlf-orig-$branch.txt &&\n-\tcat .crlf-orig-$branch.txt | append_cr >.crlf-message-$branch.txt &&\n+\tappend_cr <.crlf-orig-$branch.txt >.crlf-message-$branch.txt &&\n \tgrep 'Subject' .crlf-orig-$branch.txt | tr '\\n' ' ' | sed 's/[ ]*$//' | tr -d '\\n' >.crlf-subject-$branch.txt &&\n \tgrep 'Body' .crlf-orig-$branch.txt | append_cr >.crlf-body-$branch.txt &&\n \tLIB_CRLF_BRANCHES=\"${LIB_CRLF_BRANCHES} ${branch}\" &&\n-- \n2.44.0\n\n"},{"id":"490002","messageId":"20240305212533.12947-10-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 09/22] t/t4*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:08Z","receivedAt":"2024-03-05T21:26:38Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t4020-diff-external.sh         | 2 +-\n t/t4150-am.sh                    | 2 +-\n t/t4205-log-pretty-formats.sh    | 2 +-\n t/t4301-merge-tree-write-tree.sh | 8 ++++----\n 4 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh\nindex c1ac09ecc714..fdd865f7c38d 100755\n--- a/t/t4020-diff-external.sh\n+++ b/t/t4020-diff-external.sh\n@@ -232,7 +232,7 @@ keep_only_cr () {\n test_expect_success 'external diff with autocrlf = true' '\n \ttest_config core.autocrlf true &&\n \tGIT_EXTERNAL_DIFF=./fake-diff.sh git diff &&\n-\ttest $(wc -l < crlfed.txt) = $(cat crlfed.txt | keep_only_cr | wc -c)\n+\ttest $(wc -l < crlfed.txt) = $(keep_only_cr <crlfed.txt | wc -c)\n '\n \n test_expect_success 'diff --cached' '\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex 3b125762694e..080a07e9d414 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -786,7 +786,7 @@ test_expect_success 'am takes patches from a Pine mailbox' '\n \trm -fr .git/rebase-apply &&\n \tgit reset --hard &&\n \tgit checkout first &&\n-\tcat pine patch1 | git am &&\n+\tgit am pine patch1 &&\n \ttest_path_is_missing .git/rebase-apply &&\n \tgit diff --exit-code main^..HEAD\n '\ndiff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh\nindex e3d655e6b8b5..1409eebcd855 100755\n--- a/t/t4205-log-pretty-formats.sh\n+++ b/t/t4205-log-pretty-formats.sh\n@@ -156,7 +156,7 @@ test_expect_success 'NUL termination with --reflog --pretty=oneline' '\n \tfor r in $revs\n \tdo\n \t\tgit show -s --pretty=oneline \"$r\" >raw &&\n-\t\tcat raw | lf_to_nul || return 1\n+\t\tlf_to_nul <raw || return 1\n \tdone >expect &&\n \t# the trailing NUL is already produced so we do not need to\n \t# output another one\ndiff --git a/t/t4301-merge-tree-write-tree.sh b/t/t4301-merge-tree-write-tree.sh\nindex 12ac43687366..578641467753 100755\n--- a/t/t4301-merge-tree-write-tree.sh\n+++ b/t/t4301-merge-tree-write-tree.sh\n@@ -313,7 +313,7 @@ test_expect_success 'rename/add handling' '\n \t\t# First, check that the bar that appears at stage 3 does not\n \t\t# correspond to an individual blob anywhere in history\n \t\t#\n-\t\thash=$(cat out | tr \"\\0\" \"\\n\" | head -n 3 | grep 3.bar | cut -f 2 -d \" \") &&\n+\t\thash=$(tr \"\\0\" \"\\n\" <out | head -n 3 | grep 3.bar | cut -f 2 -d \" \") &&\n \t\tgit rev-list --objects --all >all_blobs &&\n \t\t! grep $hash all_blobs &&\n \n@@ -380,7 +380,7 @@ test_expect_success SYMLINKS 'rename/add, where add is a mode conflict' '\n \t\t# First, check that the bar that appears at stage 3 does not\n \t\t# correspond to an individual blob anywhere in history\n \t\t#\n-\t\thash=$(cat out | tr \"\\0\" \"\\n\" | head -n 3 | grep 3.bar | cut -f 2 -d \" \") &&\n+\t\thash=$(tr \"\\0\" \"\\n\" <out | head -n 3 | grep 3.bar | cut -f 2 -d \" \") &&\n \t\tgit rev-list --objects --all >all_blobs &&\n \t\t! grep $hash all_blobs &&\n \n@@ -630,8 +630,8 @@ test_expect_success 'mod6: chains of rename/rename(1to2) and add/add via collidi\n \t\t# conflict entries do not appear as individual blobs anywhere\n \t\t# in history.\n \t\t#\n-\t\thash1=$(cat out | tr \"\\0\" \"\\n\" | head | grep 2.four | cut -f 2 -d \" \") &&\n-\t\thash2=$(cat out | tr \"\\0\" \"\\n\" | head | grep 3.two | cut -f 2 -d \" \") &&\n+\t\thash1=$(tr \"\\0\" \"\\n\" <out | head | grep 2.four | cut -f 2 -d \" \") &&\n+\t\thash2=$(tr \"\\0\" \"\\n\" <out | head | grep 3.two | cut -f 2 -d \" \") &&\n \t\tgit rev-list --objects --all >all_blobs &&\n \t\t! grep $hash1 all_blobs &&\n \t\t! grep $hash2 all_blobs &&\n-- \n2.44.0\n\n"},{"id":"490003","messageId":"20240305212533.12947-11-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 10/22] t/t5*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:09Z","receivedAt":"2024-03-05T21:26:39Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t5100-mailinfo.sh                    | 2 +-\n t/t5317-pack-objects-filter-objects.sh | 2 +-\n t/t5534-push-signed.sh                 | 2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh\nindex 654d8cf3ee00..c8d06554541c 100755\n--- a/t/t5100-mailinfo.sh\n+++ b/t/t5100-mailinfo.sh\n@@ -70,7 +70,7 @@ test_expect_success 'respect NULs' '\n \n \tgit mailsplit -d3 -o. \"$DATA/nul-plain\" &&\n \ttest_cmp \"$DATA/nul-plain\" 001 &&\n-\t(cat 001 | git mailinfo msg patch) &&\n+\tgit mailinfo msg patch <001 &&\n \ttest_line_count = 4 patch\n \n '\ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex 2ff3eef9a3b8..79552d6ef7f6 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -455,7 +455,7 @@ test_expect_success 'setup r1 - delete loose blobs' '\n \ttest_parse_ls_files_stage_oids <ls_files_result |\n \tsort >expected &&\n \n-\tfor id in `cat expected | sed \"s|..|&/|\"`\n+\tfor id in `sed \"s|..|&/|\" expected`\n \tdo\n \t\trm r1/.git/objects/$id || return 1\n \tdone\ndiff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh\nindex b4bc24691c81..c91a62b77afc 100755\n--- a/t/t5534-push-signed.sh\n+++ b/t/t5534-push-signed.sh\n@@ -303,7 +303,7 @@ test_expect_success GPGSM 'fail without key and heed user.signingkey x509' '\n \t\tEOF\n \t\tsed -n -e \"s/^nonce /NONCE=/p\" -e \"/^$/q\" dst/push-cert\n \t) >expect.in &&\n-\tkey=$(cat \"${GNUPGHOME}/trustlist.txt\" | cut -d\" \" -f1 | tr -d \":\") &&\n+\tkey=$(cut -d\" \" -f1 <\"${GNUPGHOME}/trustlist.txt\" | tr -d \":\") &&\n \tsed -e \"s/^KEY=/KEY=${key}/\" expect.in >expect &&\n \n \tnoop=$(git rev-parse noop) &&\n-- \n2.44.0\n\n"},{"id":"490006","messageId":"20240305212533.12947-12-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 11/22] t/t6*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:10Z","receivedAt":"2024-03-05T21:26:40Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t6112-rev-list-filters-objects.sh | 2 +-\n t/t6413-merge-crlf.sh               | 4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex 52822b9461a1..43e1afd44c9b 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -670,7 +670,7 @@ test_expect_success 'rev-list W/ --missing=print' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tfor id in `cat expected | sed \"s|..|&/|\"`\n+\tfor id in `sed \"s|..|&/|\" expected`\n \tdo\n \t\trm r1/.git/objects/$id || return 1\n \tdone &&\ndiff --git a/t/t6413-merge-crlf.sh b/t/t6413-merge-crlf.sh\nindex b4f4a313f486..647ea1e83829 100755\n--- a/t/t6413-merge-crlf.sh\n+++ b/t/t6413-merge-crlf.sh\n@@ -34,14 +34,14 @@ test_expect_success setup '\n test_expect_success 'Check \"ours\" is CRLF' '\n \tgit reset --hard initial &&\n \tgit merge side -s ours &&\n-\tcat file | remove_cr | append_cr >file.temp &&\n+\tremove_cr <file | append_cr >file.temp &&\n \ttest_cmp file file.temp\n '\n \n test_expect_success 'Check that conflict file is CRLF' '\n \tgit reset --hard a &&\n \ttest_must_fail git merge side &&\n-\tcat file | remove_cr | append_cr >file.temp &&\n+\tremove_cr <file | append_cr >file.temp &&\n \ttest_cmp file file.temp\n '\n \n-- \n2.44.0\n\n"},{"id":"490004","messageId":"20240305212533.12947-13-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 12/22] t/t7*: avoid redundant use of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:11Z","receivedAt":"2024-03-05T21:26:41Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t7704-repack-cruft.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7704-repack-cruft.sh b/t/t7704-repack-cruft.sh\nindex be3735dff083..71e1ef3a103e 100755\n--- a/t/t7704-repack-cruft.sh\n+++ b/t/t7704-repack-cruft.sh\n@@ -48,7 +48,7 @@ test_expect_success '--expire-to stores pruned objects (now)' '\n \t\t# ...in other words, the combined contents of this\n \t\t# repository and expired.git should be the same as the\n \t\t# set of objects we started with.\n-\t\tcat expired.objects remaining.objects | sort >actual &&\n+\t\tsort expired.objects remaining.objects >actual &&\n \t\ttest_cmp expect actual &&\n \n \t\t# The \"moved\" objects (i.e., those in expired.git)\n-- \n2.44.0\n\n"},{"id":"490005","messageId":"20240305212533.12947-14-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 13/22] t/t8*: avoid redundant use of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:12Z","receivedAt":"2024-03-05T21:26:42Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t8010-cat-file-filters.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t8010-cat-file-filters.sh b/t/t8010-cat-file-filters.sh\nindex ca04242ca016..eb64b766bdfa 100755\n--- a/t/t8010-cat-file-filters.sh\n+++ b/t/t8010-cat-file-filters.sh\n@@ -43,7 +43,7 @@ test_expect_success 'cat-file --textconv --path=<path> works' '\n \tsha1=$(git rev-parse -q --verify HEAD:world.txt) &&\n \ttest_config diff.txt.textconv \"tr A-Za-z N-ZA-Mn-za-m <\" &&\n \tgit cat-file --textconv --path=hello.txt $sha1 >rot13 &&\n-\ttest uryyb = \"$(cat rot13 | remove_cr)\"\n+\ttest uryyb = \"$(remove_cr <rot13)\"\n '\n \n test_expect_success '--path=<path> complains without --textconv/--filters' '\n-- \n2.44.0\n\n"},{"id":"490007","messageId":"20240305212533.12947-15-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 14/22] t/t9*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:13Z","receivedAt":"2024-03-05T21:26:43Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t9300-fast-import.sh          | 10 +++++-----\n t/t9350-fast-export.sh          |  2 +-\n t/t9400-git-cvsserver-server.sh | 35 +++++++++++++++------------------\n t/t9802-git-p4-filetype.sh      |  2 +-\n t/t9807-git-p4-submit.sh        |  2 +-\n t/t9824-git-p4-git-lfs.sh       |  4 ++--\n 6 files changed, 26 insertions(+), 29 deletions(-)\n\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex dbb5042b0b8f..c03adbdd145f 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -986,7 +986,7 @@ test_expect_success 'L: nested tree copy does not corrupt deltas' '\n \ttest_when_finished \"git update-ref -d refs/heads/L2\" &&\n \tgit fast-import <input &&\n \tgit ls-tree L2 g/b/ >tmp &&\n-\tcat tmp | cut -f 2 >actual &&\n+\tcut -f 2 <tmp >actual &&\n \ttest_cmp expect actual &&\n \tgit fsck $(git rev-parse L2)\n '\n@@ -2012,7 +2012,7 @@ test_expect_success 'Q: verify first notes tree' '\n \t100644 blob $commit2\n \t100644 blob $commit3\n \tEOF\n-\tcat expect.unsorted | sort >expect &&\n+\tsort expect.unsorted >expect &&\n \tgit cat-file -p refs/notes/foobar~2^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n \ttest_cmp expect actual\n '\n@@ -2053,7 +2053,7 @@ test_expect_success 'Q: verify second notes tree' '\n \t100644 blob $commit2\n \t100644 blob $commit3\n \tEOF\n-\tcat expect.unsorted | sort >expect &&\n+\tsort expect.unsorted >expect &&\n \tgit cat-file -p refs/notes/foobar^^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n \ttest_cmp expect actual\n '\n@@ -2091,7 +2091,7 @@ test_expect_success 'Q: verify third notes tree' '\n \tcat >expect.unsorted <<-EOF &&\n \t100644 blob $commit1\n \tEOF\n-\tcat expect.unsorted | sort >expect &&\n+\tsort expect.unsorted >expect &&\n \tgit cat-file -p refs/notes/foobar2^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n \ttest_cmp expect actual\n '\n@@ -2118,7 +2118,7 @@ test_expect_success 'Q: verify fourth notes tree' '\n \tcat >expect.unsorted <<-EOF &&\n \t100644 blob $commit2\n \tEOF\n-\tcat expect.unsorted | sort >expect &&\n+\tsort expect.unsorted >expect &&\n \tgit cat-file -p refs/notes/foobar^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n \ttest_cmp expect actual\n '\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex e9a12c18bbd3..d86d07a79d4f 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -236,7 +236,7 @@ EOF\n \n test_expect_success 'set up faked signed tag' '\n \n-\tcat signed-tag-import | git fast-import\n+\tgit fast-import <signed-tag-import\n \n '\n \ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex 003c0b61d0ff..e499c7f95512 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -117,12 +117,12 @@ END VERIFICATION REQUEST\n EOF\n \n test_expect_success 'pserver authentication' '\n-\tcat request-anonymous | git-cvsserver pserver >log 2>&1 &&\n+\tgit-cvsserver pserver <request-anonymous >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \n test_expect_success 'pserver authentication failure (non-anonymous user)' '\n-\tif cat request-git | git-cvsserver pserver >log 2>&1\n+\tif git-cvsserver pserver <request-git >log 2>&1\n \tthen\n \t    false\n \telse\n@@ -132,17 +132,17 @@ test_expect_success 'pserver authentication failure (non-anonymous user)' '\n '\n \n test_expect_success 'pserver authentication success (non-anonymous user with password)' '\n-\tcat login-git-ok | git-cvsserver pserver >log 2>&1 &&\n+\tgit-cvsserver pserver <login-git-ok >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \n test_expect_success 'pserver authentication (login)' '\n-\tcat login-anonymous | git-cvsserver pserver >log 2>&1 &&\n+\tgit-cvsserver pserver <login-anonymous >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \n test_expect_success 'pserver authentication failure (login/non-anonymous user)' '\n-\tif cat login-git | git-cvsserver pserver >log 2>&1\n+\tif git-cvsserver pserver <login-git >log 2>&1\n \tthen\n \t    false\n \telse\n@@ -172,7 +172,7 @@ Root $WORKDIR\n EOF\n \n test_expect_success 'req_Root failure (relative pathname)' '\n-\tif cat request-relative | git-cvsserver pserver >log 2>&1\n+\tif git-cvsserver pserver <request-relative >log 2>&1\n \tthen\n \t\techo unexpected success\n \t\tfalse\n@@ -183,28 +183,26 @@ test_expect_success 'req_Root failure (relative pathname)' '\n '\n \n test_expect_success 'req_Root failure (conflicting roots)' '\n-\tcat request-conflict | git-cvsserver pserver >log 2>&1 &&\n+\tgit-cvsserver pserver <request-conflict >log 2>&1 &&\n \ttail log | grep \"^error 1 Conflicting roots specified$\"\n '\n \n test_expect_success 'req_Root (strict paths)' '\n-\tcat request-anonymous | git-cvsserver --strict-paths pserver \"$SERVERDIR\" >log 2>&1 &&\n+\tgit-cvsserver --strict-paths pserver \"$SERVERDIR\" <request-anonymous >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \n test_expect_success 'req_Root failure (strict-paths)' '\n-\t! cat request-anonymous |\n-\tgit-cvsserver --strict-paths pserver \"$WORKDIR\" >log 2>&1\n+\t! git-cvsserver --strict-paths pserver \"$WORKDIR\" <request-anonymous >log 2>&1\n '\n \n test_expect_success 'req_Root (w/o strict-paths)' '\n-\tcat request-anonymous | git-cvsserver pserver \"$WORKDIR/\" >log 2>&1 &&\n+\tgit-cvsserver pserver \"$WORKDIR/\" <request-anonymous >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \n test_expect_success 'req_Root failure (w/o strict-paths)' '\n-\t! cat request-anonymous |\n-\tgit-cvsserver pserver \"$WORKDIR/gitcvs\" >log 2>&1\n+\t! git-cvsserver pserver \"$WORKDIR/gitcvs\" <request-anonymous >log 2>&1\n '\n \n cat >request-base  <<EOF\n@@ -217,27 +215,26 @@ Root /gitcvs.git\n EOF\n \n test_expect_success 'req_Root (base-path)' '\n-\tcat request-base | git-cvsserver --strict-paths --base-path \"$WORKDIR/\" pserver \"$SERVERDIR\" >log 2>&1 &&\n+\tgit-cvsserver --strict-paths --base-path \"$WORKDIR/\" pserver \"$SERVERDIR\" <request-base >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \n test_expect_success 'req_Root failure (base-path)' '\n-\t! cat request-anonymous |\n-\tgit-cvsserver --strict-paths --base-path \"$WORKDIR\" pserver \"$SERVERDIR\" >log 2>&1\n+\t! git-cvsserver --strict-paths --base-path \"$WORKDIR\" pserver \"$SERVERDIR\" <request-anonymous >log 2>&1\n '\n \n GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled false || exit 1\n \n test_expect_success 'req_Root (export-all)' '\n-\tcat request-anonymous | git-cvsserver --export-all pserver \"$WORKDIR\" >log 2>&1 &&\n+\tgit-cvsserver --export-all pserver \"$WORKDIR\" <request-anonymous >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \n test_expect_success 'req_Root failure (export-all w/o directory list)' '\n-\t! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)'\n+\t! (git-cvsserver --export-all pserver <request-anonymous >log 2>&1 || false)'\n \n test_expect_success 'req_Root (everything together)' '\n-\tcat request-base | git-cvsserver --export-all --strict-paths --base-path \"$WORKDIR/\" pserver \"$SERVERDIR\" >log 2>&1 &&\n+\tgit-cvsserver --export-all --strict-paths --base-path \"$WORKDIR/\" pserver \"$SERVERDIR\" <request-base >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \ndiff --git a/t/t9802-git-p4-filetype.sh b/t/t9802-git-p4-filetype.sh\nindex 2a6ee2a46787..bb236cd2b57a 100755\n--- a/t/t9802-git-p4-filetype.sh\n+++ b/t/t9802-git-p4-filetype.sh\n@@ -175,7 +175,7 @@ test_expect_success 'keyword file create' '\n \t\tcp k-text-k k-text-ko &&\n \t\tp4 add -t text+ko k-text-ko &&\n \n-\t\tcat k-text-k | iconv -f ascii -t utf-16 >k-utf16-k &&\n+\t\ticonv -f ascii -t utf-16 <k-text-k >k-utf16-k &&\n \t\tp4 add -t utf16+k k-utf16-k &&\n \n \t\tcp k-utf16-k k-utf16-ko &&\ndiff --git a/t/t9807-git-p4-submit.sh b/t/t9807-git-p4-submit.sh\nindex af4b286f9d51..6ae7ced51be1 100755\n--- a/t/t9807-git-p4-submit.sh\n+++ b/t/t9807-git-p4-submit.sh\n@@ -418,7 +418,7 @@ test_expect_success 'description with Jobs and values on separate lines' '\n \t\t\tmarshal_dump job0 <change &&\n \t\t\tmarshal_dump job1 <change\n \t\t) | sort >jobs &&\n-\t\tcat jobname1 jobname2 | sort >expected &&\n+\t\tsort jobname1 jobname2 >expected &&\n \t\ttest_cmp expected jobs\n \t)\n '\ndiff --git a/t/t9824-git-p4-git-lfs.sh b/t/t9824-git-p4-git-lfs.sh\nindex a28dbbdd566c..fd430403d716 100755\n--- a/t/t9824-git-p4-git-lfs.sh\n+++ b/t/t9824-git-p4-git-lfs.sh\n@@ -17,8 +17,8 @@ test_file_in_lfs () {\n \tsed -n '2,2 p' \"$FILE\" | grep \"^oid \" &&\n \tsed -n '3,3 p' \"$FILE\" | grep \"^size \" &&\n \ttest_line_count = 3 \"$FILE\" &&\n-\tcat \"$FILE\" | grep \"size $SIZE\" &&\n-\tHASH=$(cat \"$FILE\" | grep \"oid sha256:\" | sed -e \"s/oid sha256://g\") &&\n+\tgrep \"size $SIZE\" \"$FILE\" &&\n+\tHASH=$(grep \"oid sha256:\" \"$FILE\" | sed -e \"s/oid sha256://g\") &&\n \tLFS_FILE=\".git/lfs/objects/$(echo \"$HASH\" | cut -c1-2)/$(echo \"$HASH\" | cut -c3-4)/$HASH\" &&\n \techo $EXPECTED_CONTENT >expect &&\n \ttest_path_is_file \"$FILE\" &&\n-- \n2.44.0\n\n"},{"id":"490008","messageId":"20240305212533.12947-16-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 15/22] t/t1*: merge a \"grep | sed\" pipeline","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:14Z","receivedAt":"2024-03-05T21:26:45Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t1509/prepare-chroot.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1509/prepare-chroot.sh b/t/t1509/prepare-chroot.sh\nindex 6d47e2c725f7..dc997e0a6437 100755\n--- a/t/t1509/prepare-chroot.sh\n+++ b/t/t1509/prepare-chroot.sh\n@@ -43,7 +43,7 @@ rsync --exclude-from t/t1509/excludes -Ha . \"$R$(pwd)\"\n # env might slip through, see test-lib.sh, unset.*PERL_PATH\n sed 's|^PERL_PATH=.*|PERL_PATH=/bin/true|' GIT-BUILD-OPTIONS > \"$R$(pwd)/GIT-BUILD-OPTIONS\"\n for cmd in git $BB;do \n-\tldd $cmd | grep '/' | sed 's,.*\\s\\(/[^ ]*\\).*,\\1,' | while read i; do\n+\tldd $cmd | sed -n '/\\//s,.*\\s\\(/[^ ]*\\).*,\\1,p' | while read i; do\n \t\tmkdir -p \"$R$(dirname $i)\"\n \t\tcp \"$i\" \"$R/$i\"\n \tdone\n-- \n2.44.0\n\n"},{"id":"490009","messageId":"20240305212533.12947-17-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 16/22] t/t3*: merge a \"grep | awk\" pipeline","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:15Z","receivedAt":"2024-03-05T21:26:45Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t3920-crlf-messages.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh\nindex 5eed640a6825..50ae222f0842 100755\n--- a/t/t3920-crlf-messages.sh\n+++ b/t/t3920-crlf-messages.sh\n@@ -97,7 +97,7 @@ test_expect_success 'branch: --verbose works with messages using CRLF' '\n \tgit branch -v >tmp &&\n \t# Remove first two columns, and the line for the currently checked out branch\n \tcurrent=$(git branch --show-current) &&\n-\tgrep -v $current <tmp | awk \"{\\$1=\\$2=\\\"\\\"}1\"  >actual &&\n+\tawk \"/$current/ { next } { \\$1 = \\$2 = \\\"\\\" } 1\" <tmp >actual &&\n \ttest_cmp expect actual\n '\n \n-- \n2.44.0\n\n"},{"id":"490010","messageId":"20240305212533.12947-18-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 17/22] t/t4*: merge a \"grep | sed\" pipeline","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:16Z","receivedAt":"2024-03-05T21:26:47Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t4002-diff-basic.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t4002-diff-basic.sh b/t/t4002-diff-basic.sh\nindex 7afc883ec374..cb3307010c1e 100755\n--- a/t/t4002-diff-basic.sh\n+++ b/t/t4002-diff-basic.sh\n@@ -405,7 +405,7 @@ test_expect_success 'diff-tree -r B A == diff-tree -r -R A B' '\n \n test_expect_success 'diff can read from stdin' '\n \ttest_must_fail git diff --no-index -- MN - < NN |\n-\t\tgrep -v \"^index\" | sed \"s#/-#/NN#\" >.test-a &&\n+\t\tsed \"/^index/d; s#/-#/NN#\" >.test-a &&\n \ttest_must_fail git diff --no-index -- MN NN |\n \t\tgrep -v \"^index\" >.test-b &&\n \ttest_cmp .test-a .test-b\n-- \n2.44.0\n\n"},{"id":"490011","messageId":"20240305212533.12947-19-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 18/22] t/t5*: merge a \"grep | sed\" pipeline","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:17Z","receivedAt":"2024-03-05T21:26:48Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t5401-update-hooks.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5401-update-hooks.sh b/t/t5401-update-hooks.sh\nindex 8b8bc47dc0b9..d8cadeec7331 100755\n--- a/t/t5401-update-hooks.sh\n+++ b/t/t5401-update-hooks.sh\n@@ -123,7 +123,7 @@ remote: STDOUT post-update\n remote: STDERR post-update\n EOF\n test_expect_success 'send-pack stderr contains hook messages' '\n-\tgrep ^remote: send.err | sed \"s/ *\\$//\" >actual &&\n+\tsed -n \"/^remote:/s/ *\\$//p\" send.err >actual &&\n \ttest_cmp expect actual\n '\n \n-- \n2.44.0\n\n"},{"id":"490012","messageId":"20240305212533.12947-20-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 19/22] t/t8*: merge \"grep | sed\" pipelines","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:18Z","receivedAt":"2024-03-05T21:26:49Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t8013-blame-ignore-revs.sh | 28 ++++++++++++++--------------\n 1 file changed, 14 insertions(+), 14 deletions(-)\n\ndiff --git a/t/t8013-blame-ignore-revs.sh b/t/t8013-blame-ignore-revs.sh\nindex 9a03b0f361ff..05213d13f30f 100755\n--- a/t/t8013-blame-ignore-revs.sh\n+++ b/t/t8013-blame-ignore-revs.sh\n@@ -25,11 +25,11 @@ test_expect_success setup '\n \n \tgit blame --line-porcelain file >blame_raw &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 1/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse X >expect &&\n \ttest_cmp expect actual &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 2/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse X >expect &&\n \ttest_cmp expect actual\n '\n@@ -53,11 +53,11 @@ do\n \ttest_expect_success \"ignore_rev_changing_lines ($I)\" '\n \t\tgit blame --line-porcelain --ignore-rev $I file >blame_raw &&\n \n-\t\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\t\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 1/s/ .*//p\" blame_raw >actual &&\n \t\tgit rev-parse A >expect &&\n \t\ttest_cmp expect actual &&\n \n-\t\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\t\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 2/s/ .*//p\" blame_raw >actual &&\n \t\tgit rev-parse B >expect &&\n \t\ttest_cmp expect actual\n \t'\n@@ -79,10 +79,10 @@ test_expect_success ignore_rev_adding_unblamable_lines '\n \tgit rev-parse Y >expect &&\n \tgit blame --line-porcelain file --ignore-rev Y >blame_raw &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 3\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 3/s/ .*//p\" blame_raw >actual &&\n \ttest_cmp expect actual &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 4\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 4/s/ .*//p\" blame_raw >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -92,11 +92,11 @@ test_expect_success ignore_revs_from_files '\n \tgit rev-parse Y >ignore_y &&\n \tgit blame --line-porcelain file --ignore-revs-file ignore_x --ignore-revs-file ignore_y >blame_raw &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 1/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse A >expect &&\n \ttest_cmp expect actual &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 2/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse B >expect &&\n \ttest_cmp expect actual\n '\n@@ -106,11 +106,11 @@ test_expect_success ignore_revs_from_configs_and_files '\n \tgit config --add blame.ignoreRevsFile ignore_x &&\n \tgit blame --line-porcelain file --ignore-revs-file ignore_y >blame_raw &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 1/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse A >expect &&\n \ttest_cmp expect actual &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 2/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse B >expect &&\n \ttest_cmp expect actual\n '\n@@ -121,10 +121,10 @@ test_expect_success override_ignore_revs_file '\n \tgit blame --line-porcelain file --ignore-revs-file \"\" --ignore-revs-file ignore_y >blame_raw &&\n \tgit rev-parse X >expect &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 1/s/ .*//p\" blame_raw >actual &&\n \ttest_cmp expect actual &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 2/s/ .*//p\" blame_raw >actual &&\n \ttest_cmp expect actual\n \t'\n test_expect_success bad_files_and_revs '\n@@ -279,11 +279,11 @@ test_expect_success ignore_merge '\n \ttest_merge M B &&\n \tgit blame --line-porcelain file --ignore-rev M >blame_raw &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 1/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse B >expect &&\n \ttest_cmp expect actual &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 9\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 9/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse C >expect &&\n \ttest_cmp expect actual\n '\n-- \n2.44.0\n\n"},{"id":"490013","messageId":"20240305212533.12947-21-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 20/22] t/t9*: merge \"grep | sed\" pipelines","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:19Z","receivedAt":"2024-03-05T21:26:50Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t9118-git-svn-funky-branch-names.sh | 2 +-\n t/t9350-fast-export.sh                | 2 +-\n t/t9824-git-p4-git-lfs.sh             | 2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh\nindex a159ff96b718..d3261e35b818 100755\n--- a/t/t9118-git-svn-funky-branch-names.sh\n+++ b/t/t9118-git-svn-funky-branch-names.sh\n@@ -38,7 +38,7 @@ test_expect_success 'setup svnrepo' '\n # SVN 1.7 will truncate \"not-a%40{0]\" to just \"not-a\".\n # Look at what SVN wound up naming the branch and use that.\n # Be sure to escape the @ if it shows up.\n-non_reflog=$(svn_cmd ls \"$svnrepo/pr ject/branches\" | grep not-a | sed 's/\\///' | sed 's/@/%40/')\n+non_reflog=$(svn_cmd ls \"$svnrepo/pr ject/branches\" | sed -ne '/not-a/ { s/\\///; s/@/%40/; p }')\n \n test_expect_success 'test clone with funky branch names' '\n \tgit svn clone -s \"$svnrepo/pr ject\" project &&\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex d86d07a79d4f..1eb035ee4ce5 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -537,7 +537,7 @@ test_expect_success 'full-tree re-shows unmodified files'        '\n \n test_expect_success 'set-up a few more tags for tag export tests' '\n \tgit checkout -f main &&\n-\tHEAD_TREE=$(git show -s --pretty=raw HEAD | grep tree | sed \"s/tree //\") &&\n+\tHEAD_TREE=$(git show -s --pretty=raw HEAD | sed -n \"/tree/s/tree //p\") &&\n \tgit tag    tree_tag        -m \"tagging a tree\" $HEAD_TREE &&\n \tgit tag -a tree_tag-obj    -m \"tagging a tree\" $HEAD_TREE &&\n \tgit tag    tag-obj_tag     -m \"tagging a tag\" tree_tag-obj &&\ndiff --git a/t/t9824-git-p4-git-lfs.sh b/t/t9824-git-p4-git-lfs.sh\nindex fd430403d716..80c8c31e320f 100755\n--- a/t/t9824-git-p4-git-lfs.sh\n+++ b/t/t9824-git-p4-git-lfs.sh\n@@ -18,7 +18,7 @@ test_file_in_lfs () {\n \tsed -n '3,3 p' \"$FILE\" | grep \"^size \" &&\n \ttest_line_count = 3 \"$FILE\" &&\n \tgrep \"size $SIZE\" \"$FILE\" &&\n-\tHASH=$(grep \"oid sha256:\" \"$FILE\" | sed -e \"s/oid sha256://g\") &&\n+\tHASH=$(sed -ne \"/oid sha256:/s/oid sha256://gp\" \"$FILE\") &&\n \tLFS_FILE=\".git/lfs/objects/$(echo \"$HASH\" | cut -c1-2)/$(echo \"$HASH\" | cut -c3-4)/$HASH\" &&\n \techo $EXPECTED_CONTENT >expect &&\n \ttest_path_is_file \"$FILE\" &&\n-- \n2.44.0\n\n"},{"id":"490014","messageId":"20240305212533.12947-22-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 21/22] contrib/coverage-diff: avoid redundant pipelines","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:20Z","receivedAt":"2024-03-05T21:26:51Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Merge multiple sed and \"grep | awk\" invocations, finally use \"sort -u\"\ninstead of \"sort | uniq\".\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n contrib/coverage-diff.sh | 9 ++-------\n 1 file changed, 2 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/coverage-diff.sh b/contrib/coverage-diff.sh\nindex 4ec419f90048..6ce9603568ef 100755\n--- a/contrib/coverage-diff.sh\n+++ b/contrib/coverage-diff.sh\n@@ -74,8 +74,7 @@ do\n \tsort >uncovered_lines.txt\n \n \tcomm -12 uncovered_lines.txt new_lines.txt |\n-\tsed -e 's/$/\\)/' |\n-\tsed -e 's/^/ /' >uncovered_new_lines.txt\n+\tsed -e 's/$/\\)/' -e 's/^/ /' >uncovered_new_lines.txt\n \n \tgrep -q '[^[:space:]]' <uncovered_new_lines.txt &&\n \techo $file >>coverage-data.txt &&\n@@ -91,11 +90,7 @@ cat coverage-data.txt\n \n echo \"Commits introducing uncovered code:\"\n \n-commit_list=$(cat coverage-data.txt |\n-\tgrep -E '^[0-9a-f]{7,} ' |\n-\tawk '{print $1;}' |\n-\tsort |\n-\tuniq)\n+commit_list=$(awk '/^[0-9a-f]{7,}/ { print $1 }' coverage-data.txt | sort -u)\n \n (\n \tfor commit in $commit_list\n-- \n2.44.0\n\n"},{"id":"490015","messageId":"20240305212533.12947-23-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH 22/22] git-quiltimport: avoid an unnecessary subshell","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:25:21Z","receivedAt":"2024-03-05T21:26:52Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Use braces for the compound command.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n git-quiltimport.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-quiltimport.sh b/git-quiltimport.sh\nindex e3d390974331..eb34cda4092a 100755\n--- a/git-quiltimport.sh\n+++ b/git-quiltimport.sh\n@@ -148,7 +148,7 @@ do\n \tif [ -z \"$dry_run\" ] ; then\n \t\tgit apply --index -C1 ${level:+\"$level\"} \"$tmp_patch\" &&\n \t\ttree=$(git write-tree) &&\n-\t\tcommit=$( (echo \"$SUBJECT\"; echo; cat \"$tmp_msg\") | git commit-tree $tree -p $commit) &&\n+\t\tcommit=$( { echo \"$SUBJECT\"; echo; cat \"$tmp_msg\"; } | git commit-tree $tree -p $commit) &&\n \t\tgit update-ref -m \"quiltimport: $patch_name\" HEAD $commit || exit 4\n \tfi\n done 3<\"$QUILT_SERIES\"\n-- \n2.44.0\n\n"},{"id":"490016","messageId":"20240305212533.12947-1-dev+git@drbeat.li","threadId":"61057","inReplyTo":null,"subject":"[PATCH 00/22] avoid redundant pipelines","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-05T21:24:59Z","receivedAt":"2024-03-05T21:28:47Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"As follow-up to [1], here's a series that eliminates redundant\npipelines, mostly under t/.\n\nSpawning a process is notoriously slow on Windows, so this will improve\ntest performance.\n\n1/22 to 14/22 remove redundant uses of \"cat\" where the shell handles\ninput redirection from a file or the command can take a file argument.\n\n15/22 to 20/22 merge redundant uses of \"grep\" into the following \"sed\"\nor \"awk\" command. Both of these are capable of filtering themselves. I'm\na bit on the fence about this part because readability suffers in some\ncases. It was a fun exercise, though :-)\n\n21/22 merges multiple \"sed\" calls into one and replaces a whole \"cat |\ngrep | awk\" construct with a single \"awk\" call and uses \"sort -u\"\ninstead of \"sort | uniq\".\n\n22/22 finally is a bit of an outlier in that it replaces a subshell with\na shell compound command.\n\nIn the tests, I have completely arbitrarily separated the commits into\nthousands blocks to keep the commits and their reviews manageable.\n\nAll tests that I was able to run still pass. I don't have p4 or cvs\ninstalled.\n\n[1] https://lore.kernel.org/git/20240216171046.927552-1-dev+git@drbeat.li/\n\nBeat Bolli (22):\n  doc: avoid redundant use of cat\n  contrib/subtree/t: avoid redundant use of cat\n  t/lib-cvs.sh: avoid redundant use of cat\n  t/annotate-tests.sh: avoid redundant use of cat\n  t/perf: avoid redundant use of cat\n  t/t0*: avoid redundant uses of cat\n  t/t1*: avoid redundant uses of cat\n  t/t3*: avoid redundant uses of cat\n  t/t4*: avoid redundant uses of cat\n  t/t5*: avoid redundant uses of cat\n  t/t6*: avoid redundant uses of cat\n  t/t7*: avoid redundant use of cat\n  t/t8*: avoid redundant use of cat\n  t/t9*: avoid redundant uses of cat\n  t/t1*: merge a \"grep | sed\" pipeline\n  t/t3*: merge a \"grep | awk\" pipeline\n  t/t4*: merge a \"grep | sed\" pipeline\n  t/t5*: merge a \"grep | sed\" pipeline\n  t/t8*: merge \"grep | sed\" pipelines\n  t/t9*: merge \"grep | sed\" pipelines\n  contrib/coverage-diff: avoid redundant pipelines\n  git-quiltimport: avoid an unnecessary subshell\n\n Documentation/howto/update-hook-example.txt |  4 +--\n contrib/coverage-diff.sh                    |  9 ++----\n contrib/subtree/t/t7900-subtree.sh          |  2 +-\n git-quiltimport.sh                          |  2 +-\n t/annotate-tests.sh                         |  2 +-\n t/lib-cvs.sh                                |  4 +--\n t/perf/repos/inflate-repo.sh                |  2 +-\n t/t0002-gitfile.sh                          |  2 +-\n t/t0011-hashmap.sh                          |  2 +-\n t/t0028-working-tree-encoding.sh            |  4 +--\n t/t0204-gettext-reencode-sanity.sh          |  2 +-\n t/t1007-hash-object.sh                      |  6 ++--\n t/t1091-sparse-checkout-builtin.sh          |  2 +-\n t/t1509/prepare-chroot.sh                   |  2 +-\n t/t3200-branch.sh                           |  2 +-\n t/t3321-notes-stripspace.sh                 |  8 ++---\n t/t3920-crlf-messages.sh                    |  4 +--\n t/t4002-diff-basic.sh                       |  2 +-\n t/t4020-diff-external.sh                    |  2 +-\n t/t4150-am.sh                               |  2 +-\n t/t4205-log-pretty-formats.sh               |  2 +-\n t/t4301-merge-tree-write-tree.sh            |  8 ++---\n t/t5100-mailinfo.sh                         |  2 +-\n t/t5317-pack-objects-filter-objects.sh      |  2 +-\n t/t5401-update-hooks.sh                     |  2 +-\n t/t5534-push-signed.sh                      |  2 +-\n t/t6112-rev-list-filters-objects.sh         |  2 +-\n t/t6413-merge-crlf.sh                       |  4 +--\n t/t7704-repack-cruft.sh                     |  2 +-\n t/t8010-cat-file-filters.sh                 |  2 +-\n t/t8013-blame-ignore-revs.sh                | 28 ++++++++---------\n t/t9118-git-svn-funky-branch-names.sh       |  2 +-\n t/t9300-fast-import.sh                      | 10 +++---\n t/t9350-fast-export.sh                      |  4 +--\n t/t9400-git-cvsserver-server.sh             | 35 ++++++++++-----------\n t/t9802-git-p4-filetype.sh                  |  2 +-\n t/t9807-git-p4-submit.sh                    |  2 +-\n t/t9824-git-p4-git-lfs.sh                   |  4 +--\n 38 files changed, 86 insertions(+), 94 deletions(-)\n\n-- \n2.44.0\n\n"},{"id":"490026","messageId":"xmqq34t4z59d.fsf@gitster.g","threadId":"61057","inReplyTo":"20240305212533.12947-2-dev+git@drbeat.li","subject":"Re: [PATCH 01/22] doc: avoid redundant use of cat","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-05T22:24:30Z","receivedAt":"2024-03-05T22:24:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Beat Bolli\" <bb@drbeat.li> writes:\n\n> The update-hook-example.txt script uses this anti-pattern twice. Call grep\n> with the input file name directy. While at it, merge the two consecutive\n> grep calls.\n\nOK.  \n\nWhile at it, we could also place $allowed_users_file inside a pair\nof double quotes, as the \"test -f\" before the part we are touching\nis prepared to have $IFS whitespace in it (perhaps inside $GIT_DIR),\nbut I am OK to leave it as a #leftoverbit outside this topic.\n\n\n\n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>  Documentation/howto/update-hook-example.txt | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/Documentation/howto/update-hook-example.txt b/Documentation/howto/update-hook-example.txt\n> index 151ee84cebce..4e727deedd21 100644\n> --- a/Documentation/howto/update-hook-example.txt\n> +++ b/Documentation/howto/update-hook-example.txt\n> @@ -100,7 +100,7 @@ info \"The user is: '$username'\"\n>  \n>  if test -f \"$allowed_users_file\"\n>  then\n> -  rc=$(cat $allowed_users_file | grep -v '^#' | grep -v '^$' |\n> +  rc=$(grep -Ev '^(#|$)' $allowed_users_file |\n>      while read heads user_patterns\n>      do\n>        # does this rule apply to us?\n> @@ -138,7 +138,7 @@ info \"'$groups'\"\n>  \n>  if test -f \"$allowed_groups_file\"\n>  then\n> -  rc=$(cat $allowed_groups_file | grep -v '^#' | grep -v '^$' |\n> +  rc=$(grep -Ev '^(#|$)' $allowed_groups_file |\n>      while read heads group_patterns\n>      do\n>        # does this rule apply to us?\n"},{"id":"490027","messageId":"xmqqy1awxqmw.fsf@gitster.g","threadId":"61057","inReplyTo":"20240305212533.12947-3-dev+git@drbeat.li","subject":"Re: [PATCH 02/22] contrib/subtree/t: avoid redundant use of cat","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-05T22:25:43Z","receivedAt":"2024-03-05T22:25:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Beat Bolli\" <bb@drbeat.li> writes:\n\n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>  contrib/subtree/t/t7900-subtree.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh\n> index ca4df5be8324..c3bd2a58b941 100755\n> --- a/contrib/subtree/t/t7900-subtree.sh\n> +++ b/contrib/subtree/t/t7900-subtree.sh\n> @@ -63,7 +63,7 @@ test_create_pre2_32_repo () {\n>  \tgit -C \"$1\" log -1 --format=%B HEAD^2 >msg &&\n>  \ttest_commit -C \"$1-sub\" --annotate sub2 &&\n>  \tgit clone --no-local \"$1\" \"$1-clone\" &&\n> -\tnew_commit=$(cat msg | sed -e \"s/$commit/$tag/\" | git -C \"$1-clone\" commit-tree HEAD^2^{tree}) &&\n> +\tnew_commit=$(sed -e \"s/$commit/$tag/\" msg | git -C \"$1-clone\" commit-tree HEAD^2^{tree}) &&\n>  \tgit -C \"$1-clone\" replace HEAD^2 $new_commit\n>  }\n\nObviously correct.\n"},{"id":"490028","messageId":"xmqqttlkxqm5.fsf@gitster.g","threadId":"61057","inReplyTo":"20240305212533.12947-4-dev+git@drbeat.li","subject":"Re: [PATCH 03/22] t/lib-cvs.sh: avoid redundant use of cat","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-05T22:26:10Z","receivedAt":"2024-03-05T22:26:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Beat Bolli\" <bb@drbeat.li> writes:\n\n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>  t/lib-cvs.sh | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh\n> index 32b347337908..57b9b2db9b3f 100644\n> --- a/t/lib-cvs.sh\n> +++ b/t/lib-cvs.sh\n> @@ -71,8 +71,8 @@ test_cmp_branch_tree () {\n>  \t\tfind . -type d -name .git -prune -o -type f -print\n>  \t) | sort >module-git-\"$1\".list &&\n>  \ttest_cmp module-cvs-\"$1\".list module-git-\"$1\".list &&\n> -\tcat module-cvs-\"$1\".list | while read f\n> +\twhile read f\n>  \tdo\n>  \t\ttest_cmp_branch_file \"$1\" \"$f\" || return 1\n> -\tdone\n> +\tdone <module-cvs-\"$1\".list\n>  }\n\nAgain, trivially correct.\n"},{"id":"490029","messageId":"xmqqplw8xqio.fsf@gitster.g","threadId":"61057","inReplyTo":"20240305212533.12947-5-dev+git@drbeat.li","subject":"Re: [PATCH 04/22] t/annotate-tests.sh: avoid redundant use of cat","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-05T22:28:15Z","receivedAt":"2024-03-05T22:28:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Beat Bolli\" <bb@drbeat.li> writes:\n\n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>  t/annotate-tests.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh\n> index 5e21e84f3884..87572459e4b8 100644\n> --- a/t/annotate-tests.sh\n> +++ b/t/annotate-tests.sh\n> @@ -532,7 +532,7 @@ test_expect_success 'blame -L :funcname with userdiff driver' '\n>  \t\t\"$(cat file.template)\" &&\n>  \ttest_commit --author \"B <B@test.git>\" \\\n>  \t\t\"change\" \"$fortran_file\" \\\n> -\t\t\"$(cat file.template | sed -e s/ChangeMe/IWasChanged/)\" &&\n> +\t\t\"$(sed -e s/ChangeMe/IWasChanged/ file.template)\" &&\n\nObviously correct, but \n\n\t\t\"$(sed -e s/ChangeMe/IWasChanged/ <file.template)\" &&\n\nmight be a more faithful conversion (when \"sed\" looks at its ARGV[],\nit did not find anything before, and it would not find anything\nafter this patch).\n\nNot worth a reroll, of course, though.\n"},{"id":"490030","messageId":"xmqqle6wxqh9.fsf@gitster.g","threadId":"61057","inReplyTo":"20240305212533.12947-6-dev+git@drbeat.li","subject":"Re: [PATCH 05/22] t/perf: avoid redundant use of cat","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-05T22:29:06Z","receivedAt":"2024-03-05T22:29:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Beat Bolli\" <bb@drbeat.li> writes:\n\n> Take care to redirect stdin, otherwise the output of wc would also contain\n> the file name.\n>\n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>  t/perf/repos/inflate-repo.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/perf/repos/inflate-repo.sh b/t/perf/repos/inflate-repo.sh\n> index fcfc992b5b02..412e4b450b16 100755\n> --- a/t/perf/repos/inflate-repo.sh\n> +++ b/t/perf/repos/inflate-repo.sh\n> @@ -33,7 +33,7 @@ do\n>  done\n>  \n>  git ls-tree -r HEAD >GEN_src_list\n> -nr_src_files=$(cat GEN_src_list | wc -l)\n> +nr_src_files=$(wc -l <GEN_src_list)\n\nGood thinking to explicitly redirect into the command.\n\n>  \n>  src_branch=$(git symbolic-ref --short HEAD)\n"},{"id":"490033","messageId":"8b9667e5-0d2f-4624-8f7c-f8400250a21e@gmail.com","threadId":"61057","inReplyTo":"20240305212533.12947-15-dev+git@drbeat.li","subject":"Re: [PATCH 14/22] t/t9*: avoid redundant uses of cat","fromName":"Rubén Justo","fromEmail":"rjusto@gmail.com","sentAt":"2024-03-05T22:52:18Z","receivedAt":"2024-03-05T22:52:35Z","isPatch":true,"sender":{"key":"rjusto@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5685487?v=4"},"body":"On Tue, Mar 05, 2024 at 10:25:13PM +0100, Beat Bolli wrote:\n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>  t/t9300-fast-import.sh          | 10 +++++-----\n>  t/t9350-fast-export.sh          |  2 +-\n>  t/t9400-git-cvsserver-server.sh | 35 +++++++++++++++------------------\n>  t/t9802-git-p4-filetype.sh      |  2 +-\n>  t/t9807-git-p4-submit.sh        |  2 +-\n>  t/t9824-git-p4-git-lfs.sh       |  4 ++--\n>  6 files changed, 26 insertions(+), 29 deletions(-)\n> \n> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\n> index dbb5042b0b8f..c03adbdd145f 100755\n> --- a/t/t9300-fast-import.sh\n> +++ b/t/t9300-fast-import.sh\n> @@ -986,7 +986,7 @@ test_expect_success 'L: nested tree copy does not corrupt deltas' '\n>  \ttest_when_finished \"git update-ref -d refs/heads/L2\" &&\n>  \tgit fast-import <input &&\n>  \tgit ls-tree L2 g/b/ >tmp &&\n> -\tcat tmp | cut -f 2 >actual &&\n> +\tcut -f 2 <tmp >actual &&\n>  \ttest_cmp expect actual &&\n\nNit: Maybe we can avoid tmp.\n\n>  \tgit fsck $(git rev-parse L2)\n>  '\n> @@ -2012,7 +2012,7 @@ test_expect_success 'Q: verify first notes tree' '\n>  \t100644 blob $commit2\n>  \t100644 blob $commit3\n>  \tEOF\n> -\tcat expect.unsorted | sort >expect &&\n> +\tsort expect.unsorted >expect &&\n\nNit: I wonder if we can also avoid the cat that just precedes this hunk.\n\n>  '\n> @@ -2053,7 +2053,7 @@ test_expect_success 'Q: verify second notes tree' '\n>  \t100644 blob $commit2\n>  \t100644 blob $commit3\n>  \tEOF\n> -\tcat expect.unsorted | sort >expect &&\n> +\tsort expect.unsorted >expect &&\n\nDitto.\n\n>  \tgit cat-file -p refs/notes/foobar^^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n>  \ttest_cmp expect actual\n>  '\n> @@ -2091,7 +2091,7 @@ test_expect_success 'Q: verify third notes tree' '\n>  \tcat >expect.unsorted <<-EOF &&\n>  \t100644 blob $commit1\n>  \tEOF\n> -\tcat expect.unsorted | sort >expect &&\n> +\tsort expect.unsorted >expect &&\n\nDitto.\n\n>  \tgit cat-file -p refs/notes/foobar2^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n>  \ttest_cmp expect actual\n>  '\n> @@ -2118,7 +2118,7 @@ test_expect_success 'Q: verify fourth notes tree' '\n>  \tcat >expect.unsorted <<-EOF &&\n>  \t100644 blob $commit2\n>  \tEOF\n> -\tcat expect.unsorted | sort >expect &&\n> +\tsort expect.unsorted >expect &&\n\nDitto.\n"},{"id":"490034","messageId":"18dc05ee-d0fe-4de0-87fa-256816125489@gmail.com","threadId":"61057","inReplyTo":"20240305212533.12947-23-dev+git@drbeat.li","subject":"Re: [PATCH 22/22] git-quiltimport: avoid an unnecessary subshell","fromName":"Rubén Justo","fromEmail":"rjusto@gmail.com","sentAt":"2024-03-05T22:55:21Z","receivedAt":"2024-03-05T22:55:28Z","isPatch":true,"sender":{"key":"rjusto@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5685487?v=4"},"body":"On Tue, Mar 05, 2024 at 10:25:20PM +0100, Beat Bolli wrote:\n> Merge multiple sed and \"grep | awk\" invocations, finally use \"sort -u\"\n> instead of \"sort | uniq\".\n> \n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>  contrib/coverage-diff.sh | 9 ++-------\n>  1 file changed, 2 insertions(+), 7 deletions(-)\n> \n> diff --git a/contrib/coverage-diff.sh b/contrib/coverage-diff.sh\n> index 4ec419f90048..6ce9603568ef 100755\n> --- a/contrib/coverage-diff.sh\n> +++ b/contrib/coverage-diff.sh\n> @@ -74,8 +74,7 @@ do\n>  \tsort >uncovered_lines.txt\n>  \n>  \tcomm -12 uncovered_lines.txt new_lines.txt |\n> -\tsed -e 's/$/\\)/' |\n> -\tsed -e 's/^/ /' >uncovered_new_lines.txt\n> +\tsed -e 's/$/\\)/' -e 's/^/ /' >uncovered_new_lines.txt\n>  \n>  \tgrep -q '[^[:space:]]' <uncovered_new_lines.txt &&\n>  \techo $file >>coverage-data.txt &&\n> @@ -91,11 +90,7 @@ cat coverage-data.txt\n>  \n>  echo \"Commits introducing uncovered code:\"\n>  \n> -commit_list=$(cat coverage-data.txt |\n> -\tgrep -E '^[0-9a-f]{7,} ' |\n> -\tawk '{print $1;}' |\n> -\tsort |\n> -\tuniq)\n> +commit_list=$(awk '/^[0-9a-f]{7,}/ { print $1 }' coverage-data.txt | sort -u)\n\nOK.  Not worth a re-roll of course, but perhaps some wrapping would be\nwelcomed here.\n\n>  \n>  (\n>  \tfor commit in $commit_list\n> -- \n> 2.44.0\n> \n"},{"id":"490035","messageId":"0fbe2b2e-448d-4611-8183-ce706d5848ae@gmail.com","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"Re: [PATCH 00/22] avoid redundant pipelines","fromName":"Rubén Justo","fromEmail":"rjusto@gmail.com","sentAt":"2024-03-05T22:58:04Z","receivedAt":"2024-03-05T22:58:21Z","isPatch":true,"sender":{"key":"rjusto@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5685487?v=4"},"body":"On Tue, Mar 05, 2024 at 10:24:59PM +0100, Beat Bolli wrote:\n> As follow-up to [1], here's a series that eliminates redundant\n> pipelines, mostly under t/.\n> \n> Spawning a process is notoriously slow on Windows, so this will improve\n> test performance.\n> \n> 1/22 to 14/22 remove redundant uses of \"cat\" where the shell handles\n> input redirection from a file or the command can take a file argument.\n> \n> 15/22 to 20/22 merge redundant uses of \"grep\" into the following \"sed\"\n> or \"awk\" command. Both of these are capable of filtering themselves. I'm\n> a bit on the fence about this part because readability suffers in some\n> cases. It was a fun exercise, though :-)\n> \n> 21/22 merges multiple \"sed\" calls into one and replaces a whole \"cat |\n> grep | awk\" construct with a single \"awk\" call and uses \"sort -u\"\n> instead of \"sort | uniq\".\n> \n> 22/22 finally is a bit of an outlier in that it replaces a subshell with\n> a shell compound command.\n\nI have given it a cursory read and it looks a very good improvement.\n\nI've left a couple of nits, none of them deserve a re-roll.\n\nThank you!\n"},{"id":"490038","messageId":"xmqqbk7sxmnr.fsf@gitster.g","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"Re: [PATCH 00/22] avoid redundant pipelines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-05T23:51:36Z","receivedAt":"2024-03-05T23:51:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Beat Bolli\" <bb@drbeat.li> writes:\n\n> As follow-up to [1], here's a series that eliminates redundant\n> pipelines, mostly under t/.\n>\n> Spawning a process is notoriously slow on Windows, so this will improve\n> test performance.\n\nYay!\n\n> 1/22 to 14/22 remove redundant uses of \"cat\" where the shell handles\n> input redirection from a file or the command can take a file argument.\n>\n> 15/22 to 20/22 merge redundant uses of \"grep\" into the following \"sed\"\n> or \"awk\" command. Both of these are capable of filtering themselves. I'm\n> a bit on the fence about this part because readability suffers in some\n> cases. It was a fun exercise, though :-)\n>\n> 21/22 merges multiple \"sed\" calls into one and replaces a whole \"cat |\n> grep | awk\" construct with a single \"awk\" call and uses \"sort -u\"\n> instead of \"sort | uniq\".\n>\n> 22/22 finally is a bit of an outlier in that it replaces a subshell with\n> a shell compound command.\n>\n> In the tests, I have completely arbitrarily separated the commits into\n> thousands blocks to keep the commits and their reviews manageable.\n>\n> All tests that I was able to run still pass. I don't have p4 or cvs\n> installed.\n>\n> [1] https://lore.kernel.org/git/20240216171046.927552-1-dev+git@drbeat.li/\n\nThanks.\n"},{"id":"490039","messageId":"bdae6d2d-af56-4bc0-a000-5cf2ef44cd44@gmail.com","threadId":"61057","inReplyTo":"xmqqplw8xqio.fsf@gitster.g","subject":"Re: [PATCH 04/22] t/annotate-tests.sh: avoid redundant use of cat","fromName":"Rubén Justo","fromEmail":"rjusto@gmail.com","sentAt":"2024-03-06T00:04:36Z","receivedAt":"2024-03-06T00:04:44Z","isPatch":true,"sender":{"key":"rjusto@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5685487?v=4"},"body":"On Tue, Mar 05, 2024 at 02:28:15PM -0800, Junio C Hamano wrote:\n> \"Beat Bolli\" <bb@drbeat.li> writes:\n> \n> > Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> > ---\n> >  t/annotate-tests.sh | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh\n> > index 5e21e84f3884..87572459e4b8 100644\n> > --- a/t/annotate-tests.sh\n> > +++ b/t/annotate-tests.sh\n> > @@ -532,7 +532,7 @@ test_expect_success 'blame -L :funcname with userdiff driver' '\n> >  \t\t\"$(cat file.template)\" &&\n> >  \ttest_commit --author \"B <B@test.git>\" \\\n> >  \t\t\"change\" \"$fortran_file\" \\\n> > -\t\t\"$(cat file.template | sed -e s/ChangeMe/IWasChanged/)\" &&\n> > +\t\t\"$(sed -e s/ChangeMe/IWasChanged/ file.template)\" &&\n> \n> Obviously correct, but \n> \n> \t\t\"$(sed -e s/ChangeMe/IWasChanged/ <file.template)\" &&\n> \n> might be a more faithful conversion (when \"sed\" looks at its ARGV[],\n> it did not find anything before, and it would not find anything\n> after this patch).\n\nGood point.  Thank you for being careful.\n\n> \n> Not worth a reroll, of course, though.\n"},{"id":"490040","messageId":"xmqq7cigxl1o.fsf@gitster.g","threadId":"61057","inReplyTo":"bdae6d2d-af56-4bc0-a000-5cf2ef44cd44@gmail.com","subject":"Re: [PATCH 04/22] t/annotate-tests.sh: avoid redundant use of cat","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-06T00:26:27Z","receivedAt":"2024-03-06T00:26:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Rubén Justo <rjusto@gmail.com> writes:\n\n> On Tue, Mar 05, 2024 at 02:28:15PM -0800, Junio C Hamano wrote:\n>> \"Beat Bolli\" <bb@drbeat.li> writes:\n>> \n>> > Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n>> > ---\n>> >  t/annotate-tests.sh | 2 +-\n>> >  1 file changed, 1 insertion(+), 1 deletion(-)\n>> >\n>> > diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh\n>> > index 5e21e84f3884..87572459e4b8 100644\n>> > --- a/t/annotate-tests.sh\n>> > +++ b/t/annotate-tests.sh\n>> > @@ -532,7 +532,7 @@ test_expect_success 'blame -L :funcname with userdiff driver' '\n>> >  \t\t\"$(cat file.template)\" &&\n>> >  \ttest_commit --author \"B <B@test.git>\" \\\n>> >  \t\t\"change\" \"$fortran_file\" \\\n>> > -\t\t\"$(cat file.template | sed -e s/ChangeMe/IWasChanged/)\" &&\n>> > +\t\t\"$(sed -e s/ChangeMe/IWasChanged/ file.template)\" &&\n>> \n>> Obviously correct, but \n>> \n>> \t\t\"$(sed -e s/ChangeMe/IWasChanged/ <file.template)\" &&\n>> \n>> might be a more faithful conversion (when \"sed\" looks at its ARGV[],\n>> it did not find anything before, and it would not find anything\n>> after this patch).\n>\n> Good point.  Thank you for being careful.\n\nHeh, I actually consider it the most irrelevant one among my\ncomments.  I actally do not think there is a way tell if your \"sed\"\ninvocation is reading from one of the files listed on the command\nline, or reading from the standard input, from your sed script,\nunlike say Perl that has access to @ARGV.  Certainly a simple s/A/B/\nwould not care.\n\nCompared to that, rewriting $(cat file | wc -l) to $(wc -l <file)\ndoes matter, which was done in [05/22].\n"},{"id":"490042","messageId":"f3e41a51-a173-444b-bde9-216147cd667a@gmail.com","threadId":"61057","inReplyTo":"xmqq7cigxl1o.fsf@gitster.g","subject":"Re: [PATCH 04/22] t/annotate-tests.sh: avoid redundant use of cat","fromName":"Rubén Justo","fromEmail":"rjusto@gmail.com","sentAt":"2024-03-06T00:38:37Z","receivedAt":"2024-03-06T00:38:43Z","isPatch":true,"sender":{"key":"rjusto@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5685487?v=4"},"body":"On Tue, Mar 05, 2024 at 04:26:27PM -0800, Junio C Hamano wrote:\n> Rubén Justo <rjusto@gmail.com> writes:\n> \n> > On Tue, Mar 05, 2024 at 02:28:15PM -0800, Junio C Hamano wrote:\n> >> \"Beat Bolli\" <bb@drbeat.li> writes:\n> >> \n> >> > Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> >> > ---\n> >> >  t/annotate-tests.sh | 2 +-\n> >> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >> >\n> >> > diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh\n> >> > index 5e21e84f3884..87572459e4b8 100644\n> >> > --- a/t/annotate-tests.sh\n> >> > +++ b/t/annotate-tests.sh\n> >> > @@ -532,7 +532,7 @@ test_expect_success 'blame -L :funcname with userdiff driver' '\n> >> >  \t\t\"$(cat file.template)\" &&\n> >> >  \ttest_commit --author \"B <B@test.git>\" \\\n> >> >  \t\t\"change\" \"$fortran_file\" \\\n> >> > -\t\t\"$(cat file.template | sed -e s/ChangeMe/IWasChanged/)\" &&\n> >> > +\t\t\"$(sed -e s/ChangeMe/IWasChanged/ file.template)\" &&\n> >> \n> >> Obviously correct, but \n> >> \n> >> \t\t\"$(sed -e s/ChangeMe/IWasChanged/ <file.template)\" &&\n> >> \n> >> might be a more faithful conversion (when \"sed\" looks at its ARGV[],\n> >> it did not find anything before, and it would not find anything\n> >> after this patch).\n> >\n> > Good point.  Thank you for being careful.\n> \n> Heh, I actually consider it the most irrelevant one among my\n> comments.  I actally do not think there is a way tell if your \"sed\"\n> invocation is reading from one of the files listed on the command\n> line, or reading from the standard input, from your sed script,\n> unlike say Perl that has access to @ARGV.  Certainly a simple s/A/B/\n> would not care.\n> \n> Compared to that, rewriting $(cat file | wc -l) to $(wc -l <file)\n> does matter, which was done in [05/22].\n\nYeah, that is needed; faithfulness is appreciated.\n"},{"id":"490044","messageId":"xmqqwmqgw5oq.fsf@gitster.g","threadId":"61057","inReplyTo":"8b9667e5-0d2f-4624-8f7c-f8400250a21e@gmail.com","subject":"Re: [PATCH 14/22] t/t9*: avoid redundant uses of cat","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-06T00:43:33Z","receivedAt":"2024-03-06T00:43:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Rubén Justo <rjusto@gmail.com> writes:\n\n>>  \ttest_when_finished \"git update-ref -d refs/heads/L2\" &&\n>>  \tgit fast-import <input &&\n>>  \tgit ls-tree L2 g/b/ >tmp &&\n>> -\tcat tmp | cut -f 2 >actual &&\n>> +\tcut -f 2 <tmp >actual &&\n>>  \ttest_cmp expect actual &&\n>\n> Nit: Maybe we can avoid tmp.\n\nPiping \"git ls-tree\" output to \"cut\" would hide the exit status of\n\"git ls-tree\" if it fails, which is not a good idea, so I do not\nthink of a way to avoid tmp so easily.\n\n>\n>>  \tgit fsck $(git rev-parse L2)\n>>  '\n>> @@ -2012,7 +2012,7 @@ test_expect_success 'Q: verify first notes tree' '\n>>  \t100644 blob $commit2\n>>  \t100644 blob $commit3\n>>  \tEOF\n>> -\tcat expect.unsorted | sort >expect &&\n>> +\tsort expect.unsorted >expect &&\n>\n> Nit: I wonder if we can also avoid the cat that just precedes this hunk.\n\nThe whole thing reads like this:\n\ntest_expect_success 'Q: verify first notes tree' '\n\tcat >expect.unsorted <<-EOF &&\n\t100644 blob $commit1\n\t100644 blob $commit2\n\t100644 blob $commit3\n\tEOF\n\tcat expect.unsorted | sort >expect &&\n\tgit cat-file -p refs/notes/foobar~2^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n\ttest_cmp expect actual\n'\n\nAs we are not in the business of debugging system-provided \"sort\",\nI agree that\n\n\tsort >expect <<-EOF &&\n\t100644 blob $commit1\n\t100644 blob $commit2\n\t100644 blob $commit3\n\tEOF\n\nwithout having to use expect.unsorted would probably make sense.\nWell spotted.\n\nThis is outside the topic, but this test has different clean-up\nopportunities that are not related to the \"do not run cat a single\nfile and send its output into a pipe\" pattern.  The expected output\nwe see here implicitly depends on the fact that the notes tree is so\nsmall that it hasn't been reorganized using fan-out levels.  If the\nalgorithm to decide when to start using fan-out directories changes,\nthis test can break.  To avoid that, we may need to do something\nlike\n\n\tgit ls-tree -r refs/notes/foobar~2 >ls-tree &&\n\tsed -e \"s/ [0-9a-f]*               / /\" -e \"s|/||g\" >actual &&\n\nso that we will get the commit object name without the slashes that\nshow the fan-out directories.  Also, the current \"actual\" generation\nhides the exit status from \"git cat-file\".\n"},{"id":"490045","messageId":"xmqqo7bsw5el.fsf@gitster.g","threadId":"61057","inReplyTo":"20240305212533.12947-10-dev+git@drbeat.li","subject":"Re: [PATCH 09/22] t/t4*: avoid redundant uses of cat","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-06T00:49:38Z","receivedAt":"2024-03-06T00:49:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Beat Bolli\" <bb@drbeat.li> writes:\n\n> @@ -786,7 +786,7 @@ test_expect_success 'am takes patches from a Pine mailbox' '\n>  \trm -fr .git/rebase-apply &&\n>  \tgit reset --hard &&\n>  \tgit checkout first &&\n> -\tcat pine patch1 | git am &&\n> +\tgit am pine patch1 &&\n>  \ttest_path_is_missing .git/rebase-apply &&\n>  \tgit diff --exit-code main^..HEAD\n>  '\n\nI am not so certain about this one.\n\nWe can say \"sed can read from the file listed on the command line,\nor it can read from its standard input, so we can use whichever is\nconvenient for us\", as we are not in the business of testing \"sed\"\nthat is supplied by the system.\n\nOn the other hand, the ability of \"git am\" to read either from the\nfiles listed on the command line or from the standard input is not a\ngiven.  It is one of the many aspects of how \"git am\" behaves that\nwe are testing.  By changing a test that feeds the contents of the\nmailboxes from the standard input to instead have the command read\nthese mailbox files listed on the command line, this changes what\ngets tested.\n\nAll other changes in the file look good to me.\n\nThanks.\n"},{"id":"490047","messageId":"xmqqjzmgw54q.fsf@gitster.g","threadId":"61057","inReplyTo":"20240305212533.12947-17-dev+git@drbeat.li","subject":"Re: [PATCH 16/22] t/t3*: merge a \"grep | awk\" pipeline","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-06T00:55:33Z","receivedAt":"2024-03-06T00:55:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Beat Bolli\" <bb@drbeat.li> writes:\n\n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>  t/t3920-crlf-messages.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh\n> index 5eed640a6825..50ae222f0842 100755\n> --- a/t/t3920-crlf-messages.sh\n> +++ b/t/t3920-crlf-messages.sh\n> @@ -97,7 +97,7 @@ test_expect_success 'branch: --verbose works with messages using CRLF' '\n>  \tgit branch -v >tmp &&\n>  \t# Remove first two columns, and the line for the currently checked out branch\n>  \tcurrent=$(git branch --show-current) &&\n> -\tgrep -v $current <tmp | awk \"{\\$1=\\$2=\\\"\\\"}1\"  >actual &&\n> +\tawk \"/$current/ { next } { \\$1 = \\$2 = \\\"\\\" } 1\" <tmp >actual &&\n>  \ttest_cmp expect actual\n>  '\n\nOK.  The original excludes any line that has $current (a branch name\nwithout any funny letter in it) on it and sends the rest to awk.\nThe updated does the skipping inside the awk script.  They should be\nequivalents.\n\nLooks good.\n"},{"id":"490048","messageId":"xmqqfrx4w52b.fsf@gitster.g","threadId":"61057","inReplyTo":"20240305212533.12947-19-dev+git@drbeat.li","subject":"Re: [PATCH 18/22] t/t5*: merge a \"grep | sed\" pipeline","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-06T00:57:00Z","receivedAt":"2024-03-06T00:57:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Beat Bolli\" <bb@drbeat.li> writes:\n\n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>  t/t5401-update-hooks.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t5401-update-hooks.sh b/t/t5401-update-hooks.sh\n> index 8b8bc47dc0b9..d8cadeec7331 100755\n> --- a/t/t5401-update-hooks.sh\n> +++ b/t/t5401-update-hooks.sh\n> @@ -123,7 +123,7 @@ remote: STDOUT post-update\n>  remote: STDERR post-update\n>  EOF\n>  test_expect_success 'send-pack stderr contains hook messages' '\n> -\tgrep ^remote: send.err | sed \"s/ *\\$//\" >actual &&\n> +\tsed -n \"/^remote:/s/ *\\$//p\" send.err >actual &&\n>  \ttest_cmp expect actual\n>  '\n\nBoth 17 & 18 look good.\n"},{"id":"490049","messageId":"xmqq8r2ww4xg.fsf@gitster.g","threadId":"61057","inReplyTo":"20240305212533.12947-20-dev+git@drbeat.li","subject":"Re: [PATCH 19/22] t/t8*: merge \"grep | sed\" pipelines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-06T00:59:55Z","receivedAt":"2024-03-06T01:00:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Beat Bolli\" <bb@drbeat.li> writes:\n\n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>  t/t8013-blame-ignore-revs.sh | 28 ++++++++++++++--------------\n>  1 file changed, 14 insertions(+), 14 deletions(-)\n>\n> diff --git a/t/t8013-blame-ignore-revs.sh b/t/t8013-blame-ignore-revs.sh\n> index 9a03b0f361ff..05213d13f30f 100755\n> --- a/t/t8013-blame-ignore-revs.sh\n> +++ b/t/t8013-blame-ignore-revs.sh\n> @@ -25,11 +25,11 @@ test_expect_success setup '\n>  \n>  \tgit blame --line-porcelain file >blame_raw &&\n>  \n> -\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n> +\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 1/s/ .*//p\" blame_raw >actual &&\n\nIsn't -E a GNUism?\n\nAt least,\n\n    https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html\n\ndoes not seem to have it (we may need to fix t6030 to rid its only\nexisting use).\n"},{"id":"490051","messageId":"xmqq4jdkw4wm.fsf@gitster.g","threadId":"61057","inReplyTo":"20240305212533.12947-21-dev+git@drbeat.li","subject":"Re: [PATCH 20/22] t/t9*: merge \"grep | sed\" pipelines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-06T01:00:25Z","receivedAt":"2024-03-06T01:00:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Beat Bolli\" <bb@drbeat.li> writes:\n\n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>  t/t9118-git-svn-funky-branch-names.sh | 2 +-\n>  t/t9350-fast-export.sh                | 2 +-\n>  t/t9824-git-p4-git-lfs.sh             | 2 +-\n>  3 files changed, 3 insertions(+), 3 deletions(-)\n\nLooking good.  Thanks.\n"},{"id":"490052","messageId":"CAPig+cQ13SANfReDNxVRPmS2TbK+0ZU4mT6g1rw9kWJHzH-j2w@mail.gmail.com","threadId":"61057","inReplyTo":"20240305212533.12947-10-dev+git@drbeat.li","subject":"Re: [PATCH 09/22] t/t4*: avoid redundant uses of cat","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-03-06T01:08:07Z","receivedAt":"2024-03-06T01:08:19Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Mar 5, 2024 at 4:31 PM Beat Bolli <bb@drbeat.li> wrote:\n> diff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh\n> @@ -232,7 +232,7 @@ keep_only_cr () {\n>  test_expect_success 'external diff with autocrlf = true' '\n>         test_config core.autocrlf true &&\n>         GIT_EXTERNAL_DIFF=./fake-diff.sh git diff &&\n> -       test $(wc -l < crlfed.txt) = $(cat crlfed.txt | keep_only_cr | wc -c)\n> +       test $(wc -l < crlfed.txt) = $(keep_only_cr <crlfed.txt | wc -c)\n>  '\n\nCould also fix the style problem (drop whitespace after existing `<`\noperator) while here, but not at all worth a reroll.\n\n> diff --git a/t/t4150-am.sh b/t/t4150-am.sh\n> @@ -786,7 +786,7 @@ test_expect_success 'am takes patches from a Pine mailbox' '\n>         git checkout first &&\n> -       cat pine patch1 | git am &&\n> +       git am pine patch1 &&\n\nAs with Junio, the semantic change made here concerned me.\n"},{"id":"490053","messageId":"c69350a7-027f-4834-8a6d-ff0e0632ce6c@gmail.com","threadId":"61057","inReplyTo":"xmqqwmqgw5oq.fsf@gitster.g","subject":"Re: [PATCH 14/22] t/t9*: avoid redundant uses of cat","fromName":"Rubén Justo","fromEmail":"rjusto@gmail.com","sentAt":"2024-03-06T01:10:43Z","receivedAt":"2024-03-06T01:10:50Z","isPatch":true,"sender":{"key":"rjusto@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5685487?v=4"},"body":"On Tue, Mar 05, 2024 at 04:43:33PM -0800, Junio C Hamano wrote:\n> Rubén Justo <rjusto@gmail.com> writes:\n> \n> >>  \tgit ls-tree L2 g/b/ >tmp &&\n> >> -\tcat tmp | cut -f 2 >actual &&\n> >> +\tcut -f 2 <tmp >actual &&\n> >>  \ttest_cmp expect actual &&\n> >\n> > Nit: Maybe we can avoid tmp.\n> \n> Piping \"git ls-tree\" output to \"cut\" would hide the exit status of\n> \"git ls-tree\" if it fails, which is not a good idea, so I do not\n> think of a way to avoid tmp so easily.\n\nRight.  Thanks for pointing that out.\n"},{"id":"490056","messageId":"ZefSPAiTLrRVeXm6@pobox.com","threadId":"61057","inReplyTo":"xmqq8r2ww4xg.fsf@gitster.g","subject":"Re: [PATCH 19/22] t/t8*: merge \"grep | sed\" pipelines","fromName":"Todd Zullinger","fromEmail":"tmz@pobox.com","sentAt":"2024-03-06T02:17:32Z","receivedAt":"2024-03-06T02:17:36Z","isPatch":true,"sender":{"key":"tmz@pobox.com","avatar":"https://avatars.githubusercontent.com/u/806319?v=4"},"body":"Junio C Hamano wrote:\n> Isn't -E a GNUism?\n>\n> At least,\n> \n>     https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html\n> \n> does not seem to have it (we may need to fix t6030 to rid its only\n> existing use).\n\nI _thought_ that -r was the GNUism.  The GNU sed-4.8 manpage\nsays:\n\n    -E, -r, --regexp-extended\n        use extended regular expressions in the script\n        (for portability use POSIX -E).\n\nThat doesn't mean the man page is right, of course. :)\n\nhttps://www.austingroupbugs.net/view.php?id=528 suggests\nthat -E has been adopted and, importanly, is more widely\nsupported than -r (if we were considering using that rather\nthan rewriting this to not use ERE syntax).  MacOS in\nparticular supports -E but not -r, according to that link.\n\nIt seems like the documentation hasn't quite caught up to\nreality yet, perhaps?\n\n-- \nTodd\n"},{"id":"490092","messageId":"xmqqplw7tkib.fsf@gitster.g","threadId":"61057","inReplyTo":"ZefSPAiTLrRVeXm6@pobox.com","subject":"Re: [PATCH 19/22] t/t8*: merge \"grep | sed\" pipelines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-06T16:03:56Z","receivedAt":"2024-03-06T16:03:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Todd Zullinger <tmz@pobox.com> writes:\n\n> Junio C Hamano wrote:\n>> Isn't -E a GNUism?\n> ...\n> https://www.austingroupbugs.net/view.php?id=528 suggests\n> that -E has been adopted \n\nThen that is OK.  Thanks for a good news.\n\n> and, importanly, is more widely\n> supported than -r (if we were considering using that rather\n> than rewriting this to not use ERE syntax).\n\nAt least I wasn't, so it is irrelevant to this review, but it still\nis nice to know about it [*].  Thanks.\n\n[Footnote] \n\n * or is the knowledge of '-r' itself also irrelevant, now '-E' is\n   kosher and widely usable?\n"},{"id":"490113","messageId":"6571138d-16b0-4c59-b6fe-a256b1c7e37a@drbeat.li","threadId":"61057","inReplyTo":"ZefSPAiTLrRVeXm6@pobox.com","subject":"Re: [PATCH 19/22] t/t8*: merge \"grep | sed\" pipelines","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2024-03-06T21:03:16Z","receivedAt":"2024-03-06T21:03:20Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"On 06.03.24 03:17, Todd Zullinger wrote:\n> Junio C Hamano wrote:\n>> Isn't -E a GNUism?\n>>\n>> At least,\n>>\n>>      https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html\n>>\n>> does not seem to have it (we may need to fix t6030 to rid its only\n>> existing use).\n> \n> I _thought_ that -r was the GNUism.  The GNU sed-4.8 manpage\n> says:\n> \n>      -E, -r, --regexp-extended\n>          use extended regular expressions in the script\n>          (for portability use POSIX -E).\n> \n> That doesn't mean the man page is right, of course. :)\n> \n> https://www.austingroupbugs.net/view.php?id=528 suggests\n> that -E has been adopted and, importanly, is more widely\n> supported than -r (if we were considering using that rather\n> than rewriting this to not use ERE syntax).  MacOS in\n> particular supports -E but not -r, according to that link.\n> \n> It seems like the documentation hasn't quite caught up to\n> reality yet, perhaps?\n> \n\nAt least macOS Ventura and later supports \"sed -E\". I can't say what the \nmore exotic platforms (NonStop?) have.\n"},{"id":"490114","messageId":"b7cfeb02-eab6-4822-921f-89a00a66e4b0@drbeat.li","threadId":"61057","inReplyTo":"CAPig+cQ13SANfReDNxVRPmS2TbK+0ZU4mT6g1rw9kWJHzH-j2w@mail.gmail.com","subject":"Re: [PATCH 09/22] t/t4*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2024-03-06T20:58:41Z","receivedAt":"2024-03-06T21:03:37Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"On 06.03.24 02:08, Eric Sunshine wrote:\n> On Tue, Mar 5, 2024 at 4:31 PM Beat Bolli <bb@drbeat.li> wrote:\n>> diff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh\n>> @@ -232,7 +232,7 @@ keep_only_cr () {\n>>   test_expect_success 'external diff with autocrlf = true' '\n>>          test_config core.autocrlf true &&\n>>          GIT_EXTERNAL_DIFF=./fake-diff.sh git diff &&\n>> -       test $(wc -l < crlfed.txt) = $(cat crlfed.txt | keep_only_cr | wc -c)\n>> +       test $(wc -l < crlfed.txt) = $(keep_only_cr <crlfed.txt | wc -c)\n>>   '\n> \n> Could also fix the style problem (drop whitespace after existing `<`\n> operator) while here, but not at all worth a reroll.\n> \n>> diff --git a/t/t4150-am.sh b/t/t4150-am.sh\n>> @@ -786,7 +786,7 @@ test_expect_success 'am takes patches from a Pine mailbox' '\n>>          git checkout first &&\n>> -       cat pine patch1 | git am &&\n>> +       git am pine patch1 &&\n> \n> As with Junio, the semantic change made here concerned me.\n\nI was even more on the fence about this hunk than the others, but then \nthe test was about 'am takes patches from a Pine mailbox', not \nspecifically about reading a Pine mailbox from stdin. But I can drop \nthis hunk in v2.\n\nCheers, Beat\n"},{"id":"490117","messageId":"xmqq1q8nqbhb.fsf@gitster.g","threadId":"61057","inReplyTo":"6571138d-16b0-4c59-b6fe-a256b1c7e37a@drbeat.li","subject":"Re: [PATCH 19/22] t/t8*: merge \"grep | sed\" pipelines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-06T21:47:12Z","receivedAt":"2024-03-06T21:47:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Beat Bolli <dev+git@drbeat.li> writes:\n\n> On 06.03.24 03:17, Todd Zullinger wrote:\n>> Junio C Hamano wrote:\n>>> Isn't -E a GNUism?\n>>>\n>>> At least,\n>>>\n>>>      https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html\n>>>\n>>> does not seem to have it (we may need to fix t6030 to rid its only\n>>> existing use).\n>> I _thought_ that -r was the GNUism.  The GNU sed-4.8 manpage\n>> says:\n>>      -E, -r, --regexp-extended\n>>          use extended regular expressions in the script\n>>          (for portability use POSIX -E).\n>> That doesn't mean the man page is right, of course. :)\n>> https://www.austingroupbugs.net/view.php?id=528 suggests\n>> that -E has been adopted and, importanly, is more widely\n> ...\n> At least macOS Ventura and later supports \"sed -E\". I can't say what\n> the more exotic platforms (NonStop?) have.\n\nMore exotic platforms may lag behind, and it is a very valid\nconcern.  Also, the bug #528 does talk about -E being accepted, but\nwasn't it accepted for Issue 8, which is not finalized yet, no?\n\nSo it seems it may be prudent to stick to BRE if we were to squash\nthese pipelines into a single sed invocation, at least for a few\nyears.\n\nThanks.\n"},{"id":"490711","messageId":"20240315194620.10713-1-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240305212533.12947-1-dev+git@drbeat.li","subject":"[PATCH v2 00/22] avoid redundant pipelines","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:45:57Z","receivedAt":"2024-03-15T19:46:40Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"As follow-up to [1], here's a series that eliminates redundant\npipelines, mostly under t/.\n\nSpawning a process is notoriously slow on Windows, so this will improve\ntest performance.\n\n1/22 to 14/22 remove redundant uses of \"cat\" where the shell handles\ninput redirection from a file or the command can take a file argument.\n\n15/22 to 20/22 merge redundant uses of \"grep\" into the following \"sed\"\nor \"awk\" command. Both of these are capable of filtering themselves.\n\n21/22 merges multiple \"sed\" calls into one and replaces a whole \"cat |\ngrep | awk\" construct with a single \"awk\" call and uses \"sort -u\"\ninstead of \"sort | uniq\".\n\n22/22 finally is a bit of an outlier in that it replaces a subshell with\na shell compound command.\n\nIn the tests, I have completely arbitrarily separated the commits into\nthousands blocks to keep the commits and their reviews manageable.\n\nAll tests that I was able to run still pass. I don't have p4 or cvs\ninstalled.\n\n[1] https://lore.kernel.org/git/20240216171046.927552-1-dev+git@drbeat.li/\n\n\nChanges from v1 (see also the range-diff below):\n\n- 09/22: leave a \"cat\" that concatenates two files as input to \"git am\"\n\n- 14/22: replace all instances of\n\n      cat >expect.unsorted <<... && sort expect.unsorted >expect\n\n  with\n\n      \"sort >expect <<...\"\n\n- 19/22: avoid \"sed -E\" (use extended regex syntax) which may not be\n  supported on each platform with equivalent basic regexes\n\nBeat Bolli (22):\n  doc: avoid redundant use of cat\n  contrib/subtree/t: avoid redundant use of cat\n  t/lib-cvs.sh: avoid redundant use of cat\n  t/annotate-tests.sh: avoid redundant use of cat\n  t/perf: avoid redundant use of cat\n  t/t0*: avoid redundant uses of cat\n  t/t1*: avoid redundant uses of cat\n  t/t3*: avoid redundant uses of cat\n  t/t4*: avoid redundant uses of cat\n  t/t5*: avoid redundant uses of cat\n  t/t6*: avoid redundant uses of cat\n  t/t7*: avoid redundant use of cat\n  t/t8*: avoid redundant use of cat\n  t/t9*: avoid redundant uses of cat\n  t/t1*: merge a \"grep | sed\" pipeline\n  t/t3*: merge a \"grep | awk\" pipeline\n  t/t4*: merge a \"grep | sed\" pipeline\n  t/t5*: merge a \"grep | sed\" pipeline\n  t/t8*: merge \"grep | sed\" pipelines\n  t/t9*: merge \"grep | sed\" pipelines\n  contrib/coverage-diff: avoid redundant pipelines\n  git-quiltimport: avoid an unnecessary subshell\n\n Documentation/howto/update-hook-example.txt |  4 +--\n contrib/coverage-diff.sh                    |  9 ++----\n contrib/subtree/t/t7900-subtree.sh          |  2 +-\n git-quiltimport.sh                          |  2 +-\n t/annotate-tests.sh                         |  2 +-\n t/lib-cvs.sh                                |  4 +--\n t/perf/repos/inflate-repo.sh                |  2 +-\n t/t0002-gitfile.sh                          |  2 +-\n t/t0011-hashmap.sh                          |  2 +-\n t/t0028-working-tree-encoding.sh            |  4 +--\n t/t0204-gettext-reencode-sanity.sh          |  2 +-\n t/t1007-hash-object.sh                      |  6 ++--\n t/t1091-sparse-checkout-builtin.sh          |  2 +-\n t/t1509/prepare-chroot.sh                   |  2 +-\n t/t3200-branch.sh                           |  2 +-\n t/t3321-notes-stripspace.sh                 |  8 ++---\n t/t3920-crlf-messages.sh                    |  4 +--\n t/t4002-diff-basic.sh                       |  2 +-\n t/t4020-diff-external.sh                    |  2 +-\n t/t4205-log-pretty-formats.sh               |  2 +-\n t/t4301-merge-tree-write-tree.sh            |  8 ++---\n t/t5100-mailinfo.sh                         |  2 +-\n t/t5317-pack-objects-filter-objects.sh      |  2 +-\n t/t5401-update-hooks.sh                     |  2 +-\n t/t5534-push-signed.sh                      |  2 +-\n t/t6112-rev-list-filters-objects.sh         |  2 +-\n t/t6413-merge-crlf.sh                       |  4 +--\n t/t7704-repack-cruft.sh                     |  2 +-\n t/t8010-cat-file-filters.sh                 |  2 +-\n t/t8013-blame-ignore-revs.sh                | 28 ++++++++---------\n t/t9118-git-svn-funky-branch-names.sh       |  2 +-\n t/t9300-fast-import.sh                      | 14 +++------\n t/t9350-fast-export.sh                      |  4 +--\n t/t9400-git-cvsserver-server.sh             | 35 ++++++++++-----------\n t/t9802-git-p4-filetype.sh                  |  2 +-\n t/t9807-git-p4-submit.sh                    |  2 +-\n t/t9824-git-p4-git-lfs.sh                   |  4 +--\n 37 files changed, 85 insertions(+), 97 deletions(-)\n\nRange-diff from v1:\n\n 1:  270f19b35e36 =  1:  270f19b35e36 doc: avoid redundant use of cat\n 2:  eed1fc58a7e4 =  2:  eed1fc58a7e4 contrib/subtree/t: avoid redundant use of cat\n 3:  c131707668ac =  3:  c131707668ac t/lib-cvs.sh: avoid redundant use of cat\n 4:  da69f859de63 =  4:  da69f859de63 t/annotate-tests.sh: avoid redundant use of cat\n 5:  07b3bf33577f =  5:  07b3bf33577f t/perf: avoid redundant use of cat\n 6:  38907650b33e =  6:  38907650b33e t/t0*: avoid redundant uses of cat\n 7:  b8b8b7ae47a6 =  7:  b8b8b7ae47a6 t/t1*: avoid redundant uses of cat\n 8:  7c91c4092e7d =  8:  7c91c4092e7d t/t3*: avoid redundant uses of cat\n 9:  3c9df39774d8 !  9:  1a80eaa97169 t/t4*: avoid redundant uses of cat\n    @@ t/t4020-diff-external.sh: keep_only_cr () {\n      \n      test_expect_success 'diff --cached' '\n     \n    - ## t/t4150-am.sh ##\n    -@@ t/t4150-am.sh: test_expect_success 'am takes patches from a Pine mailbox' '\n    - \trm -fr .git/rebase-apply &&\n    - \tgit reset --hard &&\n    - \tgit checkout first &&\n    --\tcat pine patch1 | git am &&\n    -+\tgit am pine patch1 &&\n    - \ttest_path_is_missing .git/rebase-apply &&\n    - \tgit diff --exit-code main^..HEAD\n    - '\n    -\n      ## t/t4205-log-pretty-formats.sh ##\n     @@ t/t4205-log-pretty-formats.sh: test_expect_success 'NUL termination with --reflog --pretty=oneline' '\n      \tfor r in $revs\n10:  a3207b26a80e = 10:  3ac01bbcaafa t/t5*: avoid redundant uses of cat\n11:  bde50bfd2552 = 11:  a4a6aaf4654b t/t6*: avoid redundant uses of cat\n12:  84978c31631f = 12:  4b7b9df129a3 t/t7*: avoid redundant use of cat\n13:  a555a1809e84 = 13:  ebf1e5eeadbd t/t8*: avoid redundant use of cat\n14:  667c04d6c665 ! 14:  34cf66aeff80 t/t9*: avoid redundant uses of cat\n    @@ t/t9300-fast-import.sh: test_expect_success 'L: nested tree copy does not corrup\n      \ttest_cmp expect actual &&\n      \tgit fsck $(git rev-parse L2)\n      '\n    -@@ t/t9300-fast-import.sh: test_expect_success 'Q: verify first notes tree' '\n    +@@ t/t9300-fast-import.sh: test_expect_success 'Q: verify first notes commit' '\n    + '\n    + \n    + test_expect_success 'Q: verify first notes tree' '\n    +-\tcat >expect.unsorted <<-EOF &&\n    ++\tsort >expect <<-EOF &&\n    + \t100644 blob $commit1\n      \t100644 blob $commit2\n      \t100644 blob $commit3\n      \tEOF\n     -\tcat expect.unsorted | sort >expect &&\n    -+\tsort expect.unsorted >expect &&\n      \tgit cat-file -p refs/notes/foobar~2^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n      \ttest_cmp expect actual\n      '\n    -@@ t/t9300-fast-import.sh: test_expect_success 'Q: verify second notes tree' '\n    +@@ t/t9300-fast-import.sh: test_expect_success 'Q: verify second notes commit' '\n    + '\n    + \n    + test_expect_success 'Q: verify second notes tree' '\n    +-\tcat >expect.unsorted <<-EOF &&\n    ++\tsort >expect <<-EOF &&\n    + \t100644 blob $commit1\n      \t100644 blob $commit2\n      \t100644 blob $commit3\n      \tEOF\n     -\tcat expect.unsorted | sort >expect &&\n    -+\tsort expect.unsorted >expect &&\n      \tgit cat-file -p refs/notes/foobar^^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n      \ttest_cmp expect actual\n      '\n    -@@ t/t9300-fast-import.sh: test_expect_success 'Q: verify third notes tree' '\n    - \tcat >expect.unsorted <<-EOF &&\n    +@@ t/t9300-fast-import.sh: test_expect_success 'Q: verify third notes commit' '\n    + '\n    + \n    + test_expect_success 'Q: verify third notes tree' '\n    +-\tcat >expect.unsorted <<-EOF &&\n    ++\tsort >expect <<-EOF &&\n      \t100644 blob $commit1\n      \tEOF\n     -\tcat expect.unsorted | sort >expect &&\n    -+\tsort expect.unsorted >expect &&\n      \tgit cat-file -p refs/notes/foobar2^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n      \ttest_cmp expect actual\n      '\n    -@@ t/t9300-fast-import.sh: test_expect_success 'Q: verify fourth notes tree' '\n    - \tcat >expect.unsorted <<-EOF &&\n    +@@ t/t9300-fast-import.sh: test_expect_success 'Q: verify fourth notes commit' '\n    + '\n    + \n    + test_expect_success 'Q: verify fourth notes tree' '\n    +-\tcat >expect.unsorted <<-EOF &&\n    ++\tsort >expect <<-EOF &&\n      \t100644 blob $commit2\n      \tEOF\n     -\tcat expect.unsorted | sort >expect &&\n    -+\tsort expect.unsorted >expect &&\n      \tgit cat-file -p refs/notes/foobar^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n      \ttest_cmp expect actual\n      '\n15:  6dd79d30c42a = 15:  be300cb0a65a t/t1*: merge a \"grep | sed\" pipeline\n16:  db61133fa92f = 16:  d6f5e21942ff t/t3*: merge a \"grep | awk\" pipeline\n17:  5ce7ddeb2fbd = 17:  68a5f3f743d0 t/t4*: merge a \"grep | sed\" pipeline\n18:  6ed68fe96493 = 18:  3a7e2a8fc388 t/t5*: merge a \"grep | sed\" pipeline\n19:  698a5524b5c4 ! 19:  e6ec4b3a0451 t/t8*: merge \"grep | sed\" pipelines\n    @@ t/t8013-blame-ignore-revs.sh: test_expect_success setup '\n      \tgit blame --line-porcelain file >blame_raw &&\n      \n     -\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n    -+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 1/s/ .*//p\" blame_raw >actual &&\n    ++\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p\" blame_raw >actual &&\n      \tgit rev-parse X >expect &&\n      \ttest_cmp expect actual &&\n      \n     -\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n    -+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 2/s/ .*//p\" blame_raw >actual &&\n    ++\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p\" blame_raw >actual &&\n      \tgit rev-parse X >expect &&\n      \ttest_cmp expect actual\n      '\n    @@ t/t8013-blame-ignore-revs.sh: do\n      \t\tgit blame --line-porcelain --ignore-rev $I file >blame_raw &&\n      \n     -\t\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n    -+\t\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 1/s/ .*//p\" blame_raw >actual &&\n    ++\t\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p\" blame_raw >actual &&\n      \t\tgit rev-parse A >expect &&\n      \t\ttest_cmp expect actual &&\n      \n     -\t\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n    -+\t\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 2/s/ .*//p\" blame_raw >actual &&\n    ++\t\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p\" blame_raw >actual &&\n      \t\tgit rev-parse B >expect &&\n      \t\ttest_cmp expect actual\n      \t'\n    @@ t/t8013-blame-ignore-revs.sh: test_expect_success ignore_rev_adding_unblamable_l\n      \tgit blame --line-porcelain file --ignore-rev Y >blame_raw &&\n      \n     -\tgrep -E \"^[0-9a-f]+ [0-9]+ 3\" blame_raw | sed -e \"s/ .*//\" >actual &&\n    -+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 3/s/ .*//p\" blame_raw >actual &&\n    ++\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 3/s/ .*//p\" blame_raw >actual &&\n      \ttest_cmp expect actual &&\n      \n     -\tgrep -E \"^[0-9a-f]+ [0-9]+ 4\" blame_raw | sed -e \"s/ .*//\" >actual &&\n    -+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 4/s/ .*//p\" blame_raw >actual &&\n    ++\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 4/s/ .*//p\" blame_raw >actual &&\n      \ttest_cmp expect actual\n      '\n      \n    @@ t/t8013-blame-ignore-revs.sh: test_expect_success ignore_revs_from_files '\n      \tgit blame --line-porcelain file --ignore-revs-file ignore_x --ignore-revs-file ignore_y >blame_raw &&\n      \n     -\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n    -+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 1/s/ .*//p\" blame_raw >actual &&\n    ++\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p\" blame_raw >actual &&\n      \tgit rev-parse A >expect &&\n      \ttest_cmp expect actual &&\n      \n     -\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n    -+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 2/s/ .*//p\" blame_raw >actual &&\n    ++\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p\" blame_raw >actual &&\n      \tgit rev-parse B >expect &&\n      \ttest_cmp expect actual\n      '\n    @@ t/t8013-blame-ignore-revs.sh: test_expect_success ignore_revs_from_configs_and_f\n      \tgit blame --line-porcelain file --ignore-revs-file ignore_y >blame_raw &&\n      \n     -\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n    -+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 1/s/ .*//p\" blame_raw >actual &&\n    ++\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p\" blame_raw >actual &&\n      \tgit rev-parse A >expect &&\n      \ttest_cmp expect actual &&\n      \n     -\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n    -+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 2/s/ .*//p\" blame_raw >actual &&\n    ++\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p\" blame_raw >actual &&\n      \tgit rev-parse B >expect &&\n      \ttest_cmp expect actual\n      '\n    @@ t/t8013-blame-ignore-revs.sh: test_expect_success override_ignore_revs_file '\n      \tgit rev-parse X >expect &&\n      \n     -\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n    -+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 1/s/ .*//p\" blame_raw >actual &&\n    ++\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p\" blame_raw >actual &&\n      \ttest_cmp expect actual &&\n      \n     -\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n    -+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 2/s/ .*//p\" blame_raw >actual &&\n    ++\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p\" blame_raw >actual &&\n      \ttest_cmp expect actual\n      \t'\n      test_expect_success bad_files_and_revs '\n    @@ t/t8013-blame-ignore-revs.sh: test_expect_success ignore_merge '\n      \tgit blame --line-porcelain file --ignore-rev M >blame_raw &&\n      \n     -\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n    -+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 1/s/ .*//p\" blame_raw >actual &&\n    ++\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p\" blame_raw >actual &&\n      \tgit rev-parse B >expect &&\n      \ttest_cmp expect actual &&\n      \n     -\tgrep -E \"^[0-9a-f]+ [0-9]+ 9\" blame_raw | sed -e \"s/ .*//\" >actual &&\n    -+\tsed -Ene \"/^[0-9a-f]+ [0-9]+ 9/s/ .*//p\" blame_raw >actual &&\n    ++\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 9/s/ .*//p\" blame_raw >actual &&\n      \tgit rev-parse C >expect &&\n      \ttest_cmp expect actual\n      '\n20:  6b3345667040 = 20:  4772acb80163 t/t9*: merge \"grep | sed\" pipelines\n21:  1784d5f3fdc1 = 21:  a34653f91589 contrib/coverage-diff: avoid redundant pipelines\n22:  4858de8ce44f = 22:  6c62dee0daa1 git-quiltimport: avoid an unnecessary subshell\n-- \n2.44.0\n\nFrom: Beat Bolli <dev+git@drbeat.li>\n\n*** BLURB HERE ***\n\nBeat Bolli (22):\n  doc: avoid redundant use of cat\n  contrib/subtree/t: avoid redundant use of cat\n  t/lib-cvs.sh: avoid redundant use of cat\n  t/annotate-tests.sh: avoid redundant use of cat\n  t/perf: avoid redundant use of cat\n  t/t0*: avoid redundant uses of cat\n  t/t1*: avoid redundant uses of cat\n  t/t3*: avoid redundant uses of cat\n  t/t4*: avoid redundant uses of cat\n  t/t5*: avoid redundant uses of cat\n  t/t6*: avoid redundant uses of cat\n  t/t7*: avoid redundant use of cat\n  t/t8*: avoid redundant use of cat\n  t/t9*: avoid redundant uses of cat\n  t/t1*: merge a \"grep | sed\" pipeline\n  t/t3*: merge a \"grep | awk\" pipeline\n  t/t4*: merge a \"grep | sed\" pipeline\n  t/t5*: merge a \"grep | sed\" pipeline\n  t/t8*: merge \"grep | sed\" pipelines\n  t/t9*: merge \"grep | sed\" pipelines\n  contrib/coverage-diff: avoid redundant pipelines\n  git-quiltimport: avoid an unnecessary subshell\n\n Documentation/howto/update-hook-example.txt |  4 +--\n contrib/coverage-diff.sh                    |  9 ++----\n contrib/subtree/t/t7900-subtree.sh          |  2 +-\n git-quiltimport.sh                          |  2 +-\n t/annotate-tests.sh                         |  2 +-\n t/lib-cvs.sh                                |  4 +--\n t/perf/repos/inflate-repo.sh                |  2 +-\n t/t0002-gitfile.sh                          |  2 +-\n t/t0011-hashmap.sh                          |  2 +-\n t/t0028-working-tree-encoding.sh            |  4 +--\n t/t0204-gettext-reencode-sanity.sh          |  2 +-\n t/t1007-hash-object.sh                      |  6 ++--\n t/t1091-sparse-checkout-builtin.sh          |  2 +-\n t/t1509/prepare-chroot.sh                   |  2 +-\n t/t3200-branch.sh                           |  2 +-\n t/t3321-notes-stripspace.sh                 |  8 ++---\n t/t3920-crlf-messages.sh                    |  4 +--\n t/t4002-diff-basic.sh                       |  2 +-\n t/t4020-diff-external.sh                    |  2 +-\n t/t4205-log-pretty-formats.sh               |  2 +-\n t/t4301-merge-tree-write-tree.sh            |  8 ++---\n t/t5100-mailinfo.sh                         |  2 +-\n t/t5317-pack-objects-filter-objects.sh      |  2 +-\n t/t5401-update-hooks.sh                     |  2 +-\n t/t5534-push-signed.sh                      |  2 +-\n t/t6112-rev-list-filters-objects.sh         |  2 +-\n t/t6413-merge-crlf.sh                       |  4 +--\n t/t7704-repack-cruft.sh                     |  2 +-\n t/t8010-cat-file-filters.sh                 |  2 +-\n t/t8013-blame-ignore-revs.sh                | 28 ++++++++---------\n t/t9118-git-svn-funky-branch-names.sh       |  2 +-\n t/t9300-fast-import.sh                      | 14 +++------\n t/t9350-fast-export.sh                      |  4 +--\n t/t9400-git-cvsserver-server.sh             | 35 ++++++++++-----------\n t/t9802-git-p4-filetype.sh                  |  2 +-\n t/t9807-git-p4-submit.sh                    |  2 +-\n t/t9824-git-p4-git-lfs.sh                   |  4 +--\n 37 files changed, 85 insertions(+), 97 deletions(-)\n\n-- \n2.44.0\n\n"},{"id":"490709","messageId":"20240315194620.10713-2-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 01/22] doc: avoid redundant use of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:45:58Z","receivedAt":"2024-03-15T19:46:41Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"The update-hook-example.txt script uses this anti-pattern twice. Call grep\nwith the input file name directy. While at it, merge the two consecutive\ngrep calls.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n Documentation/howto/update-hook-example.txt | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/howto/update-hook-example.txt b/Documentation/howto/update-hook-example.txt\nindex 151ee84cebce..4e727deedd21 100644\n--- a/Documentation/howto/update-hook-example.txt\n+++ b/Documentation/howto/update-hook-example.txt\n@@ -100,7 +100,7 @@ info \"The user is: '$username'\"\n \n if test -f \"$allowed_users_file\"\n then\n-  rc=$(cat $allowed_users_file | grep -v '^#' | grep -v '^$' |\n+  rc=$(grep -Ev '^(#|$)' $allowed_users_file |\n     while read heads user_patterns\n     do\n       # does this rule apply to us?\n@@ -138,7 +138,7 @@ info \"'$groups'\"\n \n if test -f \"$allowed_groups_file\"\n then\n-  rc=$(cat $allowed_groups_file | grep -v '^#' | grep -v '^$' |\n+  rc=$(grep -Ev '^(#|$)' $allowed_groups_file |\n     while read heads group_patterns\n     do\n       # does this rule apply to us?\n-- \n2.44.0\n\n"},{"id":"490710","messageId":"20240315194620.10713-8-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 07/22] t/t1*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:04Z","receivedAt":"2024-03-15T19:46:41Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t1007-hash-object.sh             | 6 +++---\n t/t1091-sparse-checkout-builtin.sh | 2 +-\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh\nindex ac3d173767ae..64aea3848606 100755\n--- a/t/t1007-hash-object.sh\n+++ b/t/t1007-hash-object.sh\n@@ -124,8 +124,8 @@ test_expect_success 'check that appropriate filter is invoke when --path is used\n \tpath0_sha=$(git hash-object --path=file0 file1) &&\n \ttest \"$file0_sha\" = \"$path0_sha\" &&\n \ttest \"$file1_sha\" = \"$path1_sha\" &&\n-\tpath1_sha=$(cat file0 | git hash-object --path=file1 --stdin) &&\n-\tpath0_sha=$(cat file1 | git hash-object --path=file0 --stdin) &&\n+\tpath1_sha=$(git hash-object --path=file1 --stdin <file0) &&\n+\tpath0_sha=$(git hash-object --path=file0 --stdin <file1) &&\n \ttest \"$file0_sha\" = \"$path0_sha\" &&\n \ttest \"$file1_sha\" = \"$path1_sha\"\n '\n@@ -154,7 +154,7 @@ test_expect_success '--path works in a subdirectory' '\n test_expect_success 'check that --no-filters option works' '\n \tnofilters_file1=$(git hash-object --no-filters file1) &&\n \ttest \"$file0_sha\" = \"$nofilters_file1\" &&\n-\tnofilters_file1=$(cat file1 | git hash-object --stdin) &&\n+\tnofilters_file1=$(git hash-object --stdin <file1) &&\n \ttest \"$file0_sha\" = \"$nofilters_file1\"\n '\n \ndiff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh\nindex e49b8024ac53..ab3a105ffff2 100755\n--- a/t/t1091-sparse-checkout-builtin.sh\n+++ b/t/t1091-sparse-checkout-builtin.sh\n@@ -968,7 +968,7 @@ test_expect_success 'check-rules non-cone mode' '\n \tgit -C bare sparse-checkout check-rules --no-cone --rules-file ../rules\\\n \t\t>check-rules-file <all-files &&\n \n-\tcat rules | git -C repo sparse-checkout set --no-cone --stdin &&\n+\tgit -C repo sparse-checkout set --no-cone --stdin <rules &&\n \tgit -C repo ls-files -t >out &&\n \tsed -n \"/^S /!s/^. //p\" out >ls-files &&\n \n-- \n2.44.0\n\n"},{"id":"490713","messageId":"20240315194620.10713-7-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 06/22] t/t0*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:03Z","receivedAt":"2024-03-15T19:46:41Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t0002-gitfile.sh                 | 2 +-\n t/t0011-hashmap.sh                 | 2 +-\n t/t0028-working-tree-encoding.sh   | 4 ++--\n t/t0204-gettext-reencode-sanity.sh | 2 +-\n 4 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh\nindex 736516cc6a47..bf3bf604abe3 100755\n--- a/t/t0002-gitfile.sh\n+++ b/t/t0002-gitfile.sh\n@@ -40,7 +40,7 @@ test_expect_success 'final setup + check rev-parse --git-dir' '\n \n test_expect_success 'check hash-object' '\n \techo \"foo\" >bar &&\n-\tSHA=$(cat bar | git hash-object -w --stdin) &&\n+\tSHA=$(git hash-object -w --stdin <bar) &&\n \ttest_path_is_file \"$REAL/objects/$(objpath $SHA)\"\n '\n \ndiff --git a/t/t0011-hashmap.sh b/t/t0011-hashmap.sh\nindex 1cb6aa682432..46e74ad1072b 100755\n--- a/t/t0011-hashmap.sh\n+++ b/t/t0011-hashmap.sh\n@@ -239,7 +239,7 @@ test_expect_success 'grow / shrink' '\n \techo value40 >> expect &&\n \techo size >> in &&\n \techo 64 39 >> expect &&\n-\tcat in | test-tool hashmap > out &&\n+\ttest-tool hashmap <in >out &&\n \ttest_cmp expect out\n \n '\ndiff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh\nindex 1b55f59c237c..ad151a346708 100755\n--- a/t/t0028-working-tree-encoding.sh\n+++ b/t/t0028-working-tree-encoding.sh\n@@ -131,8 +131,8 @@ do\n \t\ttest_when_finished \"rm -f crlf.utf${i}.raw lf.utf${i}.raw\" &&\n \t\ttest_when_finished \"git reset --hard HEAD^\" &&\n \n-\t\tcat lf.utf8.raw | write_utf${i} >lf.utf${i}.raw &&\n-\t\tcat crlf.utf8.raw | write_utf${i} >crlf.utf${i}.raw &&\n+\t\twrite_utf${i} <lf.utf8.raw >lf.utf${i}.raw &&\n+\t\twrite_utf${i} <crlf.utf8.raw >crlf.utf${i}.raw &&\n \t\tcp crlf.utf${i}.raw eol.utf${i} &&\n \n \t\tcat >expectIndexLF <<-EOF &&\ndiff --git a/t/t0204-gettext-reencode-sanity.sh b/t/t0204-gettext-reencode-sanity.sh\nindex 4f2e0dcb02bd..310a4500125f 100755\n--- a/t/t0204-gettext-reencode-sanity.sh\n+++ b/t/t0204-gettext-reencode-sanity.sh\n@@ -82,7 +82,7 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext.c: git init UTF-8 -> ISO-8859-1'\n     printf \"Bjó til tóma Git lind\" >expect &&\n     LANGUAGE=is LC_ALL=\"$is_IS_iso_locale\" git init repo >actual &&\n     test_when_finished \"rm -rf repo\" &&\n-    grep \"^$(cat expect | iconv -f UTF-8 -t ISO8859-1) \" actual\n+    grep \"^$(iconv -f UTF-8 -t ISO8859-1 <expect) \" actual\n '\n \n test_done\n-- \n2.44.0\n\n"},{"id":"490712","messageId":"20240315194620.10713-3-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 02/22] contrib/subtree/t: avoid redundant use of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:45:59Z","receivedAt":"2024-03-15T19:46:42Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n contrib/subtree/t/t7900-subtree.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh\nindex ca4df5be8324..c3bd2a58b941 100755\n--- a/contrib/subtree/t/t7900-subtree.sh\n+++ b/contrib/subtree/t/t7900-subtree.sh\n@@ -63,7 +63,7 @@ test_create_pre2_32_repo () {\n \tgit -C \"$1\" log -1 --format=%B HEAD^2 >msg &&\n \ttest_commit -C \"$1-sub\" --annotate sub2 &&\n \tgit clone --no-local \"$1\" \"$1-clone\" &&\n-\tnew_commit=$(cat msg | sed -e \"s/$commit/$tag/\" | git -C \"$1-clone\" commit-tree HEAD^2^{tree}) &&\n+\tnew_commit=$(sed -e \"s/$commit/$tag/\" msg | git -C \"$1-clone\" commit-tree HEAD^2^{tree}) &&\n \tgit -C \"$1-clone\" replace HEAD^2 $new_commit\n }\n \n-- \n2.44.0\n\n"},{"id":"490714","messageId":"20240315194620.10713-9-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 08/22] t/t3*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:05Z","receivedAt":"2024-03-15T19:46:42Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t3200-branch.sh           | 2 +-\n t/t3321-notes-stripspace.sh | 8 ++++----\n t/t3920-crlf-messages.sh    | 2 +-\n 3 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex e36f4d15f2dd..c394273527cb 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -579,7 +579,7 @@ EOF\n \n \t# ...and that the comments for those sections are also\n \t# preserved.\n-\tcat config.branch | sed \"s/\\\"source\\\"/\\\"dest\\\"/\" >expect &&\n+\tsed \"s/\\\"source\\\"/\\\"dest\\\"/\" config.branch >expect &&\n \tsed -n -e \"/Note the lack/,\\$p\" .git/config >actual &&\n \ttest_cmp expect actual\n '\ndiff --git a/t/t3321-notes-stripspace.sh b/t/t3321-notes-stripspace.sh\nindex 088a852dd47a..beca34605672 100755\n--- a/t/t3321-notes-stripspace.sh\n+++ b/t/t3321-notes-stripspace.sh\n@@ -442,7 +442,7 @@ test_expect_success 'add note by specifying \"-C\", \"--no-stripspace\" is the defau\n \t${LF}\n \tEOF\n \n-\tcat expect | git hash-object -w --stdin >blob &&\n+\tgit hash-object -w --stdin <expect >blob &&\n \tgit notes add -C $(cat blob) &&\n \tgit notes show >actual &&\n \ttest_cmp expect actual &&\n@@ -468,7 +468,7 @@ test_expect_success 'reuse note by specifying \"-C\" and \"--stripspace\"' '\n \tsecond-line\n \tEOF\n \n-\tcat data | git hash-object -w --stdin >blob &&\n+\tgit hash-object -w --stdin <data >blob &&\n \tgit notes add --stripspace -C $(cat blob) &&\n \tgit notes show >actual &&\n \ttest_cmp expect actual\n@@ -492,7 +492,7 @@ test_expect_success 'reuse with \"-C\" and add note with \"-m\", \"-m\" will stripspac\n \tthird-line\n \tEOF\n \n-\tcat data | git hash-object -w --stdin >blob &&\n+\tgit hash-object -w --stdin <data >blob &&\n \tgit notes add -C $(cat blob) -m \"third-line\" &&\n \tgit notes show >actual &&\n \ttest_cmp expect actual\n@@ -511,7 +511,7 @@ test_expect_success 'add note with \"-m\" and reuse note with \"-C\", \"-C\" will not\n \tsecond-line\n \tEOF\n \n-\tcat data | git hash-object -w --stdin >blob &&\n+\tgit hash-object -w --stdin <data >blob &&\n \tgit notes add -m \"first-line\" -C $(cat blob)  &&\n \tgit notes show >actual &&\n \ttest_cmp expect actual\ndiff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh\nindex 67fd2345affd..5eed640a6825 100755\n--- a/t/t3920-crlf-messages.sh\n+++ b/t/t3920-crlf-messages.sh\n@@ -10,7 +10,7 @@ LIB_CRLF_BRANCHES=\"\"\n create_crlf_ref () {\n \tbranch=\"$1\" &&\n \tcat >.crlf-orig-$branch.txt &&\n-\tcat .crlf-orig-$branch.txt | append_cr >.crlf-message-$branch.txt &&\n+\tappend_cr <.crlf-orig-$branch.txt >.crlf-message-$branch.txt &&\n \tgrep 'Subject' .crlf-orig-$branch.txt | tr '\\n' ' ' | sed 's/[ ]*$//' | tr -d '\\n' >.crlf-subject-$branch.txt &&\n \tgrep 'Body' .crlf-orig-$branch.txt | append_cr >.crlf-body-$branch.txt &&\n \tLIB_CRLF_BRANCHES=\"${LIB_CRLF_BRANCHES} ${branch}\" &&\n-- \n2.44.0\n\n"},{"id":"490715","messageId":"20240315194620.10713-4-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 03/22] t/lib-cvs.sh: avoid redundant use of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:00Z","receivedAt":"2024-03-15T19:46:43Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/lib-cvs.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/lib-cvs.sh b/t/lib-cvs.sh\nindex 32b347337908..57b9b2db9b3f 100644\n--- a/t/lib-cvs.sh\n+++ b/t/lib-cvs.sh\n@@ -71,8 +71,8 @@ test_cmp_branch_tree () {\n \t\tfind . -type d -name .git -prune -o -type f -print\n \t) | sort >module-git-\"$1\".list &&\n \ttest_cmp module-cvs-\"$1\".list module-git-\"$1\".list &&\n-\tcat module-cvs-\"$1\".list | while read f\n+\twhile read f\n \tdo\n \t\ttest_cmp_branch_file \"$1\" \"$f\" || return 1\n-\tdone\n+\tdone <module-cvs-\"$1\".list\n }\n-- \n2.44.0\n\n"},{"id":"490719","messageId":"20240315194620.10713-10-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 09/22] t/t4*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:06Z","receivedAt":"2024-03-15T19:46:43Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t4020-diff-external.sh         | 2 +-\n t/t4205-log-pretty-formats.sh    | 2 +-\n t/t4301-merge-tree-write-tree.sh | 8 ++++----\n 3 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh\nindex c1ac09ecc714..fdd865f7c38d 100755\n--- a/t/t4020-diff-external.sh\n+++ b/t/t4020-diff-external.sh\n@@ -232,7 +232,7 @@ keep_only_cr () {\n test_expect_success 'external diff with autocrlf = true' '\n \ttest_config core.autocrlf true &&\n \tGIT_EXTERNAL_DIFF=./fake-diff.sh git diff &&\n-\ttest $(wc -l < crlfed.txt) = $(cat crlfed.txt | keep_only_cr | wc -c)\n+\ttest $(wc -l <crlfed.txt) = $(keep_only_cr <crlfed.txt | wc -c)\n '\n \n test_expect_success 'diff --cached' '\ndiff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh\nindex e3d655e6b8b5..1409eebcd855 100755\n--- a/t/t4205-log-pretty-formats.sh\n+++ b/t/t4205-log-pretty-formats.sh\n@@ -156,7 +156,7 @@ test_expect_success 'NUL termination with --reflog --pretty=oneline' '\n \tfor r in $revs\n \tdo\n \t\tgit show -s --pretty=oneline \"$r\" >raw &&\n-\t\tcat raw | lf_to_nul || return 1\n+\t\tlf_to_nul <raw || return 1\n \tdone >expect &&\n \t# the trailing NUL is already produced so we do not need to\n \t# output another one\ndiff --git a/t/t4301-merge-tree-write-tree.sh b/t/t4301-merge-tree-write-tree.sh\nindex 12ac43687366..578641467753 100755\n--- a/t/t4301-merge-tree-write-tree.sh\n+++ b/t/t4301-merge-tree-write-tree.sh\n@@ -313,7 +313,7 @@ test_expect_success 'rename/add handling' '\n \t\t# First, check that the bar that appears at stage 3 does not\n \t\t# correspond to an individual blob anywhere in history\n \t\t#\n-\t\thash=$(cat out | tr \"\\0\" \"\\n\" | head -n 3 | grep 3.bar | cut -f 2 -d \" \") &&\n+\t\thash=$(tr \"\\0\" \"\\n\" <out | head -n 3 | grep 3.bar | cut -f 2 -d \" \") &&\n \t\tgit rev-list --objects --all >all_blobs &&\n \t\t! grep $hash all_blobs &&\n \n@@ -380,7 +380,7 @@ test_expect_success SYMLINKS 'rename/add, where add is a mode conflict' '\n \t\t# First, check that the bar that appears at stage 3 does not\n \t\t# correspond to an individual blob anywhere in history\n \t\t#\n-\t\thash=$(cat out | tr \"\\0\" \"\\n\" | head -n 3 | grep 3.bar | cut -f 2 -d \" \") &&\n+\t\thash=$(tr \"\\0\" \"\\n\" <out | head -n 3 | grep 3.bar | cut -f 2 -d \" \") &&\n \t\tgit rev-list --objects --all >all_blobs &&\n \t\t! grep $hash all_blobs &&\n \n@@ -630,8 +630,8 @@ test_expect_success 'mod6: chains of rename/rename(1to2) and add/add via collidi\n \t\t# conflict entries do not appear as individual blobs anywhere\n \t\t# in history.\n \t\t#\n-\t\thash1=$(cat out | tr \"\\0\" \"\\n\" | head | grep 2.four | cut -f 2 -d \" \") &&\n-\t\thash2=$(cat out | tr \"\\0\" \"\\n\" | head | grep 3.two | cut -f 2 -d \" \") &&\n+\t\thash1=$(tr \"\\0\" \"\\n\" <out | head | grep 2.four | cut -f 2 -d \" \") &&\n+\t\thash2=$(tr \"\\0\" \"\\n\" <out | head | grep 3.two | cut -f 2 -d \" \") &&\n \t\tgit rev-list --objects --all >all_blobs &&\n \t\t! grep $hash1 all_blobs &&\n \t\t! grep $hash2 all_blobs &&\n-- \n2.44.0\n\n"},{"id":"490716","messageId":"20240315194620.10713-5-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 04/22] t/annotate-tests.sh: avoid redundant use of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:01Z","receivedAt":"2024-03-15T19:46:44Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/annotate-tests.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/annotate-tests.sh b/t/annotate-tests.sh\nindex 5e21e84f3884..87572459e4b8 100644\n--- a/t/annotate-tests.sh\n+++ b/t/annotate-tests.sh\n@@ -532,7 +532,7 @@ test_expect_success 'blame -L :funcname with userdiff driver' '\n \t\t\"$(cat file.template)\" &&\n \ttest_commit --author \"B <B@test.git>\" \\\n \t\t\"change\" \"$fortran_file\" \\\n-\t\t\"$(cat file.template | sed -e s/ChangeMe/IWasChanged/)\" &&\n+\t\t\"$(sed -e s/ChangeMe/IWasChanged/ file.template)\" &&\n \tcheck_count -f \"$fortran_file\" -L:RIGHT A 3 B 1\n '\n \n-- \n2.44.0\n\n"},{"id":"490717","messageId":"20240315194620.10713-11-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 10/22] t/t5*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:07Z","receivedAt":"2024-03-15T19:46:45Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t5100-mailinfo.sh                    | 2 +-\n t/t5317-pack-objects-filter-objects.sh | 2 +-\n t/t5534-push-signed.sh                 | 2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh\nindex 654d8cf3ee00..c8d06554541c 100755\n--- a/t/t5100-mailinfo.sh\n+++ b/t/t5100-mailinfo.sh\n@@ -70,7 +70,7 @@ test_expect_success 'respect NULs' '\n \n \tgit mailsplit -d3 -o. \"$DATA/nul-plain\" &&\n \ttest_cmp \"$DATA/nul-plain\" 001 &&\n-\t(cat 001 | git mailinfo msg patch) &&\n+\tgit mailinfo msg patch <001 &&\n \ttest_line_count = 4 patch\n \n '\ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex 2ff3eef9a3b8..79552d6ef7f6 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -455,7 +455,7 @@ test_expect_success 'setup r1 - delete loose blobs' '\n \ttest_parse_ls_files_stage_oids <ls_files_result |\n \tsort >expected &&\n \n-\tfor id in `cat expected | sed \"s|..|&/|\"`\n+\tfor id in `sed \"s|..|&/|\" expected`\n \tdo\n \t\trm r1/.git/objects/$id || return 1\n \tdone\ndiff --git a/t/t5534-push-signed.sh b/t/t5534-push-signed.sh\nindex b4bc24691c81..c91a62b77afc 100755\n--- a/t/t5534-push-signed.sh\n+++ b/t/t5534-push-signed.sh\n@@ -303,7 +303,7 @@ test_expect_success GPGSM 'fail without key and heed user.signingkey x509' '\n \t\tEOF\n \t\tsed -n -e \"s/^nonce /NONCE=/p\" -e \"/^$/q\" dst/push-cert\n \t) >expect.in &&\n-\tkey=$(cat \"${GNUPGHOME}/trustlist.txt\" | cut -d\" \" -f1 | tr -d \":\") &&\n+\tkey=$(cut -d\" \" -f1 <\"${GNUPGHOME}/trustlist.txt\" | tr -d \":\") &&\n \tsed -e \"s/^KEY=/KEY=${key}/\" expect.in >expect &&\n \n \tnoop=$(git rev-parse noop) &&\n-- \n2.44.0\n\n"},{"id":"490718","messageId":"20240315194620.10713-6-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 05/22] t/perf: avoid redundant use of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:02Z","receivedAt":"2024-03-15T19:46:45Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Take care to redirect stdin, otherwise the output of wc would also contain\nthe file name.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/perf/repos/inflate-repo.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/perf/repos/inflate-repo.sh b/t/perf/repos/inflate-repo.sh\nindex fcfc992b5b02..412e4b450b16 100755\n--- a/t/perf/repos/inflate-repo.sh\n+++ b/t/perf/repos/inflate-repo.sh\n@@ -33,7 +33,7 @@ do\n done\n \n git ls-tree -r HEAD >GEN_src_list\n-nr_src_files=$(cat GEN_src_list | wc -l)\n+nr_src_files=$(wc -l <GEN_src_list)\n \n src_branch=$(git symbolic-ref --short HEAD)\n \n-- \n2.44.0\n\n"},{"id":"490722","messageId":"20240315194620.10713-12-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 11/22] t/t6*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:08Z","receivedAt":"2024-03-15T19:46:46Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t6112-rev-list-filters-objects.sh | 2 +-\n t/t6413-merge-crlf.sh               | 4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex 52822b9461a1..43e1afd44c9b 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -670,7 +670,7 @@ test_expect_success 'rev-list W/ --missing=print' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tfor id in `cat expected | sed \"s|..|&/|\"`\n+\tfor id in `sed \"s|..|&/|\" expected`\n \tdo\n \t\trm r1/.git/objects/$id || return 1\n \tdone &&\ndiff --git a/t/t6413-merge-crlf.sh b/t/t6413-merge-crlf.sh\nindex b4f4a313f486..647ea1e83829 100755\n--- a/t/t6413-merge-crlf.sh\n+++ b/t/t6413-merge-crlf.sh\n@@ -34,14 +34,14 @@ test_expect_success setup '\n test_expect_success 'Check \"ours\" is CRLF' '\n \tgit reset --hard initial &&\n \tgit merge side -s ours &&\n-\tcat file | remove_cr | append_cr >file.temp &&\n+\tremove_cr <file | append_cr >file.temp &&\n \ttest_cmp file file.temp\n '\n \n test_expect_success 'Check that conflict file is CRLF' '\n \tgit reset --hard a &&\n \ttest_must_fail git merge side &&\n-\tcat file | remove_cr | append_cr >file.temp &&\n+\tremove_cr <file | append_cr >file.temp &&\n \ttest_cmp file file.temp\n '\n \n-- \n2.44.0\n\n"},{"id":"490720","messageId":"20240315194620.10713-13-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 12/22] t/t7*: avoid redundant use of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:09Z","receivedAt":"2024-03-15T19:46:47Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t7704-repack-cruft.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7704-repack-cruft.sh b/t/t7704-repack-cruft.sh\nindex be3735dff083..71e1ef3a103e 100755\n--- a/t/t7704-repack-cruft.sh\n+++ b/t/t7704-repack-cruft.sh\n@@ -48,7 +48,7 @@ test_expect_success '--expire-to stores pruned objects (now)' '\n \t\t# ...in other words, the combined contents of this\n \t\t# repository and expired.git should be the same as the\n \t\t# set of objects we started with.\n-\t\tcat expired.objects remaining.objects | sort >actual &&\n+\t\tsort expired.objects remaining.objects >actual &&\n \t\ttest_cmp expect actual &&\n \n \t\t# The \"moved\" objects (i.e., those in expired.git)\n-- \n2.44.0\n\n"},{"id":"490721","messageId":"20240315194620.10713-14-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 13/22] t/t8*: avoid redundant use of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:10Z","receivedAt":"2024-03-15T19:46:48Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t8010-cat-file-filters.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t8010-cat-file-filters.sh b/t/t8010-cat-file-filters.sh\nindex ca04242ca016..eb64b766bdfa 100755\n--- a/t/t8010-cat-file-filters.sh\n+++ b/t/t8010-cat-file-filters.sh\n@@ -43,7 +43,7 @@ test_expect_success 'cat-file --textconv --path=<path> works' '\n \tsha1=$(git rev-parse -q --verify HEAD:world.txt) &&\n \ttest_config diff.txt.textconv \"tr A-Za-z N-ZA-Mn-za-m <\" &&\n \tgit cat-file --textconv --path=hello.txt $sha1 >rot13 &&\n-\ttest uryyb = \"$(cat rot13 | remove_cr)\"\n+\ttest uryyb = \"$(remove_cr <rot13)\"\n '\n \n test_expect_success '--path=<path> complains without --textconv/--filters' '\n-- \n2.44.0\n\n"},{"id":"490723","messageId":"20240315194620.10713-15-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 14/22] t/t9*: avoid redundant uses of cat","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:11Z","receivedAt":"2024-03-15T19:46:49Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t9300-fast-import.sh          | 14 +++++--------\n t/t9350-fast-export.sh          |  2 +-\n t/t9400-git-cvsserver-server.sh | 35 +++++++++++++++------------------\n t/t9802-git-p4-filetype.sh      |  2 +-\n t/t9807-git-p4-submit.sh        |  2 +-\n t/t9824-git-p4-git-lfs.sh       |  4 ++--\n 6 files changed, 26 insertions(+), 33 deletions(-)\n\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex dbb5042b0b8f..60e30fed3c2c 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -986,7 +986,7 @@ test_expect_success 'L: nested tree copy does not corrupt deltas' '\n \ttest_when_finished \"git update-ref -d refs/heads/L2\" &&\n \tgit fast-import <input &&\n \tgit ls-tree L2 g/b/ >tmp &&\n-\tcat tmp | cut -f 2 >actual &&\n+\tcut -f 2 <tmp >actual &&\n \ttest_cmp expect actual &&\n \tgit fsck $(git rev-parse L2)\n '\n@@ -2007,12 +2007,11 @@ test_expect_success 'Q: verify first notes commit' '\n '\n \n test_expect_success 'Q: verify first notes tree' '\n-\tcat >expect.unsorted <<-EOF &&\n+\tsort >expect <<-EOF &&\n \t100644 blob $commit1\n \t100644 blob $commit2\n \t100644 blob $commit3\n \tEOF\n-\tcat expect.unsorted | sort >expect &&\n \tgit cat-file -p refs/notes/foobar~2^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n \ttest_cmp expect actual\n '\n@@ -2048,12 +2047,11 @@ test_expect_success 'Q: verify second notes commit' '\n '\n \n test_expect_success 'Q: verify second notes tree' '\n-\tcat >expect.unsorted <<-EOF &&\n+\tsort >expect <<-EOF &&\n \t100644 blob $commit1\n \t100644 blob $commit2\n \t100644 blob $commit3\n \tEOF\n-\tcat expect.unsorted | sort >expect &&\n \tgit cat-file -p refs/notes/foobar^^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n \ttest_cmp expect actual\n '\n@@ -2088,10 +2086,9 @@ test_expect_success 'Q: verify third notes commit' '\n '\n \n test_expect_success 'Q: verify third notes tree' '\n-\tcat >expect.unsorted <<-EOF &&\n+\tsort >expect <<-EOF &&\n \t100644 blob $commit1\n \tEOF\n-\tcat expect.unsorted | sort >expect &&\n \tgit cat-file -p refs/notes/foobar2^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n \ttest_cmp expect actual\n '\n@@ -2115,10 +2112,9 @@ test_expect_success 'Q: verify fourth notes commit' '\n '\n \n test_expect_success 'Q: verify fourth notes tree' '\n-\tcat >expect.unsorted <<-EOF &&\n+\tsort >expect <<-EOF &&\n \t100644 blob $commit2\n \tEOF\n-\tcat expect.unsorted | sort >expect &&\n \tgit cat-file -p refs/notes/foobar^{tree} | sed \"s/ [0-9a-f]*\t/ /\" >actual &&\n \ttest_cmp expect actual\n '\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex e9a12c18bbd3..d86d07a79d4f 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -236,7 +236,7 @@ EOF\n \n test_expect_success 'set up faked signed tag' '\n \n-\tcat signed-tag-import | git fast-import\n+\tgit fast-import <signed-tag-import\n \n '\n \ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex 003c0b61d0ff..e499c7f95512 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -117,12 +117,12 @@ END VERIFICATION REQUEST\n EOF\n \n test_expect_success 'pserver authentication' '\n-\tcat request-anonymous | git-cvsserver pserver >log 2>&1 &&\n+\tgit-cvsserver pserver <request-anonymous >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \n test_expect_success 'pserver authentication failure (non-anonymous user)' '\n-\tif cat request-git | git-cvsserver pserver >log 2>&1\n+\tif git-cvsserver pserver <request-git >log 2>&1\n \tthen\n \t    false\n \telse\n@@ -132,17 +132,17 @@ test_expect_success 'pserver authentication failure (non-anonymous user)' '\n '\n \n test_expect_success 'pserver authentication success (non-anonymous user with password)' '\n-\tcat login-git-ok | git-cvsserver pserver >log 2>&1 &&\n+\tgit-cvsserver pserver <login-git-ok >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \n test_expect_success 'pserver authentication (login)' '\n-\tcat login-anonymous | git-cvsserver pserver >log 2>&1 &&\n+\tgit-cvsserver pserver <login-anonymous >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \n test_expect_success 'pserver authentication failure (login/non-anonymous user)' '\n-\tif cat login-git | git-cvsserver pserver >log 2>&1\n+\tif git-cvsserver pserver <login-git >log 2>&1\n \tthen\n \t    false\n \telse\n@@ -172,7 +172,7 @@ Root $WORKDIR\n EOF\n \n test_expect_success 'req_Root failure (relative pathname)' '\n-\tif cat request-relative | git-cvsserver pserver >log 2>&1\n+\tif git-cvsserver pserver <request-relative >log 2>&1\n \tthen\n \t\techo unexpected success\n \t\tfalse\n@@ -183,28 +183,26 @@ test_expect_success 'req_Root failure (relative pathname)' '\n '\n \n test_expect_success 'req_Root failure (conflicting roots)' '\n-\tcat request-conflict | git-cvsserver pserver >log 2>&1 &&\n+\tgit-cvsserver pserver <request-conflict >log 2>&1 &&\n \ttail log | grep \"^error 1 Conflicting roots specified$\"\n '\n \n test_expect_success 'req_Root (strict paths)' '\n-\tcat request-anonymous | git-cvsserver --strict-paths pserver \"$SERVERDIR\" >log 2>&1 &&\n+\tgit-cvsserver --strict-paths pserver \"$SERVERDIR\" <request-anonymous >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \n test_expect_success 'req_Root failure (strict-paths)' '\n-\t! cat request-anonymous |\n-\tgit-cvsserver --strict-paths pserver \"$WORKDIR\" >log 2>&1\n+\t! git-cvsserver --strict-paths pserver \"$WORKDIR\" <request-anonymous >log 2>&1\n '\n \n test_expect_success 'req_Root (w/o strict-paths)' '\n-\tcat request-anonymous | git-cvsserver pserver \"$WORKDIR/\" >log 2>&1 &&\n+\tgit-cvsserver pserver \"$WORKDIR/\" <request-anonymous >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \n test_expect_success 'req_Root failure (w/o strict-paths)' '\n-\t! cat request-anonymous |\n-\tgit-cvsserver pserver \"$WORKDIR/gitcvs\" >log 2>&1\n+\t! git-cvsserver pserver \"$WORKDIR/gitcvs\" <request-anonymous >log 2>&1\n '\n \n cat >request-base  <<EOF\n@@ -217,27 +215,26 @@ Root /gitcvs.git\n EOF\n \n test_expect_success 'req_Root (base-path)' '\n-\tcat request-base | git-cvsserver --strict-paths --base-path \"$WORKDIR/\" pserver \"$SERVERDIR\" >log 2>&1 &&\n+\tgit-cvsserver --strict-paths --base-path \"$WORKDIR/\" pserver \"$SERVERDIR\" <request-base >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \n test_expect_success 'req_Root failure (base-path)' '\n-\t! cat request-anonymous |\n-\tgit-cvsserver --strict-paths --base-path \"$WORKDIR\" pserver \"$SERVERDIR\" >log 2>&1\n+\t! git-cvsserver --strict-paths --base-path \"$WORKDIR\" pserver \"$SERVERDIR\" <request-anonymous >log 2>&1\n '\n \n GIT_DIR=\"$SERVERDIR\" git config --bool gitcvs.enabled false || exit 1\n \n test_expect_success 'req_Root (export-all)' '\n-\tcat request-anonymous | git-cvsserver --export-all pserver \"$WORKDIR\" >log 2>&1 &&\n+\tgit-cvsserver --export-all pserver \"$WORKDIR\" <request-anonymous >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \n test_expect_success 'req_Root failure (export-all w/o directory list)' '\n-\t! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)'\n+\t! (git-cvsserver --export-all pserver <request-anonymous >log 2>&1 || false)'\n \n test_expect_success 'req_Root (everything together)' '\n-\tcat request-base | git-cvsserver --export-all --strict-paths --base-path \"$WORKDIR/\" pserver \"$SERVERDIR\" >log 2>&1 &&\n+\tgit-cvsserver --export-all --strict-paths --base-path \"$WORKDIR/\" pserver \"$SERVERDIR\" <request-base >log 2>&1 &&\n \tsed -ne \\$p log | grep \"^I LOVE YOU\\$\"\n '\n \ndiff --git a/t/t9802-git-p4-filetype.sh b/t/t9802-git-p4-filetype.sh\nindex 2a6ee2a46787..bb236cd2b57a 100755\n--- a/t/t9802-git-p4-filetype.sh\n+++ b/t/t9802-git-p4-filetype.sh\n@@ -175,7 +175,7 @@ test_expect_success 'keyword file create' '\n \t\tcp k-text-k k-text-ko &&\n \t\tp4 add -t text+ko k-text-ko &&\n \n-\t\tcat k-text-k | iconv -f ascii -t utf-16 >k-utf16-k &&\n+\t\ticonv -f ascii -t utf-16 <k-text-k >k-utf16-k &&\n \t\tp4 add -t utf16+k k-utf16-k &&\n \n \t\tcp k-utf16-k k-utf16-ko &&\ndiff --git a/t/t9807-git-p4-submit.sh b/t/t9807-git-p4-submit.sh\nindex af4b286f9d51..6ae7ced51be1 100755\n--- a/t/t9807-git-p4-submit.sh\n+++ b/t/t9807-git-p4-submit.sh\n@@ -418,7 +418,7 @@ test_expect_success 'description with Jobs and values on separate lines' '\n \t\t\tmarshal_dump job0 <change &&\n \t\t\tmarshal_dump job1 <change\n \t\t) | sort >jobs &&\n-\t\tcat jobname1 jobname2 | sort >expected &&\n+\t\tsort jobname1 jobname2 >expected &&\n \t\ttest_cmp expected jobs\n \t)\n '\ndiff --git a/t/t9824-git-p4-git-lfs.sh b/t/t9824-git-p4-git-lfs.sh\nindex a28dbbdd566c..fd430403d716 100755\n--- a/t/t9824-git-p4-git-lfs.sh\n+++ b/t/t9824-git-p4-git-lfs.sh\n@@ -17,8 +17,8 @@ test_file_in_lfs () {\n \tsed -n '2,2 p' \"$FILE\" | grep \"^oid \" &&\n \tsed -n '3,3 p' \"$FILE\" | grep \"^size \" &&\n \ttest_line_count = 3 \"$FILE\" &&\n-\tcat \"$FILE\" | grep \"size $SIZE\" &&\n-\tHASH=$(cat \"$FILE\" | grep \"oid sha256:\" | sed -e \"s/oid sha256://g\") &&\n+\tgrep \"size $SIZE\" \"$FILE\" &&\n+\tHASH=$(grep \"oid sha256:\" \"$FILE\" | sed -e \"s/oid sha256://g\") &&\n \tLFS_FILE=\".git/lfs/objects/$(echo \"$HASH\" | cut -c1-2)/$(echo \"$HASH\" | cut -c3-4)/$HASH\" &&\n \techo $EXPECTED_CONTENT >expect &&\n \ttest_path_is_file \"$FILE\" &&\n-- \n2.44.0\n\n"},{"id":"490724","messageId":"20240315194620.10713-16-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 15/22] t/t1*: merge a \"grep | sed\" pipeline","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:12Z","receivedAt":"2024-03-15T19:46:50Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t1509/prepare-chroot.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1509/prepare-chroot.sh b/t/t1509/prepare-chroot.sh\nindex 6d47e2c725f7..dc997e0a6437 100755\n--- a/t/t1509/prepare-chroot.sh\n+++ b/t/t1509/prepare-chroot.sh\n@@ -43,7 +43,7 @@ rsync --exclude-from t/t1509/excludes -Ha . \"$R$(pwd)\"\n # env might slip through, see test-lib.sh, unset.*PERL_PATH\n sed 's|^PERL_PATH=.*|PERL_PATH=/bin/true|' GIT-BUILD-OPTIONS > \"$R$(pwd)/GIT-BUILD-OPTIONS\"\n for cmd in git $BB;do \n-\tldd $cmd | grep '/' | sed 's,.*\\s\\(/[^ ]*\\).*,\\1,' | while read i; do\n+\tldd $cmd | sed -n '/\\//s,.*\\s\\(/[^ ]*\\).*,\\1,p' | while read i; do\n \t\tmkdir -p \"$R$(dirname $i)\"\n \t\tcp \"$i\" \"$R/$i\"\n \tdone\n-- \n2.44.0\n\n"},{"id":"490725","messageId":"20240315194620.10713-17-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 16/22] t/t3*: merge a \"grep | awk\" pipeline","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:13Z","receivedAt":"2024-03-15T19:46:51Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t3920-crlf-messages.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh\nindex 5eed640a6825..50ae222f0842 100755\n--- a/t/t3920-crlf-messages.sh\n+++ b/t/t3920-crlf-messages.sh\n@@ -97,7 +97,7 @@ test_expect_success 'branch: --verbose works with messages using CRLF' '\n \tgit branch -v >tmp &&\n \t# Remove first two columns, and the line for the currently checked out branch\n \tcurrent=$(git branch --show-current) &&\n-\tgrep -v $current <tmp | awk \"{\\$1=\\$2=\\\"\\\"}1\"  >actual &&\n+\tawk \"/$current/ { next } { \\$1 = \\$2 = \\\"\\\" } 1\" <tmp >actual &&\n \ttest_cmp expect actual\n '\n \n-- \n2.44.0\n\n"},{"id":"490726","messageId":"20240315194620.10713-18-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 17/22] t/t4*: merge a \"grep | sed\" pipeline","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:14Z","receivedAt":"2024-03-15T19:46:53Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t4002-diff-basic.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t4002-diff-basic.sh b/t/t4002-diff-basic.sh\nindex 7afc883ec374..cb3307010c1e 100755\n--- a/t/t4002-diff-basic.sh\n+++ b/t/t4002-diff-basic.sh\n@@ -405,7 +405,7 @@ test_expect_success 'diff-tree -r B A == diff-tree -r -R A B' '\n \n test_expect_success 'diff can read from stdin' '\n \ttest_must_fail git diff --no-index -- MN - < NN |\n-\t\tgrep -v \"^index\" | sed \"s#/-#/NN#\" >.test-a &&\n+\t\tsed \"/^index/d; s#/-#/NN#\" >.test-a &&\n \ttest_must_fail git diff --no-index -- MN NN |\n \t\tgrep -v \"^index\" >.test-b &&\n \ttest_cmp .test-a .test-b\n-- \n2.44.0\n\n"},{"id":"490727","messageId":"20240315194620.10713-19-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 18/22] t/t5*: merge a \"grep | sed\" pipeline","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:15Z","receivedAt":"2024-03-15T19:46:53Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t5401-update-hooks.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5401-update-hooks.sh b/t/t5401-update-hooks.sh\nindex 8b8bc47dc0b9..d8cadeec7331 100755\n--- a/t/t5401-update-hooks.sh\n+++ b/t/t5401-update-hooks.sh\n@@ -123,7 +123,7 @@ remote: STDOUT post-update\n remote: STDERR post-update\n EOF\n test_expect_success 'send-pack stderr contains hook messages' '\n-\tgrep ^remote: send.err | sed \"s/ *\\$//\" >actual &&\n+\tsed -n \"/^remote:/s/ *\\$//p\" send.err >actual &&\n \ttest_cmp expect actual\n '\n \n-- \n2.44.0\n\n"},{"id":"490729","messageId":"20240315194620.10713-20-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 19/22] t/t8*: merge \"grep | sed\" pipelines","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:16Z","receivedAt":"2024-03-15T19:46:54Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t8013-blame-ignore-revs.sh | 28 ++++++++++++++--------------\n 1 file changed, 14 insertions(+), 14 deletions(-)\n\ndiff --git a/t/t8013-blame-ignore-revs.sh b/t/t8013-blame-ignore-revs.sh\nindex 9a03b0f361ff..dbfbd86e83a7 100755\n--- a/t/t8013-blame-ignore-revs.sh\n+++ b/t/t8013-blame-ignore-revs.sh\n@@ -25,11 +25,11 @@ test_expect_success setup '\n \n \tgit blame --line-porcelain file >blame_raw &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse X >expect &&\n \ttest_cmp expect actual &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse X >expect &&\n \ttest_cmp expect actual\n '\n@@ -53,11 +53,11 @@ do\n \ttest_expect_success \"ignore_rev_changing_lines ($I)\" '\n \t\tgit blame --line-porcelain --ignore-rev $I file >blame_raw &&\n \n-\t\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\t\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p\" blame_raw >actual &&\n \t\tgit rev-parse A >expect &&\n \t\ttest_cmp expect actual &&\n \n-\t\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\t\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p\" blame_raw >actual &&\n \t\tgit rev-parse B >expect &&\n \t\ttest_cmp expect actual\n \t'\n@@ -79,10 +79,10 @@ test_expect_success ignore_rev_adding_unblamable_lines '\n \tgit rev-parse Y >expect &&\n \tgit blame --line-porcelain file --ignore-rev Y >blame_raw &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 3\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 3/s/ .*//p\" blame_raw >actual &&\n \ttest_cmp expect actual &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 4\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 4/s/ .*//p\" blame_raw >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -92,11 +92,11 @@ test_expect_success ignore_revs_from_files '\n \tgit rev-parse Y >ignore_y &&\n \tgit blame --line-porcelain file --ignore-revs-file ignore_x --ignore-revs-file ignore_y >blame_raw &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse A >expect &&\n \ttest_cmp expect actual &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse B >expect &&\n \ttest_cmp expect actual\n '\n@@ -106,11 +106,11 @@ test_expect_success ignore_revs_from_configs_and_files '\n \tgit config --add blame.ignoreRevsFile ignore_x &&\n \tgit blame --line-porcelain file --ignore-revs-file ignore_y >blame_raw &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse A >expect &&\n \ttest_cmp expect actual &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse B >expect &&\n \ttest_cmp expect actual\n '\n@@ -121,10 +121,10 @@ test_expect_success override_ignore_revs_file '\n \tgit blame --line-porcelain file --ignore-revs-file \"\" --ignore-revs-file ignore_y >blame_raw &&\n \tgit rev-parse X >expect &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p\" blame_raw >actual &&\n \ttest_cmp expect actual &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 2\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 2/s/ .*//p\" blame_raw >actual &&\n \ttest_cmp expect actual\n \t'\n test_expect_success bad_files_and_revs '\n@@ -279,11 +279,11 @@ test_expect_success ignore_merge '\n \ttest_merge M B &&\n \tgit blame --line-porcelain file --ignore-rev M >blame_raw &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 1\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 1/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse B >expect &&\n \ttest_cmp expect actual &&\n \n-\tgrep -E \"^[0-9a-f]+ [0-9]+ 9\" blame_raw | sed -e \"s/ .*//\" >actual &&\n+\tsed -ne \"/^[0-9a-f][0-9a-f]* [0-9][0-9]* 9/s/ .*//p\" blame_raw >actual &&\n \tgit rev-parse C >expect &&\n \ttest_cmp expect actual\n '\n-- \n2.44.0\n\n"},{"id":"490728","messageId":"20240315194620.10713-21-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 20/22] t/t9*: merge \"grep | sed\" pipelines","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:17Z","receivedAt":"2024-03-15T19:46:55Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n t/t9118-git-svn-funky-branch-names.sh | 2 +-\n t/t9350-fast-export.sh                | 2 +-\n t/t9824-git-p4-git-lfs.sh             | 2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh\nindex a159ff96b718..d3261e35b818 100755\n--- a/t/t9118-git-svn-funky-branch-names.sh\n+++ b/t/t9118-git-svn-funky-branch-names.sh\n@@ -38,7 +38,7 @@ test_expect_success 'setup svnrepo' '\n # SVN 1.7 will truncate \"not-a%40{0]\" to just \"not-a\".\n # Look at what SVN wound up naming the branch and use that.\n # Be sure to escape the @ if it shows up.\n-non_reflog=$(svn_cmd ls \"$svnrepo/pr ject/branches\" | grep not-a | sed 's/\\///' | sed 's/@/%40/')\n+non_reflog=$(svn_cmd ls \"$svnrepo/pr ject/branches\" | sed -ne '/not-a/ { s/\\///; s/@/%40/; p }')\n \n test_expect_success 'test clone with funky branch names' '\n \tgit svn clone -s \"$svnrepo/pr ject\" project &&\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex d86d07a79d4f..1eb035ee4ce5 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -537,7 +537,7 @@ test_expect_success 'full-tree re-shows unmodified files'        '\n \n test_expect_success 'set-up a few more tags for tag export tests' '\n \tgit checkout -f main &&\n-\tHEAD_TREE=$(git show -s --pretty=raw HEAD | grep tree | sed \"s/tree //\") &&\n+\tHEAD_TREE=$(git show -s --pretty=raw HEAD | sed -n \"/tree/s/tree //p\") &&\n \tgit tag    tree_tag        -m \"tagging a tree\" $HEAD_TREE &&\n \tgit tag -a tree_tag-obj    -m \"tagging a tree\" $HEAD_TREE &&\n \tgit tag    tag-obj_tag     -m \"tagging a tag\" tree_tag-obj &&\ndiff --git a/t/t9824-git-p4-git-lfs.sh b/t/t9824-git-p4-git-lfs.sh\nindex fd430403d716..80c8c31e320f 100755\n--- a/t/t9824-git-p4-git-lfs.sh\n+++ b/t/t9824-git-p4-git-lfs.sh\n@@ -18,7 +18,7 @@ test_file_in_lfs () {\n \tsed -n '3,3 p' \"$FILE\" | grep \"^size \" &&\n \ttest_line_count = 3 \"$FILE\" &&\n \tgrep \"size $SIZE\" \"$FILE\" &&\n-\tHASH=$(grep \"oid sha256:\" \"$FILE\" | sed -e \"s/oid sha256://g\") &&\n+\tHASH=$(sed -ne \"/oid sha256:/s/oid sha256://gp\" \"$FILE\") &&\n \tLFS_FILE=\".git/lfs/objects/$(echo \"$HASH\" | cut -c1-2)/$(echo \"$HASH\" | cut -c3-4)/$HASH\" &&\n \techo $EXPECTED_CONTENT >expect &&\n \ttest_path_is_file \"$FILE\" &&\n-- \n2.44.0\n\n"},{"id":"490730","messageId":"20240315194620.10713-22-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 21/22] contrib/coverage-diff: avoid redundant pipelines","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:18Z","receivedAt":"2024-03-15T19:46:57Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Merge multiple sed and \"grep | awk\" invocations, finally use \"sort -u\"\ninstead of \"sort | uniq\".\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n contrib/coverage-diff.sh | 9 ++-------\n 1 file changed, 2 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/coverage-diff.sh b/contrib/coverage-diff.sh\nindex 4ec419f90048..6ce9603568ef 100755\n--- a/contrib/coverage-diff.sh\n+++ b/contrib/coverage-diff.sh\n@@ -74,8 +74,7 @@ do\n \tsort >uncovered_lines.txt\n \n \tcomm -12 uncovered_lines.txt new_lines.txt |\n-\tsed -e 's/$/\\)/' |\n-\tsed -e 's/^/ /' >uncovered_new_lines.txt\n+\tsed -e 's/$/\\)/' -e 's/^/ /' >uncovered_new_lines.txt\n \n \tgrep -q '[^[:space:]]' <uncovered_new_lines.txt &&\n \techo $file >>coverage-data.txt &&\n@@ -91,11 +90,7 @@ cat coverage-data.txt\n \n echo \"Commits introducing uncovered code:\"\n \n-commit_list=$(cat coverage-data.txt |\n-\tgrep -E '^[0-9a-f]{7,} ' |\n-\tawk '{print $1;}' |\n-\tsort |\n-\tuniq)\n+commit_list=$(awk '/^[0-9a-f]{7,}/ { print $1 }' coverage-data.txt | sort -u)\n \n (\n \tfor commit in $commit_list\n-- \n2.44.0\n\n"},{"id":"490731","messageId":"20240315194620.10713-23-dev+git@drbeat.li","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"[PATCH v2 22/22] git-quiltimport: avoid an unnecessary subshell","fromName":"Beat Bolli","fromEmail":"bb@drbeat.li","sentAt":"2024-03-15T19:46:19Z","receivedAt":"2024-03-15T19:46:58Z","isPatch":true,"sender":{"key":"bb@drbeat.li","avatar":null},"body":"Use braces for the compound command.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n git-quiltimport.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-quiltimport.sh b/git-quiltimport.sh\nindex e3d390974331..eb34cda4092a 100755\n--- a/git-quiltimport.sh\n+++ b/git-quiltimport.sh\n@@ -148,7 +148,7 @@ do\n \tif [ -z \"$dry_run\" ] ; then\n \t\tgit apply --index -C1 ${level:+\"$level\"} \"$tmp_patch\" &&\n \t\ttree=$(git write-tree) &&\n-\t\tcommit=$( (echo \"$SUBJECT\"; echo; cat \"$tmp_msg\") | git commit-tree $tree -p $commit) &&\n+\t\tcommit=$( { echo \"$SUBJECT\"; echo; cat \"$tmp_msg\"; } | git commit-tree $tree -p $commit) &&\n \t\tgit update-ref -m \"quiltimport: $patch_name\" HEAD $commit || exit 4\n \tfi\n done 3<\"$QUILT_SERIES\"\n-- \n2.44.0\n\n"},{"id":"490750","messageId":"ZfT3H7IiewuhAA7M@nand.local","threadId":"61057","inReplyTo":"20240315194620.10713-10-dev+git@drbeat.li","subject":"Re: [PATCH v2 09/22] t/t4*: avoid redundant uses of cat","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-03-16T01:34:23Z","receivedAt":"2024-03-16T01:34:25Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Fri, Mar 15, 2024 at 08:46:06PM +0100, Beat Bolli wrote:\n> diff --git a/t/t4301-merge-tree-write-tree.sh b/t/t4301-merge-tree-write-tree.sh\n> index 12ac43687366..578641467753 100755\n> --- a/t/t4301-merge-tree-write-tree.sh\n> +++ b/t/t4301-merge-tree-write-tree.sh\n> @@ -313,7 +313,7 @@ test_expect_success 'rename/add handling' '\n>  \t\t# First, check that the bar that appears at stage 3 does not\n>  \t\t# correspond to an individual blob anywhere in history\n>  \t\t#\n> -\t\thash=$(cat out | tr \"\\0\" \"\\n\" | head -n 3 | grep 3.bar | cut -f 2 -d \" \") &&\n> +\t\thash=$(tr \"\\0\" \"\\n\" <out | head -n 3 | grep 3.bar | cut -f 2 -d \" \") &&\n>  \t\tgit rev-list --objects --all >all_blobs &&\n>  \t\t! grep $hash all_blobs &&\n\nThis and the two similar transformations below it look good to me. This\nobviously isn't the fault of your patch (nor should it necessarily be\nits aim to fix), but I wonder if it would be worthwhile to extract the\n\n    tr \"\\0\" \"\\n\" <out | head -n 3 | grep 3.bar | cut -f 2 -d \" \"\n\npattern into a helper function, since it's used in a few places in this\ntest script.\n\nThat's just a suggestion, and shouldn't hold up this patch/series. Maybe\njust some #leftoverbits :-).\n\nThanks,\nTaylor\n"},{"id":"490751","messageId":"ZfT6xxBnQs6ppYB2@nand.local","threadId":"61057","inReplyTo":"20240315194620.10713-17-dev+git@drbeat.li","subject":"Re: [PATCH v2 16/22] t/t3*: merge a \"grep | awk\" pipeline","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-03-16T01:49:59Z","receivedAt":"2024-03-16T01:50:01Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Fri, Mar 15, 2024 at 08:46:13PM +0100, Beat Bolli wrote:\n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>  t/t3920-crlf-messages.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh\n> index 5eed640a6825..50ae222f0842 100755\n> --- a/t/t3920-crlf-messages.sh\n> +++ b/t/t3920-crlf-messages.sh\n> @@ -97,7 +97,7 @@ test_expect_success 'branch: --verbose works with messages using CRLF' '\n>  \tgit branch -v >tmp &&\n>  \t# Remove first two columns, and the line for the currently checked out branch\n>  \tcurrent=$(git branch --show-current) &&\n> -\tgrep -v $current <tmp | awk \"{\\$1=\\$2=\\\"\\\"}1\"  >actual &&\n> +\tawk \"/$current/ { next } { \\$1 = \\$2 = \\\"\\\" } 1\" <tmp >actual &&\n\nI think that using `next` here is fine to ignore lines that match\n`$current`, but the canonical approach would probably be using the\n`!` operator instead to negate the match, like so:\n\n    awk \"!/$current/ { \\$1 = \\$2 = \\\"\\\" } 1\" <tmp >actual &&\n\nNot worth a reroll, of course, just something that I noticed while\nreading.\n\nThanks,\nTaylor\n"},{"id":"490752","messageId":"ZfT7HHZ9Uchvp6Ao@nand.local","threadId":"61057","inReplyTo":"20240315194620.10713-1-dev+git@drbeat.li","subject":"Re: [PATCH v2 00/22] avoid redundant pipelines","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-03-16T01:51:24Z","receivedAt":"2024-03-16T01:51:26Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Fri, Mar 15, 2024 at 08:45:57PM +0100, Beat Bolli wrote:\n> As follow-up to [1], here's a series that eliminates redundant\n> pipelines, mostly under t/.\n>\n> --\n> 2.44.0\n\nI read through both rounds of this series thoroughly and everything\nlooks all good to me. I left a couple of minor notes throughout that you\nmight consider changing, but I think that neither merit a reroll.\n\nI'd be happy to see this series move forward as-is. Thanks for working\non this!\n\nThanks,\nTaylor\n"},{"id":"490764","messageId":"xmqqy1ain255.fsf@gitster.g","threadId":"61057","inReplyTo":"ZfT3H7IiewuhAA7M@nand.local","subject":"Re: [PATCH v2 09/22] t/t4*: avoid redundant uses of cat","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-16T06:04:22Z","receivedAt":"2024-03-16T06:04:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Taylor Blau <me@ttaylorr.com> writes:\n\n> This and the two similar transformations below it look good to me. This\n> obviously isn't the fault of your patch (nor should it necessarily be\n> its aim to fix), but I wonder if it would be worthwhile to extract the\n>\n>     tr \"\\0\" \"\\n\" <out | head -n 3 | grep 3.bar | cut -f 2 -d \" \"\n>\n> pattern into a helper function, since it's used in a few places in this\n> test script.\n\nI somehow thought that the theme of the topic is to reduce the depth\nof the pipeline.  \"head -n 3\" piped into \"grep\" sounds something a\nsingle sed script can do, e.g.\n\n\ttr '\\000' '\\012' <out |\tsed -n -e '1,3s/3.bar/&/p'\n\n> That's just a suggestion, and shouldn't hold up this patch/series. Maybe\n> just some #leftoverbits :-).\n\nDitto.  The whole thing can be turned into a Perl scriptlet, which\nmay be even easier to read (the cost to spin up one Perl interpreter\nmight be greater than constructing 4 process pipeline on certain\nsystems, though).\n\nThanks.\n\nP.S. It is nice to hear from you Taylor.  It's been a while.\n\n"},{"id":"490776","messageId":"5aacb015-c01a-4c6f-8e37-931581aa71b6@drbeat.li","threadId":"61057","inReplyTo":"ZfT6xxBnQs6ppYB2@nand.local","subject":"Re: [PATCH v2 16/22] t/t3*: merge a \"grep | awk\" pipeline","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2024-03-16T10:09:47Z","receivedAt":"2024-03-16T10:09:51Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"On 16.03.24 02:49, Taylor Blau wrote:\n> On Fri, Mar 15, 2024 at 08:46:13PM +0100, Beat Bolli wrote:\n>> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n>> ---\n>>   t/t3920-crlf-messages.sh | 2 +-\n>>   1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> diff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh\n>> index 5eed640a6825..50ae222f0842 100755\n>> --- a/t/t3920-crlf-messages.sh\n>> +++ b/t/t3920-crlf-messages.sh\n>> @@ -97,7 +97,7 @@ test_expect_success 'branch: --verbose works with messages using CRLF' '\n>>   \tgit branch -v >tmp &&\n>>   \t# Remove first two columns, and the line for the currently checked out branch\n>>   \tcurrent=$(git branch --show-current) &&\n>> -\tgrep -v $current <tmp | awk \"{\\$1=\\$2=\\\"\\\"}1\"  >actual &&\n>> +\tawk \"/$current/ { next } { \\$1 = \\$2 = \\\"\\\" } 1\" <tmp >actual &&\n> \n> I think that using `next` here is fine to ignore lines that match\n> `$current`, but the canonical approach would probably be using the\n> `!` operator instead to negate the match, like so:\n> \n>      awk \"!/$current/ { \\$1 = \\$2 = \\\"\\\" } 1\" <tmp >actual &&\n> \n> Not worth a reroll, of course, just something that I noticed while\n> reading.\n\nExcept it's not the same :-) This was actually my first try, but then I \nrealized that awk continues to evaluate patterns and actions until the \nend of the script. The \"1\" at the end is the \"always true\" pattern that \ncauses the default action \"print $0\" to run.\n\nSo the \"next\" is needed to discard the current line.\n\nHaving said this,\n\n     awk \"!/$current/ { \\$1 = \\$2 = \\\"\\\"; print \\$0 }\" <tmp >actual &&\n\nwould work, and it would also remove the obscure flow detailed above.\n\n\nRegards, Beat\n"},{"id":"490781","messageId":"ZfW+8GTKlxq1S1Tx@nand.local","threadId":"61057","inReplyTo":"5aacb015-c01a-4c6f-8e37-931581aa71b6@drbeat.li","subject":"Re: [PATCH v2 16/22] t/t3*: merge a \"grep | awk\" pipeline","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-03-16T15:46:56Z","receivedAt":"2024-03-16T15:46:58Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Sat, Mar 16, 2024 at 11:09:47AM +0100, Beat Bolli wrote:\n> On 16.03.24 02:49, Taylor Blau wrote:\n> > On Fri, Mar 15, 2024 at 08:46:13PM +0100, Beat Bolli wrote:\n> > > Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> > > ---\n> > >   t/t3920-crlf-messages.sh | 2 +-\n> > >   1 file changed, 1 insertion(+), 1 deletion(-)\n> > >\n> > > diff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh\n> > > index 5eed640a6825..50ae222f0842 100755\n> > > --- a/t/t3920-crlf-messages.sh\n> > > +++ b/t/t3920-crlf-messages.sh\n> > > @@ -97,7 +97,7 @@ test_expect_success 'branch: --verbose works with messages using CRLF' '\n> > >   \tgit branch -v >tmp &&\n> > >   \t# Remove first two columns, and the line for the currently checked out branch\n> > >   \tcurrent=$(git branch --show-current) &&\n> > > -\tgrep -v $current <tmp | awk \"{\\$1=\\$2=\\\"\\\"}1\"  >actual &&\n> > > +\tawk \"/$current/ { next } { \\$1 = \\$2 = \\\"\\\" } 1\" <tmp >actual &&\n> >\n> > I think that using `next` here is fine to ignore lines that match\n> > `$current`, but the canonical approach would probably be using the\n> > `!` operator instead to negate the match, like so:\n> >\n> >      awk \"!/$current/ { \\$1 = \\$2 = \\\"\\\" } 1\" <tmp >actual &&\n> >\n> > Not worth a reroll, of course, just something that I noticed while\n> > reading.\n>\n> Except it's not the same :-) This was actually my first try, but then I\n> realized that awk continues to evaluate patterns and actions until the end\n> of the script. The \"1\" at the end is the \"always true\" pattern that causes\n> the default action \"print $0\" to run.\n>\n> So the \"next\" is needed to discard the current line.\n>\n> Having said this,\n>\n>     awk \"!/$current/ { \\$1 = \\$2 = \\\"\\\"; print \\$0 }\" <tmp >actual &&\n>\n> would work, and it would also remove the obscure flow detailed above.\n>\n\nAh. Thanks for the explanation. These details would not hurt to have in\na commit message, but I think that this change is fine as-is. Those\ncurious enough can likely find this thread on the list for this\nparticular instance.\n\nBut these sort of less-than-trivial details are exactly the sorts of\nthings we like to capture in a well-written patch message.\n\nThanks,\nTaylor\n"},{"id":"490791","messageId":"xmqqfrwqm4oy.fsf@gitster.g","threadId":"61057","inReplyTo":"ZfT7HHZ9Uchvp6Ao@nand.local","subject":"Re: [PATCH v2 00/22] avoid redundant pipelines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-16T18:06:53Z","receivedAt":"2024-03-16T18:07:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Taylor Blau <me@ttaylorr.com> writes:\n\n> On Fri, Mar 15, 2024 at 08:45:57PM +0100, Beat Bolli wrote:\n>> As follow-up to [1], here's a series that eliminates redundant\n>> pipelines, mostly under t/.\n>>\n>> --\n>> 2.44.0\n>\n> I read through both rounds of this series thoroughly and everything\n> looks all good to me. I left a couple of minor notes throughout that you\n> might consider changing, but I think that neither merit a reroll.\n>\n> I'd be happy to see this series move forward as-is. Thanks for working\n> on this!\n\nYeah, looks good.  Thanks, both.\n\n"}]}