{"thread":{"id":"49352","subject":"[PATCH v1 0/2] Cleanup tests for test_cmp argument ordering and \"|\" placement","startedAt":"2018-09-15T00:02:54Z","lastAt":"2018-10-06T23:53:45Z","messageCount":66,"participants":["Matthew DeVore","Junio C Hamano","Jonathan Nieder","Eric Sunshine","SZEDER Gábor"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"358173","messageId":"cover.1536969438.git.matvore@google.com","threadId":"49352","inReplyTo":null,"subject":"[PATCH v1 0/2] Cleanup tests for test_cmp argument ordering and \"|\" placement","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-15T00:02:34Z","receivedAt":"2018-09-15T00:02:54Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"As requested in:\n https://public-inbox.org/git/xmqqmuskas3a.fsf@gitster-ct.c.googlers.com/\nthis patchset corrects ordering of test_cmp arguments and | placement.\n\nThe request didn't explicitly state whether all the tests should be cleaned up,\nbut I did clean up as much as I reasonably could.\n\nThe linked mail above also requested cleaning up flag/positional arg ordering so\nthat flags appear first. The amount of wrong ordering I could find was small, so\nI put that cleanup in the other patchset.\n\nMatthew DeVore (2):\n  t/*: fix pipe placement and remove \\'s\n  t/*: fix ordering of expected/observed arguments\n\n t/lib-gpg.sh                           |   4 +-\n t/t0000-basic.sh                       |   2 +-\n t/t0021-conversion.sh                  |   4 +-\n t/t1006-cat-file.sh                    |   8 +-\n t/t1300-config.sh                      |   9 +-\n t/t1303-wacky-config.sh                |   4 +-\n t/t2101-update-index-reupdate.sh       |   2 +-\n t/t3200-branch.sh                      |   2 +-\n t/t3320-notes-merge-worktrees.sh       |   4 +-\n t/t3400-rebase.sh                      |   8 +-\n t/t3417-rebase-whitespace-fix.sh       |   6 +-\n t/t3702-add-edit.sh                    |   4 +-\n t/t3903-stash.sh                       |   8 +-\n t/t3905-stash-include-untracked.sh     |   2 +-\n t/t4025-hunk-header.sh                 |   2 +-\n t/t4117-apply-reject.sh                |   6 +-\n t/t4124-apply-ws-rule.sh               |  30 +-\n t/t4138-apply-ws-expansion.sh          |   2 +-\n t/t5317-pack-objects-filter-objects.sh | 364 ++++++++++++++-----------\n t/t5318-commit-graph.sh                |   2 +-\n t/t5500-fetch-pack.sh                  |   5 +-\n t/t5616-partial-clone.sh               |  30 +-\n t/t5701-git-serve.sh                   |  14 +-\n t/t5702-protocol-v2.sh                 |  10 +-\n t/t6023-merge-file.sh                  |  12 +-\n t/t6027-merge-binary.sh                |   4 +-\n t/t6031-merge-filemode.sh              |   2 +-\n t/t6112-rev-list-filters-objects.sh    | 227 ++++++++-------\n t/t7201-co.sh                          |   4 +-\n t/t7406-submodule-update.sh            |   8 +-\n t/t7508-status.sh                      |   2 +-\n t/t7800-difftool.sh                    |   2 +-\n t/t9100-git-svn-basic.sh               |   2 +-\n t/t9101-git-svn-props.sh               |   4 +-\n t/t9133-git-svn-nested-git-repo.sh     |   6 +-\n t/t9600-cvsimport.sh                   |   2 +-\n t/t9603-cvsimport-patchsets.sh         |   4 +-\n t/t9604-cvsimport-timestamps.sh        |   4 +-\n 38 files changed, 452 insertions(+), 363 deletions(-)\n\n-- \n2.19.0.397.gdd90340f6a-goog\n\n"},{"id":"358174","messageId":"a4c833da81d83ea0e605c936d90ea9c7f5667d93.1536969438.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1536969438.git.matvore@google.com","subject":"[PATCH v1 1/2] t/*: fix pipe placement and remove \\'s","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-15T00:02:35Z","receivedAt":"2018-09-15T00:03:03Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Where ever there was code in the tests like this:\n\n\tfoo \\\n\t\t| bar\n\nsuch as:\n\n\tgit rev-list HEAD \\\n\t\t| grep $COMMIT\n\nreplace it with this:\n\n\tfoo |\n\tbar\n\nAnd add a blank line before and after the pipe where it aids readability\n(it usually does).\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/lib-gpg.sh                           |   4 +-\n t/t1006-cat-file.sh                    |   8 +-\n t/t1300-config.sh                      |   5 +-\n t/t5317-pack-objects-filter-objects.sh | 330 ++++++++++++++-----------\n t/t5500-fetch-pack.sh                  |   5 +-\n t/t5616-partial-clone.sh               |  30 ++-\n t/t6112-rev-list-filters-objects.sh    | 203 ++++++++-------\n t/t9101-git-svn-props.sh               |   4 +-\n 8 files changed, 339 insertions(+), 250 deletions(-)\n\ndiff --git a/t/lib-gpg.sh b/t/lib-gpg.sh\nindex 3fe02876c..2b8b81ac9 100755\n--- a/t/lib-gpg.sh\n+++ b/t/lib-gpg.sh\n@@ -57,8 +57,8 @@ then\n \t\techo | gpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null \\\n \t\t\t--passphrase-fd 0 --pinentry-mode loopback \\\n \t\t\t--import \"$TEST_DIRECTORY\"/lib-gpg/gpgsm_cert.p12 &&\n-\t\tgpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null -K \\\n-\t\t\t| grep fingerprint: | cut -d\" \" -f4 | tr -d '\\n' > \\\n+\t\tgpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null -K |\n+\t\tgrep fingerprint: | cut -d\" \" -f4 | tr -d '\\n' > \\\n \t\t\t${GNUPGHOME}/trustlist.txt &&\n \t\techo \" S relax\" >> ${GNUPGHOME}/trustlist.txt &&\n \t\t(gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) &&\ndiff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh\nindex 7f19d591f..a0fa926d3 100755\n--- a/t/t1006-cat-file.sh\n+++ b/t/t1006-cat-file.sh\n@@ -218,8 +218,8 @@ test_expect_success \"--batch-check for a non-existent hash\" '\n     test \"0000000000000000000000000000000000000042 missing\n 0000000000000000000000000000000000000084 missing\" = \\\n     \"$( ( echo 0000000000000000000000000000000000000042;\n-         echo_without_newline 0000000000000000000000000000000000000084; ) \\\n-       | git cat-file --batch-check)\"\n+         echo_without_newline 0000000000000000000000000000000000000084; ) |\n+       git cat-file --batch-check)\"\n '\n \n test_expect_success \"--batch for an existent and a non-existent hash\" '\n@@ -227,8 +227,8 @@ test_expect_success \"--batch for an existent and a non-existent hash\" '\n $tag_content\n 0000000000000000000000000000000000000000 missing\" = \\\n     \"$( ( echo $tag_sha1;\n-         echo_without_newline 0000000000000000000000000000000000000000; ) \\\n-       | git cat-file --batch)\"\n+         echo_without_newline 0000000000000000000000000000000000000000; ) |\n+       git cat-file --batch)\"\n '\n \n test_expect_success \"--batch-check for an empty line\" '\ndiff --git a/t/t1300-config.sh b/t/t1300-config.sh\nindex cdf1fed5d..5869d6cb6 100755\n--- a/t/t1300-config.sh\n+++ b/t/t1300-config.sh\n@@ -1770,8 +1770,9 @@ test_expect_success '--show-origin stdin with file include' '\n \tcat >expect <<-EOF &&\n \t\tfile:$INCLUDE_DIR/stdin.include\tinclude\n \tEOF\n-\techo \"[include]path=\\\"$INCLUDE_DIR\\\"/stdin.include\" \\\n-\t\t| git config --show-origin --includes --file - user.stdin >output &&\n+\techo \"[include]path=\\\"$INCLUDE_DIR\\\"/stdin.include\" |\n+\tgit config --show-origin --includes --file - user.stdin >output &&\n+\n \ttest_cmp expect output\n '\n \ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex 6710c8bc8..ce69148ec 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -20,17 +20,20 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r1 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r1 index-pack ../all.pack &&\n-\tgit -C r1 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -39,23 +42,27 @@ test_expect_success 'verify blob:none packfile has no blobs' '\n \tHEAD\n \tEOF\n \tgit -C r1 index-pack ../filter.pack &&\n-\tgit -C r1 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n \n test_expect_success 'verify normal and blob:none packfiles have same commits/trees' '\n-\tgit -C r1 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r1 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -75,17 +82,20 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../all.pack &&\n-\tgit -C r2 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -94,10 +104,12 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n@@ -107,99 +119,118 @@ test_expect_success 'verify blob:limit=1000' '\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.1000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1001 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=10001' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=10001 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.1000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify explicitly specifying oversized blob in input' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n \tHEAD\n \t$(git -C r2 rev-parse HEAD:large.10000)\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1m >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '\n-\tgit -C r2 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r2 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -224,71 +255,84 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../all.pack &&\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern1' '\n-\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern2' '\n-\tgit -C r3 ls-files -s sparse1 dir1/sparse1 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s sparse1 dir1/sparse1 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -312,48 +356,57 @@ test_expect_success 'setup r4' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r4 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../all.pack &&\n-\tgit -C r4 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=OID' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \toid=$(git -C r4 ls-files -s pattern | awk -f print_2.awk) &&\n \tgit -C r4 pack-objects --rev --stdout --filter=sparse:oid=$oid >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n-\tgit -C r4 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=oid-ish' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r4 pack-objects --rev --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n-\tgit -C r4 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -361,9 +414,10 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'setup r1 - delete loose blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tfor id in `cat expected | sed \"s|..|&/|\"`\n \tdo\n \t\trm r1/.git/objects/$id\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 1b5a4a6d3..5ac6f286d 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -50,8 +50,9 @@ pull_to_client () {\n \t\t\tcase \"$heads\" in *B*)\n \t\t\t    git update-ref refs/heads/B \"$BTIP\";;\n \t\t\tesac &&\n-\t\t\tgit symbolic-ref HEAD refs/heads/$(echo $heads \\\n-\t\t\t\t| sed -e \"s/^\\(.\\).*$/\\1/\") &&\n+\n+\t\t\tgit symbolic-ref HEAD refs/heads/$(echo $heads |\n+\t\t\tsed -e \"s/^\\(.\\).*$/\\1/\") &&\n \n \t\t\tgit fsck --full &&\n \ndiff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\nindex bbbe7537d..ec19cbceb 100755\n--- a/t/t5616-partial-clone.sh\n+++ b/t/t5616-partial-clone.sh\n@@ -34,10 +34,12 @@ test_expect_success 'setup bare clone for server' '\n # confirm partial clone was registered in the local config.\n test_expect_success 'do partial clone 1' '\n \tgit clone --no-checkout --filter=blob:none \"file://$(pwd)/srv.bare\" pc1 &&\n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_cmp expect_1.oids observed.oids &&\n \ttest \"$(git -C pc1 config --local core.repositoryformatversion)\" = \"1\" &&\n \ttest \"$(git -C pc1 config --local extensions.partialclone)\" = \"origin\" &&\n@@ -130,16 +132,20 @@ test_expect_success 'push new commits to server for file.3.txt' '\n # perhaps combined with a command in dry-run mode.\n test_expect_success 'manual prefetch of missing objects' '\n \tgit -C pc1 fetch --filter=blob:none origin &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_line_count = 6 observed.oids &&\n \tgit -C pc1 fetch-pack --stdin \"file://$(pwd)/srv.bare\" <observed.oids &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_line_count = 0 observed.oids\n '\n \ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex d4ff0b3be..0f6b569e1 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -20,24 +20,28 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob:none omits all 5 blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r1 rev-list HEAD --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r1 rev-list HEAD --objects |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -58,65 +62,76 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob:limit=500 omits all blobs' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r2 rev-list HEAD --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 rev-list HEAD --objects |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1000' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_must_be_empty observed\n '\n \n@@ -141,24 +156,28 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n-\tgit -C r3 ls-files -s sparse2 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s sparse2 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -173,25 +192,30 @@ test_expect_success 'setup r3 part 2' '\n '\n \n test_expect_success 'verify sparse:oid=OID omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \toid=$(git -C r3 ls-files -s pattern | awk -f print_2.awk) &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -199,17 +223,20 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'rev-list W/ --missing=print' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tfor id in `cat expected | sed \"s|..|&/|\"`\n \tdo\n \t\trm r1/.git/objects/$id\n \tdone &&\n-\tgit -C r1 rev-list --quiet HEAD --missing=print --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 rev-list --quiet HEAD --missing=print --objects |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \ndiff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\nindex 8a5c8dc1a..efe79fe55 100755\n--- a/t/t9101-git-svn-props.sh\n+++ b/t/t9101-git-svn-props.sh\n@@ -193,8 +193,8 @@ test_expect_success 'test propget' \"\n \tgit svn propget svn:ignore . | cmp - prop.expect &&\n \tcd deeply &&\n \tgit svn propget svn:ignore . | cmp - ../prop.expect &&\n-\tgit svn propget svn:entry:committed-rev nested/directory/.keep \\\n-\t  | cmp - ../prop2.expect &&\n+\tgit svn propget svn:entry:committed-rev nested/directory/.keep |\n+\tcmp - ../prop2.expect &&\n \tgit svn propget svn:ignore .. | cmp - ../prop.expect &&\n \tgit svn propget svn:ignore nested/ | cmp - ../prop.expect &&\n \tgit svn propget svn:ignore ./nested | cmp - ../prop.expect &&\n-- \n2.19.0.397.gdd90340f6a-goog\n\n"},{"id":"358175","messageId":"7bc3b618ea90f3a2b7dcdbd269c23c049f4ded0e.1536969438.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1536969438.git.matvore@google.com","subject":"[PATCH v1 2/2] t/*: fix ordering of expected/observed arguments","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-15T00:02:36Z","receivedAt":"2018-09-15T00:03:13Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"This fixes various places where the ordering was obviously wrong and it\nwas either related to other patches in this patchset or was easy\nfind with grep.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/t0000-basic.sh                       |  2 +-\n t/t0021-conversion.sh                  |  4 +--\n t/t1300-config.sh                      |  4 +--\n t/t1303-wacky-config.sh                |  4 +--\n t/t2101-update-index-reupdate.sh       |  2 +-\n t/t3200-branch.sh                      |  2 +-\n t/t3320-notes-merge-worktrees.sh       |  4 +--\n t/t3400-rebase.sh                      |  8 +++---\n t/t3417-rebase-whitespace-fix.sh       |  6 ++---\n t/t3702-add-edit.sh                    |  4 +--\n t/t3903-stash.sh                       |  8 +++---\n t/t3905-stash-include-untracked.sh     |  2 +-\n t/t4025-hunk-header.sh                 |  2 +-\n t/t4117-apply-reject.sh                |  6 ++---\n t/t4124-apply-ws-rule.sh               | 30 +++++++++++------------\n t/t4138-apply-ws-expansion.sh          |  2 +-\n t/t5317-pack-objects-filter-objects.sh | 34 +++++++++++++-------------\n t/t5318-commit-graph.sh                |  2 +-\n t/t5701-git-serve.sh                   | 14 +++++------\n t/t5702-protocol-v2.sh                 | 10 ++++----\n t/t6023-merge-file.sh                  | 12 ++++-----\n t/t6027-merge-binary.sh                |  4 +--\n t/t6031-merge-filemode.sh              |  2 +-\n t/t6112-rev-list-filters-objects.sh    | 24 +++++++++---------\n t/t7201-co.sh                          |  4 +--\n t/t7406-submodule-update.sh            |  8 +++---\n t/t7508-status.sh                      |  2 +-\n t/t7800-difftool.sh                    |  2 +-\n t/t9100-git-svn-basic.sh               |  2 +-\n t/t9133-git-svn-nested-git-repo.sh     |  6 ++---\n t/t9600-cvsimport.sh                   |  2 +-\n t/t9603-cvsimport-patchsets.sh         |  4 +--\n t/t9604-cvsimport-timestamps.sh        |  4 +--\n 33 files changed, 113 insertions(+), 113 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex 850f651e4..224c098a8 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -1018,7 +1018,7 @@ test_expect_success SHA1 'validate git diff-files output for a know cache/work t\n :120000 120000 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c 0000000000000000000000000000000000000000 M\tpath3/subp3/file3sym\n EOF\n \tgit diff-files >current &&\n-\ttest_cmp current expected\n+\ttest_cmp expected current\n '\n \n test_expect_success 'git update-index --refresh should succeed' '\ndiff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh\nindex 308cd28f3..fd5f1ac64 100755\n--- a/t/t0021-conversion.sh\n+++ b/t/t0021-conversion.sh\n@@ -166,10 +166,10 @@ test_expect_success expanded_in_repo '\n \trm -f expanded-keywords expanded-keywords-crlf &&\n \n \tgit checkout -- expanded-keywords &&\n-\ttest_cmp expanded-keywords expected-output &&\n+\ttest_cmp expected-output expanded-keywords &&\n \n \tgit checkout -- expanded-keywords-crlf &&\n-\ttest_cmp expanded-keywords-crlf expected-output-crlf\n+\ttest_cmp expected-output-crlf expanded-keywords-crlf\n '\n \n # The use of %f in a filter definition is expanded to the path to\ndiff --git a/t/t1300-config.sh b/t/t1300-config.sh\nindex 5869d6cb6..e2cd50ecf 100755\n--- a/t/t1300-config.sh\n+++ b/t/t1300-config.sh\n@@ -1001,7 +1001,7 @@ EOF\n \n test_expect_success 'value continued on next line' '\n \tgit config --list > result &&\n-\ttest_cmp result expect\n+\ttest_cmp expect result\n '\n \n cat > .git/config <<\\EOF\n@@ -1882,7 +1882,7 @@ test_expect_success '--replace-all does not invent newlines' '\n \tQkey = b\n \tEOF\n \tgit config --replace-all abc.key b &&\n-\ttest_cmp .git/config expect\n+\ttest_cmp expect .git/config\n '\n \n test_done\ndiff --git a/t/t1303-wacky-config.sh b/t/t1303-wacky-config.sh\nindex 3b92083e1..0000e664e 100755\n--- a/t/t1303-wacky-config.sh\n+++ b/t/t1303-wacky-config.sh\n@@ -14,7 +14,7 @@ setup() {\n check() {\n \techo \"$2\" >expected\n \tgit config --get \"$1\" >actual 2>&1\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n }\n \n # 'check section.key regex value' verifies that the entry for\n@@ -22,7 +22,7 @@ check() {\n check_regex() {\n \techo \"$3\" >expected\n \tgit config --get \"$1\" \"$2\" >actual 2>&1\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n }\n \n test_expect_success 'modify same key' '\ndiff --git a/t/t2101-update-index-reupdate.sh b/t/t2101-update-index-reupdate.sh\nindex 685ec4563..6c32d42c8 100755\n--- a/t/t2101-update-index-reupdate.sh\n+++ b/t/t2101-update-index-reupdate.sh\n@@ -73,7 +73,7 @@ test_expect_success 'update-index --update from subdir' '\n \t100644 $(git hash-object dir1/file3) 0\tdir1/file3\n \t100644 $file2 0\tfile2\n \tEOF\n-\ttest_cmp current expected\n+\ttest_cmp expected current\n '\n \n test_expect_success 'update-index --update with pathspec' '\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex 93f21ab07..478b82cf9 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -1221,7 +1221,7 @@ test_expect_success 'use --edit-description' '\n \tEOF\n \tEDITOR=./editor git branch --edit-description &&\n \techo \"New contents\" >expect &&\n-\ttest_cmp EDITOR_OUTPUT expect\n+\ttest_cmp expect EDITOR_OUTPUT\n '\n \n test_expect_success 'detect typo in branch name when using --edit-description' '\ndiff --git a/t/t3320-notes-merge-worktrees.sh b/t/t3320-notes-merge-worktrees.sh\nindex 10bfc8b94..823fdbda1 100755\n--- a/t/t3320-notes-merge-worktrees.sh\n+++ b/t/t3320-notes-merge-worktrees.sh\n@@ -44,7 +44,7 @@ test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '\n \tgit config core.notesRef refs/notes/y &&\n \ttest_must_fail git notes merge z &&\n \techo \"ref: refs/notes/y\" >expect &&\n-\ttest_cmp .git/NOTES_MERGE_REF expect\n+\ttest_cmp expect .git/NOTES_MERGE_REF\n '\n \n test_expect_success 'merge z into y while mid-merge in another workdir fails' '\n@@ -66,7 +66,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '\n \t\tgrep -v \"A notes merge into refs/notes/x is already in-progress in\" out\n \t) &&\n \techo \"ref: refs/notes/x\" >expect &&\n-\ttest_cmp .git/worktrees/worktree2/NOTES_MERGE_REF expect\n+\ttest_cmp expect .git/worktrees/worktree2/NOTES_MERGE_REF\n '\n \n test_done\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 3996ee013..3e73f7584 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -183,13 +183,13 @@ test_expect_success 'cherry-picked commits and fork-point work together' '\n \ttest_commit final_B B \"Final B\" &&\n \tgit rebase &&\n \techo Amended >expect &&\n-\ttest_cmp A expect &&\n+\ttest_cmp expect A &&\n \techo \"Final B\" >expect &&\n-\ttest_cmp B expect &&\n+\ttest_cmp expect B &&\n \techo C >expect &&\n-\ttest_cmp C expect &&\n+\ttest_cmp expect C &&\n \techo D >expect &&\n-\ttest_cmp D expect\n+\ttest_cmp expect D\n '\n \n test_expect_success 'rebase -q is quiet' '\ndiff --git a/t/t3417-rebase-whitespace-fix.sh b/t/t3417-rebase-whitespace-fix.sh\nindex 1fb3e499b..e85cdc703 100755\n--- a/t/t3417-rebase-whitespace-fix.sh\n+++ b/t/t3417-rebase-whitespace-fix.sh\n@@ -55,7 +55,7 @@ test_expect_success 'blank line at end of file; extend at end of file' '\n \tgit add file &&\tgit commit -m second &&\n \tgit rebase --whitespace=fix HEAD^^ &&\n \tgit diff --exit-code HEAD^:file expect-first &&\n-\ttest_cmp file expect-second\n+\ttest_cmp expect-second file\n '\n \n # prepare third revision of \"file\"\n@@ -82,7 +82,7 @@ test_expect_success 'two blanks line at end of file; extend at end of file' '\n \tcp third file && git add file && git commit -m third &&\n \tgit rebase --whitespace=fix HEAD^^ &&\n \tgit diff --exit-code HEAD^:file expect-second &&\n-\ttest_cmp file expect-third\n+\ttest_cmp expect-third file\n '\n \n test_expect_success 'same, but do not remove trailing spaces' '\n@@ -120,7 +120,7 @@ test_expect_success 'at beginning of file' '\n \tdone >> file &&\n \tgit commit -m more file\t&&\n \tgit rebase --whitespace=fix HEAD^^ &&\n-\ttest_cmp file expect-beginning\n+\ttest_cmp expect-beginning file\n '\n \n test_done\ndiff --git a/t/t3702-add-edit.sh b/t/t3702-add-edit.sh\nindex c6af7f82b..6c676645d 100755\n--- a/t/t3702-add-edit.sh\n+++ b/t/t3702-add-edit.sh\n@@ -110,10 +110,10 @@ test_expect_success 'add -e' '\n \tcp second-part file &&\n \tgit add -e &&\n \ttest_cmp second-part file &&\n-\ttest_cmp orig-patch expected-patch &&\n+\ttest_cmp expected-patch orig-patch &&\n \tgit diff --cached >actual &&\n \tgrep -v index actual >out &&\n-\ttest_cmp out expected\n+\ttest_cmp expected out\n \n '\n \ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 6450bc669..cd216655b 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -36,7 +36,7 @@ EOF\n test_expect_success 'parents of stash' '\n \ttest $(git rev-parse stash^) = $(git rev-parse HEAD) &&\n \tgit diff stash^2..stash > output &&\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n '\n \n test_expect_success 'applying bogus stash does nothing' '\n@@ -210,9 +210,9 @@ test_expect_success 'stash branch' '\n \ttest refs/heads/stashbranch = $(git symbolic-ref HEAD) &&\n \ttest $(git rev-parse HEAD) = $(git rev-parse master^) &&\n \tgit diff --cached > output &&\n-\ttest_cmp output expect &&\n+\ttest_cmp expect output &&\n \tgit diff > output &&\n-\ttest_cmp output expect1 &&\n+\ttest_cmp expect1 output &&\n \tgit add file &&\n \tgit commit -m alternate\\ second &&\n \tgit diff master..stashbranch > output &&\n@@ -710,7 +710,7 @@ test_expect_success 'stash where working directory contains \"HEAD\" file' '\n \tgit diff-index --cached --quiet HEAD &&\n \ttest \"$(git rev-parse stash^)\" = \"$(git rev-parse HEAD)\" &&\n \tgit diff stash^..stash > output &&\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n '\n \n test_expect_success 'store called with invalid commit' '\ndiff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh\nindex 597b0637d..cc1c8a7bb 100755\n--- a/t/t3905-stash-include-untracked.sh\n+++ b/t/t3905-stash-include-untracked.sh\n@@ -142,7 +142,7 @@ test_expect_success 'stash save --include-untracked removed files' '\n \trm -f file &&\n \tgit stash save --include-untracked &&\n \techo 1 > expect &&\n-\ttest_cmp file expect\n+\ttest_cmp expect file\n '\n \n rm -f expect\ndiff --git a/t/t4025-hunk-header.sh b/t/t4025-hunk-header.sh\nindex fa44e7886..35578f2bb 100755\n--- a/t/t4025-hunk-header.sh\n+++ b/t/t4025-hunk-header.sh\n@@ -37,7 +37,7 @@ test_expect_success 'hunk header truncation with an overly long line' '\n \t\techo \" A $N$N$N$N$N$N$N$N$N2\" &&\n \t\techo \" L  $N$N$N$N$N$N$N$N$N1\"\n \t) >expected &&\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n \n '\n \ndiff --git a/t/t4117-apply-reject.sh b/t/t4117-apply-reject.sh\nindex d80187de9..f7de6f077 100755\n--- a/t/t4117-apply-reject.sh\n+++ b/t/t4117-apply-reject.sh\n@@ -72,7 +72,7 @@ test_expect_success 'apply with --reject should fail but update the file' '\n \trm -f file1.rej file2.rej &&\n \n \ttest_must_fail git apply --reject patch.1 &&\n-\ttest_cmp file1 expected &&\n+\ttest_cmp expected file1 &&\n \n \tcat file1.rej &&\n \ttest_path_is_missing file2.rej\n@@ -85,7 +85,7 @@ test_expect_success 'apply with --reject should fail but update the file' '\n \n \ttest_must_fail git apply --reject patch.2 >rejects &&\n \ttest_path_is_missing file1 &&\n-\ttest_cmp file2 expected &&\n+\ttest_cmp expected file2 &&\n \n \tcat file2.rej &&\n \ttest_path_is_missing file1.rej\n@@ -99,7 +99,7 @@ test_expect_success 'the same test with --verbose' '\n \n \ttest_must_fail git apply --reject --verbose patch.2 >rejects &&\n \ttest_path_is_missing file1 &&\n-\ttest_cmp file2 expected &&\n+\ttest_cmp expected file2 &&\n \n \tcat file2.rej &&\n \ttest_path_is_missing file1.rej\ndiff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh\nindex 7e32237a2..ff51e9e78 100755\n--- a/t/t4124-apply-ws-rule.sh\n+++ b/t/t4124-apply-ws-rule.sh\n@@ -313,9 +313,9 @@ test_expect_success 'applying beyond EOF requires one non-blank context line' '\n \t{ echo a; echo; } >one &&\n \tcp one expect &&\n \ttest_must_fail git apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \ttest_must_fail git apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'tons of blanks at EOF should not apply' '\n@@ -342,10 +342,10 @@ test_expect_success 'missing blank line at end with --whitespace=fix' '\n \tcp one saved-one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv saved-one one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'two missing blank lines at end with --whitespace=fix' '\n@@ -360,11 +360,11 @@ test_expect_success 'two missing blank lines at end with --whitespace=fix' '\n \tcp no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'missing blank line at end, insert before end, --whitespace=fix' '\n@@ -376,7 +376,7 @@ test_expect_success 'missing blank line at end, insert before end, --whitespace=\n \techo a >one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'shrink file with tons of missing blanks at end of file' '\n@@ -392,10 +392,10 @@ test_expect_success 'shrink file with tons of missing blanks at end of file' '\n \tcp no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv no-blank-lines one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'missing blanks at EOF must only match blank lines' '\n@@ -427,7 +427,7 @@ test_expect_success 'missing blank line should match context line with spaces' '\n \tgit add one &&\n \n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n sed -e's/Z//' >one <<EOF\n@@ -447,7 +447,7 @@ test_expect_success 'same, but with the --ignore-space-option' '\n \n \tgit checkout-index -f one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '\n@@ -464,7 +464,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '\n \tmv save-one one &&\n \n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'CR-LF line endings && add line && text=auto' '\n@@ -478,7 +478,7 @@ test_expect_success 'CR-LF line endings && add line && text=auto' '\n \tmv save-one one &&\n \techo \"one text=auto\" >.gitattributes &&\n \tgit apply patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'CR-LF line endings && change line && text=auto' '\n@@ -491,7 +491,7 @@ test_expect_success 'CR-LF line endings && change line && text=auto' '\n \tmv save-one one &&\n \techo \"one text=auto\" >.gitattributes &&\n \tgit apply patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'LF in repo, CRLF in worktree && change line && text=auto' '\n@@ -503,7 +503,7 @@ test_expect_success 'LF in repo, CRLF in worktree && change line && text=auto' '\n \techo \"one text=auto\" >.gitattributes &&\n \tgit -c core.eol=CRLF apply patch &&\n \tprintf \"b\\r\\n\" >expect &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'whitespace=fix to expand' '\ndiff --git a/t/t4138-apply-ws-expansion.sh b/t/t4138-apply-ws-expansion.sh\nindex 0ffe33fbe..3b636a63a 100755\n--- a/t/t4138-apply-ws-expansion.sh\n+++ b/t/t4138-apply-ws-expansion.sh\n@@ -114,7 +114,7 @@ for t in 1 2 3 4\n do\n \ttest_expect_success 'apply with ws expansion (t=$t)' '\n \t\tgit apply patch$t.patch &&\n-\t\ttest_cmp test-$t expect-$t\n+\t\ttest_cmp expect-$t test-$t\n \t'\n done\n \ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex ce69148ec..c093eb891 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -34,7 +34,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:none packfile has no blobs' '\n@@ -63,7 +63,7 @@ test_expect_success 'verify normal and blob:none packfiles have same commits/tre\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test blob:limit=<n>[kmg] filter.\n@@ -96,7 +96,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=500 omits all blobs' '\n@@ -144,7 +144,7 @@ test_expect_success 'verify blob:limit=1001' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=10001' '\n@@ -162,7 +162,7 @@ test_expect_success 'verify blob:limit=10001' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1k' '\n@@ -180,7 +180,7 @@ test_expect_success 'verify blob:limit=1k' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify explicitly specifying oversized blob in input' '\n@@ -199,7 +199,7 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1m' '\n@@ -217,7 +217,7 @@ test_expect_success 'verify blob:limit=1m' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '\n@@ -231,7 +231,7 @@ test_expect_success 'verify normal and blob:limit packfiles have same commits/tr\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:path=<path> filter.\n@@ -269,7 +269,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern1' '\n@@ -287,7 +287,7 @@ test_expect_success 'verify sparse:path=pattern1' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '\n@@ -301,7 +301,7 @@ test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern2' '\n@@ -319,7 +319,7 @@ test_expect_success 'verify sparse:path=pattern2' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '\n@@ -333,7 +333,7 @@ test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:oid=<oid-ish> filter.\n@@ -370,7 +370,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=OID' '\n@@ -389,7 +389,7 @@ test_expect_success 'verify sparse:oid=OID' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=oid-ish' '\n@@ -407,7 +407,7 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Delete some loose objects and use pack-objects, but WITHOUT any filtering.\ndiff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh\nindex 0c500f7ca..d6da3ce4e 100755\n--- a/t/t5318-commit-graph.sh\n+++ b/t/t5318-commit-graph.sh\n@@ -35,7 +35,7 @@ test_expect_success 'create commits and repack' '\n graph_git_two_modes() {\n \tgit -c core.commitGraph=true $1 >output\n \tgit -c core.commitGraph=false $1 >expect\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n }\n \n graph_git_behavior() {\ndiff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh\nindex 75ec79e6c..bf139e245 100755\n--- a/t/t5701-git-serve.sh\n+++ b/t/t5701-git-serve.sh\n@@ -16,7 +16,7 @@ test_expect_success 'test capability advertisement' '\n \n \tgit serve --advertise-capabilities >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'stateless-rpc flag does not list capabilities' '\n@@ -89,7 +89,7 @@ test_expect_success 'basics of ls-refs' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'basic ref-prefixes' '\n@@ -109,7 +109,7 @@ test_expect_success 'basic ref-prefixes' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'refs/heads prefix' '\n@@ -129,7 +129,7 @@ test_expect_success 'refs/heads prefix' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'peel parameter' '\n@@ -150,7 +150,7 @@ test_expect_success 'peel parameter' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'symrefs parameter' '\n@@ -171,7 +171,7 @@ test_expect_success 'symrefs parameter' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'sending server-options' '\n@@ -191,7 +191,7 @@ test_expect_success 'sending server-options' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'unexpected lines are not allowed in fetch request' '\ndiff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh\nindex 3beeed454..54727450b 100755\n--- a/t/t5702-protocol-v2.sh\n+++ b/t/t5702-protocol-v2.sh\n@@ -29,7 +29,7 @@ test_expect_success 'list refs with git:// using protocol v2' '\n \tgrep \"git< version 2\" log &&\n \n \tgit ls-remote --symref \"$GIT_DAEMON_URL/parent\" >expect &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'ref advertisment is filtered with ls-remote using protocol v2' '\n@@ -42,7 +42,7 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol\n \t$(git -C \"$daemon_parent\" rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'clone with git:// using protocol v2' '\n@@ -138,7 +138,7 @@ test_expect_success 'list refs with file:// using protocol v2' '\n \tgrep \"git< version 2\" log &&\n \n \tgit ls-remote --symref \"file://$(pwd)/file_parent\" >expect &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'ref advertisment is filtered with ls-remote using protocol v2' '\n@@ -151,7 +151,7 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol\n \t$(git -C file_parent rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'server-options are sent when using ls-remote' '\n@@ -164,7 +164,7 @@ test_expect_success 'server-options are sent when using ls-remote' '\n \t$(git -C file_parent rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect &&\n+\ttest_cmp expect actual &&\n \tgrep \"server-option=hello\" log &&\n \tgrep \"server-option=world\" log\n '\ndiff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh\nindex 20aee43f9..51ee887a7 100755\n--- a/t/t6023-merge-file.sh\n+++ b/t/t6023-merge-file.sh\n@@ -99,7 +99,7 @@ EOF\n printf \"propter nomen suum.\" >> expect.txt\n \n test_expect_success \"merge does not add LF away of change\" \\\n-\t\"test_cmp test3.txt expect.txt\"\n+\t\"test_cmp expect.txt test3.txt\"\n \n cp test.txt backup.txt\n test_expect_success \"merge with conflicts\" \\\n@@ -122,7 +122,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n \n-test_expect_success \"expected conflict markers\" \"test_cmp test.txt expect.txt\"\n+test_expect_success \"expected conflict markers\" \"test_cmp expect.txt test.txt\"\n \n cp backup.txt test.txt\n \n@@ -138,7 +138,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --ours\" \\\n-\t\"git merge-file --ours test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --ours test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n cat > expect.txt << EOF\n@@ -154,7 +154,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --theirs\" \\\n-\t\"git merge-file --theirs test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --theirs test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n cat > expect.txt << EOF\n@@ -171,7 +171,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --union\" \\\n-\t\"git merge-file --union test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --union test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n test_expect_success \"merge with conflicts, using -L\" \\\n@@ -195,7 +195,7 @@ virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n \n test_expect_success \"expected conflict markers, with -L\" \\\n-\t\"test_cmp test.txt expect.txt\"\n+\t\"test_cmp expect.txt test.txt\"\n \n sed \"s/ tu / TU /\" < new1.txt > new5.txt\n test_expect_success \"conflict in removed tail\" \\\ndiff --git a/t/t6027-merge-binary.sh b/t/t6027-merge-binary.sh\nindex 07735410b..4e6c7cb77 100755\n--- a/t/t6027-merge-binary.sh\n+++ b/t/t6027-merge-binary.sh\n@@ -45,7 +45,7 @@ test_expect_success resolve '\n \t\tfalse\n \telse\n \t\tgit ls-files -s >current\n-\t\ttest_cmp current expect\n+\t\ttest_cmp expect current\n \tfi\n '\n \n@@ -60,7 +60,7 @@ test_expect_success recursive '\n \t\tfalse\n \telse\n \t\tgit ls-files -s >current\n-\t\ttest_cmp current expect\n+\t\ttest_cmp expect current\n \tfi\n '\n \ndiff --git a/t/t6031-merge-filemode.sh b/t/t6031-merge-filemode.sh\nindex 7d06461f1..87741efad 100755\n--- a/t/t6031-merge-filemode.sh\n+++ b/t/t6031-merge-filemode.sh\n@@ -61,7 +61,7 @@ do_both_modes () {\n \t\tgit checkout -f a2 &&\n \t\ttest_must_fail git merge -s $strategy b2 &&\n \t\tgit ls-files -u >actual &&\n-\t\ttest_cmp actual expect &&\n+\t\ttest_cmp expect actual &&\n \t\tgit ls-files -s file2 | grep ^100755\n \t'\n \ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex 0f6b569e1..ae4402226 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -29,7 +29,7 @@ test_expect_success 'verify blob:none omits all 5 blobs' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n@@ -42,7 +42,7 @@ test_expect_success 'verify emitted+omitted == all' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n \n@@ -71,7 +71,7 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n@@ -84,7 +84,7 @@ test_expect_success 'verify emitted+omitted == all' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1000' '\n@@ -97,7 +97,7 @@ test_expect_success 'verify blob:limit=1000' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1001' '\n@@ -110,7 +110,7 @@ test_expect_success 'verify blob:limit=1001' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1k' '\n@@ -123,7 +123,7 @@ test_expect_success 'verify blob:limit=1k' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1m' '\n@@ -165,7 +165,7 @@ test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n@@ -178,7 +178,7 @@ test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:oid=<oid-ish> filter.\n@@ -203,7 +203,7 @@ test_expect_success 'verify sparse:oid=OID omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n@@ -216,7 +216,7 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Delete some loose objects and use rev-list, but WITHOUT any filtering.\n@@ -237,7 +237,7 @@ test_expect_success 'rev-list W/ --missing=print' '\n \tsed \"s/?//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'rev-list W/O --missing fails' '\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 324933acf..826987ca8 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -160,7 +160,7 @@ test_expect_success 'checkout -m with merge conflict' '\n \tgit diff master:one :3:uno |\n \tsed -e \"1,/^@@/d\" -e \"/^ /d\" -e \"s/^-/d/\" -e \"s/^+/a/\" >current &&\n \tfill d2 aT d7 aS >expect &&\n-\ttest_cmp current expect &&\n+\ttest_cmp expect current &&\n \tgit diff --cached two >current &&\n \ttest_must_be_empty current\n '\n@@ -174,7 +174,7 @@ test_expect_success 'format of merge conflict from checkout -m' '\n \n \tgit ls-files >current &&\n \tfill same two two two >expect &&\n-\ttest_cmp current expect &&\n+\ttest_cmp expect current &&\n \n \tcat <<-EOF >expect &&\n \t<<<<<<< simple\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex 10dc91620..e87164aa8 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -789,7 +789,7 @@ test_expect_success 'submodule add places git-dir in superprojects git-dir' '\n \t (cd .git/modules/deeper/submodule &&\n \t  git log > ../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -807,7 +807,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir' '\n \t (cd .git/modules/deeper/submodule &&\n \t  git log > ../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -827,7 +827,7 @@ test_expect_success 'submodule add places git-dir in superprojects git-dir recur\n \t git add deeper/submodule &&\n \t git commit -m \"update submodule\" &&\n \t git push origin : &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -874,7 +874,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re\n \t (cd .git/modules/submodule/modules/subsubmodule &&\n \t  git log > ../../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex e1f11293e..799af225b 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1620,7 +1620,7 @@ test_expect_success 'show stash info with \"--show-stash\"' '\n \n test_expect_success 'no stash info with \"--show-stash --no-show-stash\"' '\n \tgit status --show-stash --no-show-stash >expected_without_stash &&\n-\ttest_cmp expected_default expected_without_stash\n+\ttest_cmp expected_without_stash expected_default\n '\n \n test_expect_success '\"status.showStash=false\" weaker than \"--show-stash\"' '\ndiff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\nindex 668bbee73..562bd215a 100755\n--- a/t/t7800-difftool.sh\n+++ b/t/t7800-difftool.sh\n@@ -557,7 +557,7 @@ test_expect_success SYMLINKS 'difftool --dir-diff --symlink without unstaged cha\n \tEOF\n \tgit difftool --dir-diff --symlink \\\n \t\t--extcmd \"./.git/CHECK_SYMLINKS\" branch HEAD &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n write_script modify-right-file <<\\EOF\ndiff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh\nindex 9af607884..2c309a57d 100755\n--- a/t/t9100-git-svn-basic.sh\n+++ b/t/t9100-git-svn-basic.sh\n@@ -221,7 +221,7 @@ tree d667270a1f7b109f5eb3aaea21ede14b56bfdd6e\n tree 8f51f74cf0163afc9ad68a4b1537288c4558b5a4\n EOF\n \n-test_expect_success POSIXPERM,SYMLINKS \"$name\" \"test_cmp a expected\"\n+test_expect_success POSIXPERM,SYMLINKS \"$name\" \"test_cmp expected a\"\n \n test_expect_success 'exit if remote refs are ambigious' '\n         git config --add svn-remote.svn.fetch \\\ndiff --git a/t/t9133-git-svn-nested-git-repo.sh b/t/t9133-git-svn-nested-git-repo.sh\nindex f3c30e63b..f89486086 100755\n--- a/t/t9133-git-svn-nested-git-repo.sh\n+++ b/t/t9133-git-svn-nested-git-repo.sh\n@@ -45,7 +45,7 @@ test_expect_success 'update git svn-cloned repo' '\n \t\tgit svn rebase &&\n \t\techo a > expect &&\n \t\techo b >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\n@@ -69,7 +69,7 @@ test_expect_success 'update git svn-cloned repo' '\n \t\tgit svn rebase &&\n \t\techo a > expect &&\n \t\techo b >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\n@@ -93,7 +93,7 @@ test_expect_success 'update git svn-cloned repo again' '\n \t\techo a > expect &&\n \t\techo b >> expect &&\n \t\techo c >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\ndiff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh\nindex 5dfee07d9..251fdd66c 100755\n--- a/t/t9600-cvsimport.sh\n+++ b/t/t9600-cvsimport.sh\n@@ -148,7 +148,7 @@ test_expect_success PERL 'import from a CVS working tree' '\n \t\tgit cvsimport -a -z0 &&\n \t\techo 1 >expect &&\n \t\tgit log -1 --pretty=format:%s%n >actual &&\n-\t\ttest_cmp actual expect\n+\t\ttest_cmp expect actual\n \t)\n \n '\ndiff --git a/t/t9603-cvsimport-patchsets.sh b/t/t9603-cvsimport-patchsets.sh\nindex c4c3c4954..3e64b11ea 100755\n--- a/t/t9603-cvsimport-patchsets.sh\n+++ b/t/t9603-cvsimport-patchsets.sh\n@@ -29,11 +29,11 @@ test_expect_failure PERL 'import with criss cross times on revisions' '\n Rev 3\n Rev 2\n Rev 1\" > expect-master &&\n-    test_cmp actual-master expect-master &&\n+    test_cmp expect-master actual-master &&\n \n     echo \"Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000\n Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000\" > expect-A &&\n-    test_cmp actual-A expect-A\n+    test_cmp expect-A actual-A\n '\n \n test_done\ndiff --git a/t/t9604-cvsimport-timestamps.sh b/t/t9604-cvsimport-timestamps.sh\nindex a4b3db24b..2ff4aa932 100755\n--- a/t/t9604-cvsimport-timestamps.sh\n+++ b/t/t9604-cvsimport-timestamps.sh\n@@ -31,7 +31,7 @@ test_expect_success PERL 'check timestamps are UTC (TZ=CST6CDT)' '\n \tRev  2 2005-02-01 00:00:00 +0000\n \tRev  1 2005-01-01 00:00:00 +0000\n \tEOF\n-\ttest_cmp actual-1 expect-1\n+\ttest_cmp expect-1 actual-1\n '\n \n test_expect_success PERL 'check timestamps with author-specific timezones' '\n@@ -65,7 +65,7 @@ test_expect_success PERL 'check timestamps with author-specific timezones' '\n \tRev  2 2005-01-31 18:00:00 -0600 User Two\n \tRev  1 2005-01-01 00:00:00 +0000 User One\n \tEOF\n-\ttest_cmp actual-2 expect-2\n+\ttest_cmp expect-2 actual-2\n '\n \n test_done\n-- \n2.19.0.397.gdd90340f6a-goog\n\n"},{"id":"358188","messageId":"xmqqlg82ah7a.fsf@gitster-ct.c.googlers.com","threadId":"49352","inReplyTo":"cover.1536969438.git.matvore@google.com","subject":"Re: [PATCH v1 0/2] Cleanup tests for test_cmp argument ordering and \"|\" placement","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-09-15T15:55:21Z","receivedAt":"2018-09-15T15:55:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthew DeVore <matvore@google.com> writes:\n\n> As requested in:\n>  https://public-inbox.org/git/xmqqmuskas3a.fsf@gitster-ct.c.googlers.com/\n> this patchset corrects ordering of test_cmp arguments and | placement.\n>\n> The request didn't explicitly state whether all the tests should be cleaned up,\n> but I did clean up as much as I reasonably could.\n\nI was only suggesting a clean-up of the test scripts you are going\nto touch anyway in your series, and not the ones outside that\noriginal scope.  Your going above and beyond what is necessary to\nmake sure your primary changes will be protected against future\nbreakage is surely appreciated but it would of course require more\nreview resources ;-).\n\n"},{"id":"358252","messageId":"CAMfpvhKEdtNUMnTa+Su55FLj30hmnr+KrxBtYAVjSuY1pX-Bpw@mail.gmail.com","threadId":"49352","inReplyTo":"7bc3b618ea90f3a2b7dcdbd269c23c049f4ded0e.1536969438.git.matvore@google.com","subject":"Re: [PATCH v1 2/2] t/*: fix ordering of expected/observed arguments","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-17T12:56:44Z","receivedAt":"2018-09-17T12:57:08Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Fri, Sep 14, 2018 at 5:03 PM Matthew DeVore <matvore@google.com> wrote:\n>\n> This fixes various places where the ordering was obviously wrong and it\n> was either related to other patches in this patchset or was easy\n> find with grep.\n>\n> Signed-off-by: Matthew DeVore <matvore@google.com>\n> ---\nThe clause about \"related to other patches in this patchset is wrong,\nso I've reworded the commit message body:\n\n    Fix various places where the ordering was obviously wrong, meaning it\n    was easy to find with grep.\n\n> --- a/t/t7508-status.sh\n> +++ b/t/t7508-status.sh\n> @@ -1620,7 +1620,7 @@ test_expect_success 'show stash info with \"--show-stash\"' '\n>\n>  test_expect_success 'no stash info with \"--show-stash --no-show-stash\"' '\n>         git status --show-stash --no-show-stash >expected_without_stash &&\n> -       test_cmp expected_default expected_without_stash\n> +       test_cmp expected_without_stash expected_default\n>  '\nThis line should not have been changed, so I've reverted it.\n"},{"id":"358288","messageId":"20180917163137.GB89942@aiede.svl.corp.google.com","threadId":"49352","inReplyTo":"a4c833da81d83ea0e605c936d90ea9c7f5667d93.1536969438.git.matvore@google.com","subject":"Re: [PATCH v1 1/2] t/*: fix pipe placement and remove \\'s","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2018-09-17T16:31:37Z","receivedAt":"2018-09-17T16:31:42Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Matthew DeVore wrote:\n\n> Subject: t/*: fix pipe placement and remove \\'s\n>\n> Where ever there was code in the tests like this:\n>\n> \tfoo \\\n> \t\t| bar\n\nLanguage nits:\n- s/Where ever/Wherever/\n- Git's commit messages use the present tense to describe the existing\n  previous state of the codebase, as though reporting a bug.\n\nMaybe something like\n\n\ttests: standardize pipe placement\n\n\tInstead of using a line-continuation and pipe on the second\n\tline, take advantage of the shell's implicit line continuation\n\tafter a pipe character.  So for example, instead of\n\n\t\tsome long line \\\n\t\t\t| next line\n\n\tuse\n\n\t\tsome long line |\n\t\tnext line\n\nAt this point, it would be useful to say something about rationale ---\nfor example,\n\n\tThis better matches the coding style documented in\n\tDocumentation/CodingGuidelines and used in shell scripts\n\telsewhere in Git.\n\nExcept: is this documented in Documentation/CodingGuidelines?  Or,\nbetter, is there a linter that we can run in the test-lint target of\nt/Makefile to ensure we keep sticking to this style?\n\n[...]\n> --- a/t/lib-gpg.sh\n> +++ b/t/lib-gpg.sh\n> @@ -57,8 +57,8 @@ then\n>  \t\techo | gpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null \\\n>  \t\t\t--passphrase-fd 0 --pinentry-mode loopback \\\n>  \t\t\t--import \"$TEST_DIRECTORY\"/lib-gpg/gpgsm_cert.p12 &&\n> -\t\tgpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null -K \\\n> -\t\t\t| grep fingerprint: | cut -d\" \" -f4 | tr -d '\\n' > \\\n> +\t\tgpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null -K |\n> +\t\tgrep fingerprint: | cut -d\" \" -f4 | tr -d '\\n' > \\\n>  \t\t\t${GNUPGHOME}/trustlist.txt &&\n\nI think this would be more readable with one item from the pipeline\nper line:\n\n\t\tgpgsm --homedir ... |\n\t\tgrep ... |\n\t\tcut ... |\n\t\ttr ... >... &&\n\n[...]\n> --- a/t/t1006-cat-file.sh\n> +++ b/t/t1006-cat-file.sh\n> @@ -218,8 +218,8 @@ test_expect_success \"--batch-check for a non-existent hash\" '\n>      test \"0000000000000000000000000000000000000042 missing\n>  0000000000000000000000000000000000000084 missing\" = \\\n>      \"$( ( echo 0000000000000000000000000000000000000042;\n> -         echo_without_newline 0000000000000000000000000000000000000084; ) \\\n> -       | git cat-file --batch-check)\"\n> +         echo_without_newline 0000000000000000000000000000000000000084; ) |\n> +       git cat-file --batch-check)\"\n\nThis test is problematic in a lot of ways.  Most importantly, it ignores\nthe exist status from git cat-file.\n\nSo it should say something like:\n\n\tcat >expect <<-\\EOF &&\n\t\tfoobar42 missing\n\t\tfoobar84 missing\n\tEOF\n\tprintf \"foobar42\\nfoobar84\" |\n\tgit cat-file --batch-check >actual &&\n\ttest_cmp expect actual\n\nIf we want to restrict to the pipeline style fixes, we could do\n\n\ttest \"...\" = \"$(\n\t\t{\t# Couldn't resist changing the ( to {!\n\t\t\techo ... &&\t# Couldn't resist changing the ; to &&!\n\t\t\techo_without_newline ...\n\t\t} |\n\t\tgit cat-file --batch-check\n\t)\"\n\nbut unless there's a linter that we're helping support, it's probably\nbetter to skip this file and use a dedicated patch to modernize its\nstyle more generally.\n\n[...]\n> --- a/t/t1300-config.sh\n> +++ b/t/t1300-config.sh\n> @@ -1770,8 +1770,9 @@ test_expect_success '--show-origin stdin with file include' '\n>  \tcat >expect <<-EOF &&\n>  \t\tfile:$INCLUDE_DIR/stdin.include\tinclude\n>  \tEOF\n> -\techo \"[include]path=\\\"$INCLUDE_DIR\\\"/stdin.include\" \\\n> -\t\t| git config --show-origin --includes --file - user.stdin >output &&\n> +\techo \"[include]path=\\\"$INCLUDE_DIR\\\"/stdin.include\" |\n> +\tgit config --show-origin --includes --file - user.stdin >output &&\n\nOkay.\n\n[...]\n> --- a/t/t5317-pack-objects-filter-objects.sh\n> +++ b/t/t5317-pack-objects-filter-objects.sh\n> @@ -20,17 +20,20 @@ test_expect_success 'setup r1' '\n>  '\n>  \n>  test_expect_success 'verify blob count in normal packfile' '\n> -\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n> -\t\t| awk -f print_2.awk \\\n> -\t\t| sort >expected &&\n> +\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n> +\tawk -f print_2.awk |\n> +\tsort >expected &&\n\nThis loses the exit status from git, so we should make it write to a\ntemporary file instead (as a separate patch).\n\n[...]\n> -\tgit -C r1 verify-pack -v ../all.pack \\\n> -\t\t| grep blob \\\n> -\t\t| awk -f print_1.awk \\\n> -\t\t| sort >observed &&\n> +\n> +\tgit -C r1 verify-pack -v ../all.pack |\n\nLikewise (and likewise for the rest in this file).\n\n[...]\n> --- a/t/t5500-fetch-pack.sh\n> +++ b/t/t5500-fetch-pack.sh\n> @@ -50,8 +50,9 @@ pull_to_client () {\n>  \t\t\tcase \"$heads\" in *B*)\n>  \t\t\t    git update-ref refs/heads/B \"$BTIP\";;\n>  \t\t\tesac &&\n> -\t\t\tgit symbolic-ref HEAD refs/heads/$(echo $heads \\\n> -\t\t\t\t| sed -e \"s/^\\(.\\).*$/\\1/\") &&\n> +\n> +\t\t\tgit symbolic-ref HEAD refs/heads/$(echo $heads |\n> +\t\t\tsed -e \"s/^\\(.\\).*$/\\1/\") &&\n\nIt would be better to use a temporary variable.  If we're just\nchanging line wrapping, then this would be\n\n\t\t\tgit symbolic-ref HAD refs/heads/$(\n\t\t\t\techo $heads |\n\t\t\t\tsed ...\n\t\t\t) &&\n\n[...]\n> --- a/t/t5616-partial-clone.sh\n> +++ b/t/t5616-partial-clone.sh\n> @@ -34,10 +34,12 @@ test_expect_success 'setup bare clone for server' '\n>  # confirm partial clone was registered in the local config.\n>  test_expect_success 'do partial clone 1' '\n>  \tgit clone --no-checkout --filter=blob:none \"file://$(pwd)/srv.bare\" pc1 &&\n> -\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print \\\n> -\t\t| awk -f print_1.awk \\\n> -\t\t| sed \"s/?//\" \\\n> -\t\t| sort >observed.oids &&\n> +\n> +\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print |\n\nAlso needs to write to a temporary to avoid losing the exist status\n(and likewise for the rest of this file).\n\n[...]\n> --- a/t/t6112-rev-list-filters-objects.sh\n> +++ b/t/t6112-rev-list-filters-objects.sh\n> @@ -20,24 +20,28 @@ test_expect_success 'setup r1' '\n>  '\n>  \n>  test_expect_success 'verify blob:none omits all 5 blobs' '\n> -\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n> -\t\t| awk -f print_2.awk \\\n> -\t\t| sort >expected &&\n> -\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none \\\n> -\t\t| awk -f print_1.awk \\\n> -\t\t| sed \"s/~//\" \\\n> -\t\t| sort >observed &&\n> +\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n> +\tawk -f print_2.awk |\n> +\tsort >expected &&\n\nLikewise.\n\n[...]\n> --- a/t/t9101-git-svn-props.sh\n> +++ b/t/t9101-git-svn-props.sh\n> @@ -193,8 +193,8 @@ test_expect_success 'test propget' \"\n>  \tgit svn propget svn:ignore . | cmp - prop.expect &&\n>  \tcd deeply &&\n>  \tgit svn propget svn:ignore . | cmp - ../prop.expect &&\n> -\tgit svn propget svn:entry:committed-rev nested/directory/.keep \\\n> -\t  | cmp - ../prop2.expect &&\n> +\tgit svn propget svn:entry:committed-rev nested/directory/.keep |\n> +\tcmp - ../prop2.expect &&\n\nLikewise.\n\nThanks and hope that helps,\nJonathan\n"},{"id":"358353","messageId":"CAMfpvhKTk0VJicAKO_ASxKMU99GXEAbZ7e5K35g8D3uM9tqv2g@mail.gmail.com","threadId":"49352","inReplyTo":"20180917163137.GB89942@aiede.svl.corp.google.com","subject":"Re: [PATCH v1 1/2] t/*: fix pipe placement and remove \\'s","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-17T21:47:12Z","receivedAt":"2018-09-17T21:47:27Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Mon, Sep 17, 2018 at 9:31 AM Jonathan Nieder <jrnieder@gmail.com> wrote:\n>\n> Matthew DeVore wrote:\n>\n> > Subject: t/*: fix pipe placement and remove \\'s\n> >\n> > Where ever there was code in the tests like this:\n> >\n> >       foo \\\n> >               | bar\n>\n> Language nits:\n> - s/Where ever/Wherever/\n> - Git's commit messages use the present tense to describe the existing\n>   previous state of the codebase, as though reporting a bug.\n>\n> Maybe something like\n>\n>         tests: standardize pipe placement\n>\n>         Instead of using a line-continuation and pipe on the second\n>         line, take advantage of the shell's implicit line continuation\n>         after a pipe character.  So for example, instead of\n>\n>                 some long line \\\n>                         | next line\n>\n>         use\n>\n>                 some long line |\n>                 next line\n>\n> At this point, it would be useful to say something about rationale ---\n> for example,\n>\n>         This better matches the coding style documented in\n>         Documentation/CodingGuidelines and used in shell scripts\n>         elsewhere in Git.\n>\nDone.\n\n> Except: is this documented in Documentation/CodingGuidelines?  Or,\n> better, is there a linter that we can run in the test-lint target of\n> t/Makefile to ensure we keep sticking to this style?\nIt's not documented there, so I've created a new commit at the start\nof this patchset which addresses that. I also added a commit which\nadds a lint test, but it uses a questionable heuristic in order to\navoid false positives (it's hard to distinguish graphs generated with\ngit log --oneline since they often have \"\\ [newline] [tab or spaces]\n|\"  ). Let me know if you think it looks promising. I'd be happy to\njust drop it.\n\n>\n> [...]\n> > --- a/t/lib-gpg.sh\n> > +++ b/t/lib-gpg.sh\n> > @@ -57,8 +57,8 @@ then\n> >               echo | gpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null \\\n> >                       --passphrase-fd 0 --pinentry-mode loopback \\\n> >                       --import \"$TEST_DIRECTORY\"/lib-gpg/gpgsm_cert.p12 &&\n> > -             gpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null -K \\\n> > -                     | grep fingerprint: | cut -d\" \" -f4 | tr -d '\\n' > \\\n> > +             gpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null -K |\n> > +             grep fingerprint: | cut -d\" \" -f4 | tr -d '\\n' > \\\n> >                       ${GNUPGHOME}/trustlist.txt &&\n>\n> I think this would be more readable with one item from the pipeline\n> per line:\n>\n>                 gpgsm --homedir ... |\n>                 grep ... |\n>                 cut ... |\n>                 tr ... >... &&\n>\nDone.\n\n> [...]\n> > --- a/t/t1006-cat-file.sh\n> > +++ b/t/t1006-cat-file.sh\n> > @@ -218,8 +218,8 @@ test_expect_success \"--batch-check for a non-existent hash\" '\n> >      test \"0000000000000000000000000000000000000042 missing\n> >  0000000000000000000000000000000000000084 missing\" = \\\n> >      \"$( ( echo 0000000000000000000000000000000000000042;\n> > -         echo_without_newline 0000000000000000000000000000000000000084; ) \\\n> > -       | git cat-file --batch-check)\"\n> > +         echo_without_newline 0000000000000000000000000000000000000084; ) |\n> > +       git cat-file --batch-check)\"\n>\n> This test is problematic in a lot of ways.  Most importantly, it ignores\n> the exist status from git cat-file.\n>\n[...]\n> but unless there's a linter that we're helping support, it's probably\n> better to skip this file and use a dedicated patch to modernize its\n> style more generally.\n\nYes, the cat-file.sh test is kind of funky, and I like the style of\nyour suggestions much better, but in this case I think that perfect is\nthe enemy of good. Fixing everything wrong with these lines would\nnecessitate fixing the surrounding couple of tests that also swallow\nup the exit code of git cat-file. This may in turn necessitate other\nfixes for consistency that may even spread to other files... I am\nbasing my argument here on what's in Documentation/CodingGuidelines,\nwhich indicates that minor stylistic nits that result in code churn\nare not recommended, and that we must be consistent with the\nsurrounding code. The surrounding code here looks for the most part\nlike:\n\n test \"asdf\" = $(echo \"asdf\" | git foo-bar)\n\nWhich I think is satisfactory in its own context. You asked me to fix\nother test files later on, which I did, since they didn't seem to have\nsuch a contrarian style, so the fixes were very localized, and I was\nalready editing many lines in those files already.\n\n>\n> [...]\n> > --- a/t/t5317-pack-objects-filter-objects.sh\n> > +++ b/t/t5317-pack-objects-filter-objects.sh\n> > @@ -20,17 +20,20 @@ test_expect_success 'setup r1' '\n> >  '\n> >\n> >  test_expect_success 'verify blob count in normal packfile' '\n> > -     git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n> > -             | awk -f print_2.awk \\\n> > -             | sort >expected &&\n> > +     git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n> > +     awk -f print_2.awk |\n> > +     sort >expected &&\n>\n> This loses the exit status from git, so we should make it write to a\n> temporary file instead (as a separate patch).\nFixed.\n\n>\n> [...]\n> > -     git -C r1 verify-pack -v ../all.pack \\\n> > -             | grep blob \\\n> > -             | awk -f print_1.awk \\\n> > -             | sort >observed &&\n> > +\n> > +     git -C r1 verify-pack -v ../all.pack |\n>\n> Likewise (and likewise for the rest in this file).\nFixed this file's exit code issues in a separate patch.\n\n>\n> [...]\n> > --- a/t/t5500-fetch-pack.sh\n> > +++ b/t/t5500-fetch-pack.sh\n> > @@ -50,8 +50,9 @@ pull_to_client () {\n> >                       case \"$heads\" in *B*)\n> >                           git update-ref refs/heads/B \"$BTIP\";;\n> >                       esac &&\n> > -                     git symbolic-ref HEAD refs/heads/$(echo $heads \\\n> > -                             | sed -e \"s/^\\(.\\).*$/\\1/\") &&\n> > +\n> > +                     git symbolic-ref HEAD refs/heads/$(echo $heads |\n> > +                     sed -e \"s/^\\(.\\).*$/\\1/\") &&\n>\n> It would be better to use a temporary variable.  If we're just\n> changing line wrapping, then this would be\n>\n>                         git symbolic-ref HAD refs/heads/$(\n>                                 echo $heads |\n>                                 sed ...\n>                         ) &&\n>\nFixed using your suggestion (only fixed the line wrapping)\n\n> [...]\n> > --- a/t/t5616-partial-clone.sh\n> > +++ b/t/t5616-partial-clone.sh\n> > @@ -34,10 +34,12 @@ test_expect_success 'setup bare clone for server' '\n> >  # confirm partial clone was registered in the local config.\n> >  test_expect_success 'do partial clone 1' '\n> >       git clone --no-checkout --filter=blob:none \"file://$(pwd)/srv.bare\" pc1 &&\n> > -     git -C pc1 rev-list HEAD --quiet --objects --missing=print \\\n> > -             | awk -f print_1.awk \\\n> > -             | sed \"s/?//\" \\\n> > -             | sort >observed.oids &&\n> > +\n> > +     git -C pc1 rev-list HEAD --quiet --objects --missing=print |\n>\n> Also needs to write to a temporary to avoid losing the exist status\n> (and likewise for the rest of this file).\nDone in a separate patch, although I didn't do this for pipes inside\nof $( ) and for a trivial \"git rev-parse HEAD\".\n\n>\n> [...]\n> > --- a/t/t6112-rev-list-filters-objects.sh\n> > +++ b/t/t6112-rev-list-filters-objects.sh\n> > @@ -20,24 +20,28 @@ test_expect_success 'setup r1' '\n> >  '\n> >\n> >  test_expect_success 'verify blob:none omits all 5 blobs' '\n> > -     git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n> > -             | awk -f print_2.awk \\\n> > -             | sort >expected &&\n> > -     git -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none \\\n> > -             | awk -f print_1.awk \\\n> > -             | sed \"s/~//\" \\\n> > -             | sort >observed &&\n> > +     git -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n> > +     awk -f print_2.awk |\n> > +     sort >expected &&\n>\n> Likewise.\nFixed this file.\n>\n> [...]\n> > --- a/t/t9101-git-svn-props.sh\n> > +++ b/t/t9101-git-svn-props.sh\n> > @@ -193,8 +193,8 @@ test_expect_success 'test propget' \"\n> >       git svn propget svn:ignore . | cmp - prop.expect &&\n> >       cd deeply &&\n> >       git svn propget svn:ignore . | cmp - ../prop.expect &&\n> > -     git svn propget svn:entry:committed-rev nested/directory/.keep \\\n> > -       | cmp - ../prop2.expect &&\n> > +     git svn propget svn:entry:committed-rev nested/directory/.keep |\n> > +     cmp - ../prop2.expect &&\n>\n> Likewise.\nFixed this section, including the one earlier in this file. This\nsection is not a trivial change, so I put it in a different commit.\n\n>\n> Thanks and hope that helps,\n> Jonathan\nI will send an updated patchset shortly.\n"},{"id":"358359","messageId":"cover.1537222670.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1536969438.git.matvore@google.com","subject":"[PATCH v2 0/6] Clean up tests for test_cmp arg ordering and pipe placement","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-17T22:24:16Z","receivedAt":"2018-09-17T22:24:40Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"This applies the suggestions from jrn@'s response to v1 here:\nhttps://public-inbox.org/git/20180917163137.GB89942@aiede.svl.corp.google.com/\n\nThe major changes are:\n - Added two bullet points to Documentation/CodingGuidelines about 1) how to\n   format pipe sequences and 2) using temporary files rather than pipes to\n   avoid masking potiential error exit codes.\n - A new commit which introduces a linter check to enforce (1) above, which I\n   am requesting feedback for. I'd be happy to drop it.\n - A new commit to fix violations of (2) above in t9101-git-svn-props.sh since\n   it was not so trivial.\n - A better message to describe the pipe placement commit.\n\nThank you,\n\nMatthew DeVore (6):\n  CodingGuidelines: add shell piping guidelines\n  tests: standardize pipe placement\n  t/*: fix ordering of expected/observed arguments\n  tests: Add linter check for pipe placement style\n  tests: split up pipes\n  t9109-git-svn-props.sh: split up several pipes\n\n Documentation/CodingGuidelines         |  29 ++\n t/Makefile                             |  12 +-\n t/lib-gpg.sh                           |   9 +-\n t/t0000-basic.sh                       |   2 +-\n t/t0021-conversion.sh                  |   4 +-\n t/t1006-cat-file.sh                    |   8 +-\n t/t1300-config.sh                      |   9 +-\n t/t1303-wacky-config.sh                |   4 +-\n t/t2101-update-index-reupdate.sh       |   2 +-\n t/t3200-branch.sh                      |   2 +-\n t/t3320-notes-merge-worktrees.sh       |   4 +-\n t/t3400-rebase.sh                      |   8 +-\n t/t3417-rebase-whitespace-fix.sh       |   6 +-\n t/t3702-add-edit.sh                    |   4 +-\n t/t3903-stash.sh                       |   8 +-\n t/t3905-stash-include-untracked.sh     |   2 +-\n t/t4025-hunk-header.sh                 |   2 +-\n t/t4117-apply-reject.sh                |   6 +-\n t/t4124-apply-ws-rule.sh               |  30 +--\n t/t4138-apply-ws-expansion.sh          |   2 +-\n t/t5317-pack-objects-filter-objects.sh | 360 ++++++++++++++-----------\n t/t5318-commit-graph.sh                |   2 +-\n t/t5500-fetch-pack.sh                  |   7 +-\n t/t5616-partial-clone.sh               |  30 ++-\n t/t5701-git-serve.sh                   |  14 +-\n t/t5702-protocol-v2.sh                 |  10 +-\n t/t6023-merge-file.sh                  |  12 +-\n t/t6027-merge-binary.sh                |   4 +-\n t/t6031-merge-filemode.sh              |   2 +-\n t/t6112-rev-list-filters-objects.sh    | 224 ++++++++-------\n t/t7201-co.sh                          |   4 +-\n t/t7406-submodule-update.sh            |   8 +-\n t/t7800-difftool.sh                    |   2 +-\n t/t9100-git-svn-basic.sh               |   2 +-\n t/t9101-git-svn-props.sh               |  24 +-\n t/t9133-git-svn-nested-git-repo.sh     |   6 +-\n t/t9600-cvsimport.sh                   |   2 +-\n t/t9603-cvsimport-patchsets.sh         |   4 +-\n t/t9604-cvsimport-timestamps.sh        |   4 +-\n 39 files changed, 511 insertions(+), 363 deletions(-)\n\n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358360","messageId":"c625bfe2205d51b3158ef71e4bf472708642c146.1537223021.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1537223021.git.matvore@google.com","subject":"[PATCH v2 1/6] CodingGuidelines: add shell piping guidelines","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-17T22:24:17Z","receivedAt":"2018-09-17T22:24:48Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Add two guidelines:\n\n - pipe characters should appear at the end of lines, and not cause\n   indentation\n - pipes should be avoided when they swallow exit codes that can\n   potentially fail\n---\n Documentation/CodingGuidelines | 29 +++++++++++++++++++++++++++++\n 1 file changed, 29 insertions(+)\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex 48aa4edfb..7f903c1aa 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -163,6 +163,35 @@ For shell scripts specifically (not exhaustive):\n \n    does not have such a problem.\n \n+ - In a piped sequence which spans multiple lines, put each statement\n+   on a separate line and put pipes on the end of each line, rather\n+   than the start. This means you don't need to use \\ to join lines,\n+   since | implies a join already. Also, do not indent subsequent\n+   lines; if you need a sequence to visually stand apart from the\n+   surrounding code, use a blank line before and/or after the piped\n+   sequence.\n+\n+\t(incorrect)\n+\techo '...' > expected\n+\tgit ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t| awk '{print $1}' \\\n+\t\t| sort >observed\n+\ttest_cmp expected actual\n+\n+\t(correct)\n+\techo '...' > expected\n+\n+\tgit ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk '{print $1}' |\n+\tsort >observed\n+\n+\ttest_cmp expected actual\n+\n+ - In a pipe, any non-zero exit codes returned by processes besides\n+   the last will be ignored. If there is any possibility some\n+   non-final command in the pipe will raise an error, prefer writing\n+   the output of that command to a temporary file with '>' rather than\n+   pipe it.\n \n For C programs:\n \n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358361","messageId":"980e4d6005224771cf9366883f2493ef0a82e8c8.1537223021.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1537223021.git.matvore@google.com","subject":"[PATCH v2 2/6] tests: standardize pipe placement","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-17T22:24:18Z","receivedAt":"2018-09-17T22:24:57Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Instead of using a line-continuation and pipe on the second line, take\nadvantage of the shell's implicit line continuation after a pipe\ncharacter.  So for example, instead of\n\n\tsome long line \\\n\t\t| next line\n\nuse\n\n\tsome long line |\n\tnext line\n\nAnd add a blank line before and after the pipe where it aids readability\n(it usually does).\n\nThis better matches the coding style documented in\nDocumentation/CodingGuidelines and used in shell scripts elsewhere in\nthe tree.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/lib-gpg.sh                           |   9 +-\n t/t1006-cat-file.sh                    |   8 +-\n t/t1300-config.sh                      |   5 +-\n t/t5317-pack-objects-filter-objects.sh | 330 ++++++++++++++-----------\n t/t5500-fetch-pack.sh                  |   5 +-\n t/t5616-partial-clone.sh               |  32 ++-\n t/t6112-rev-list-filters-objects.sh    | 203 ++++++++-------\n 7 files changed, 342 insertions(+), 250 deletions(-)\n\ndiff --git a/t/lib-gpg.sh b/t/lib-gpg.sh\nindex 3fe02876c..f1277bef4 100755\n--- a/t/lib-gpg.sh\n+++ b/t/lib-gpg.sh\n@@ -57,9 +57,12 @@ then\n \t\techo | gpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null \\\n \t\t\t--passphrase-fd 0 --pinentry-mode loopback \\\n \t\t\t--import \"$TEST_DIRECTORY\"/lib-gpg/gpgsm_cert.p12 &&\n-\t\tgpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null -K \\\n-\t\t\t| grep fingerprint: | cut -d\" \" -f4 | tr -d '\\n' > \\\n-\t\t\t${GNUPGHOME}/trustlist.txt &&\n+\n+\t\tgpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null -K |\n+\t\tgrep fingerprint: |\n+\t\tcut -d\" \" -f4 |\n+\t\ttr -d '\\n' >\"${GNUPGHOME}/trustlist.txt\" &&\n+\n \t\techo \" S relax\" >> ${GNUPGHOME}/trustlist.txt &&\n \t\t(gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) &&\n \t\techo hello | gpgsm --homedir \"${GNUPGHOME}\" >/dev/null \\\ndiff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh\nindex 7f19d591f..a0fa926d3 100755\n--- a/t/t1006-cat-file.sh\n+++ b/t/t1006-cat-file.sh\n@@ -218,8 +218,8 @@ test_expect_success \"--batch-check for a non-existent hash\" '\n     test \"0000000000000000000000000000000000000042 missing\n 0000000000000000000000000000000000000084 missing\" = \\\n     \"$( ( echo 0000000000000000000000000000000000000042;\n-         echo_without_newline 0000000000000000000000000000000000000084; ) \\\n-       | git cat-file --batch-check)\"\n+         echo_without_newline 0000000000000000000000000000000000000084; ) |\n+       git cat-file --batch-check)\"\n '\n \n test_expect_success \"--batch for an existent and a non-existent hash\" '\n@@ -227,8 +227,8 @@ test_expect_success \"--batch for an existent and a non-existent hash\" '\n $tag_content\n 0000000000000000000000000000000000000000 missing\" = \\\n     \"$( ( echo $tag_sha1;\n-         echo_without_newline 0000000000000000000000000000000000000000; ) \\\n-       | git cat-file --batch)\"\n+         echo_without_newline 0000000000000000000000000000000000000000; ) |\n+       git cat-file --batch)\"\n '\n \n test_expect_success \"--batch-check for an empty line\" '\ndiff --git a/t/t1300-config.sh b/t/t1300-config.sh\nindex cdf1fed5d..5869d6cb6 100755\n--- a/t/t1300-config.sh\n+++ b/t/t1300-config.sh\n@@ -1770,8 +1770,9 @@ test_expect_success '--show-origin stdin with file include' '\n \tcat >expect <<-EOF &&\n \t\tfile:$INCLUDE_DIR/stdin.include\tinclude\n \tEOF\n-\techo \"[include]path=\\\"$INCLUDE_DIR\\\"/stdin.include\" \\\n-\t\t| git config --show-origin --includes --file - user.stdin >output &&\n+\techo \"[include]path=\\\"$INCLUDE_DIR\\\"/stdin.include\" |\n+\tgit config --show-origin --includes --file - user.stdin >output &&\n+\n \ttest_cmp expect output\n '\n \ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex 6710c8bc8..ce69148ec 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -20,17 +20,20 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r1 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r1 index-pack ../all.pack &&\n-\tgit -C r1 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -39,23 +42,27 @@ test_expect_success 'verify blob:none packfile has no blobs' '\n \tHEAD\n \tEOF\n \tgit -C r1 index-pack ../filter.pack &&\n-\tgit -C r1 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n \n test_expect_success 'verify normal and blob:none packfiles have same commits/trees' '\n-\tgit -C r1 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r1 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -75,17 +82,20 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../all.pack &&\n-\tgit -C r2 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -94,10 +104,12 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n@@ -107,99 +119,118 @@ test_expect_success 'verify blob:limit=1000' '\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.1000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1001 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=10001' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=10001 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.1000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify explicitly specifying oversized blob in input' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n \tHEAD\n \t$(git -C r2 rev-parse HEAD:large.10000)\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1m >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '\n-\tgit -C r2 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r2 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -224,71 +255,84 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../all.pack &&\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern1' '\n-\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern2' '\n-\tgit -C r3 ls-files -s sparse1 dir1/sparse1 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s sparse1 dir1/sparse1 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -312,48 +356,57 @@ test_expect_success 'setup r4' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r4 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../all.pack &&\n-\tgit -C r4 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=OID' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \toid=$(git -C r4 ls-files -s pattern | awk -f print_2.awk) &&\n \tgit -C r4 pack-objects --rev --stdout --filter=sparse:oid=$oid >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n-\tgit -C r4 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=oid-ish' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r4 pack-objects --rev --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n-\tgit -C r4 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -361,9 +414,10 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'setup r1 - delete loose blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tfor id in `cat expected | sed \"s|..|&/|\"`\n \tdo\n \t\trm r1/.git/objects/$id\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 1b5a4a6d3..5ac6f286d 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -50,8 +50,9 @@ pull_to_client () {\n \t\t\tcase \"$heads\" in *B*)\n \t\t\t    git update-ref refs/heads/B \"$BTIP\";;\n \t\t\tesac &&\n-\t\t\tgit symbolic-ref HEAD refs/heads/$(echo $heads \\\n-\t\t\t\t| sed -e \"s/^\\(.\\).*$/\\1/\") &&\n+\n+\t\t\tgit symbolic-ref HEAD refs/heads/$(echo $heads |\n+\t\t\tsed -e \"s/^\\(.\\).*$/\\1/\") &&\n \n \t\t\tgit fsck --full &&\n \ndiff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\nindex bbbe7537d..e4d032c9d 100755\n--- a/t/t5616-partial-clone.sh\n+++ b/t/t5616-partial-clone.sh\n@@ -34,10 +34,12 @@ test_expect_success 'setup bare clone for server' '\n # confirm partial clone was registered in the local config.\n test_expect_success 'do partial clone 1' '\n \tgit clone --no-checkout --filter=blob:none \"file://$(pwd)/srv.bare\" pc1 &&\n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_cmp expect_1.oids observed.oids &&\n \ttest \"$(git -C pc1 config --local core.repositoryformatversion)\" = \"1\" &&\n \ttest \"$(git -C pc1 config --local extensions.partialclone)\" = \"origin\" &&\n@@ -130,16 +132,20 @@ test_expect_success 'push new commits to server for file.3.txt' '\n # perhaps combined with a command in dry-run mode.\n test_expect_success 'manual prefetch of missing objects' '\n \tgit -C pc1 fetch --filter=blob:none origin &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_line_count = 6 observed.oids &&\n \tgit -C pc1 fetch-pack --stdin \"file://$(pwd)/srv.bare\" <observed.oids &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_line_count = 0 observed.oids\n '\n \n@@ -194,7 +200,7 @@ test_expect_success 'upon cloning, check that all refs point to objects' '\n \n \t# Craft a packfile not including that blob.\n \tgit -C \"$SERVER\" rev-parse HEAD |\n-\t\tgit -C \"$SERVER\" pack-objects --stdout >incomplete.pack &&\n+\tgit -C \"$SERVER\" pack-objects --stdout >incomplete.pack &&\n \n \t# Replace the existing packfile with the crafted one. The protocol\n \t# requires that the packfile be sent in sideband 1, hence the extra\ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex d4ff0b3be..0f6b569e1 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -20,24 +20,28 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob:none omits all 5 blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r1 rev-list HEAD --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r1 rev-list HEAD --objects |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -58,65 +62,76 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob:limit=500 omits all blobs' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r2 rev-list HEAD --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 rev-list HEAD --objects |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1000' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_must_be_empty observed\n '\n \n@@ -141,24 +156,28 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n-\tgit -C r3 ls-files -s sparse2 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s sparse2 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -173,25 +192,30 @@ test_expect_success 'setup r3 part 2' '\n '\n \n test_expect_success 'verify sparse:oid=OID omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \toid=$(git -C r3 ls-files -s pattern | awk -f print_2.awk) &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -199,17 +223,20 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'rev-list W/ --missing=print' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tfor id in `cat expected | sed \"s|..|&/|\"`\n \tdo\n \t\trm r1/.git/objects/$id\n \tdone &&\n-\tgit -C r1 rev-list --quiet HEAD --missing=print --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 rev-list --quiet HEAD --missing=print --objects |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358362","messageId":"d22d51cfded71e0e3ac103633a105c414abbacd3.1537223021.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1537223021.git.matvore@google.com","subject":"[PATCH v2 3/6] t/*: fix ordering of expected/observed arguments","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-17T22:24:19Z","receivedAt":"2018-09-17T22:25:06Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Fix various places where the ordering was obviously wrong, meaning it\nwas easy to find with grep.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/t0000-basic.sh                       |  2 +-\n t/t0021-conversion.sh                  |  4 +--\n t/t1300-config.sh                      |  4 +--\n t/t1303-wacky-config.sh                |  4 +--\n t/t2101-update-index-reupdate.sh       |  2 +-\n t/t3200-branch.sh                      |  2 +-\n t/t3320-notes-merge-worktrees.sh       |  4 +--\n t/t3400-rebase.sh                      |  8 +++---\n t/t3417-rebase-whitespace-fix.sh       |  6 ++---\n t/t3702-add-edit.sh                    |  4 +--\n t/t3903-stash.sh                       |  8 +++---\n t/t3905-stash-include-untracked.sh     |  2 +-\n t/t4025-hunk-header.sh                 |  2 +-\n t/t4117-apply-reject.sh                |  6 ++---\n t/t4124-apply-ws-rule.sh               | 30 +++++++++++------------\n t/t4138-apply-ws-expansion.sh          |  2 +-\n t/t5317-pack-objects-filter-objects.sh | 34 +++++++++++++-------------\n t/t5318-commit-graph.sh                |  2 +-\n t/t5701-git-serve.sh                   | 14 +++++------\n t/t5702-protocol-v2.sh                 | 10 ++++----\n t/t6023-merge-file.sh                  | 12 ++++-----\n t/t6027-merge-binary.sh                |  4 +--\n t/t6031-merge-filemode.sh              |  2 +-\n t/t6112-rev-list-filters-objects.sh    | 24 +++++++++---------\n t/t7201-co.sh                          |  4 +--\n t/t7406-submodule-update.sh            |  8 +++---\n t/t7800-difftool.sh                    |  2 +-\n t/t9100-git-svn-basic.sh               |  2 +-\n t/t9133-git-svn-nested-git-repo.sh     |  6 ++---\n t/t9600-cvsimport.sh                   |  2 +-\n t/t9603-cvsimport-patchsets.sh         |  4 +--\n t/t9604-cvsimport-timestamps.sh        |  4 +--\n 32 files changed, 112 insertions(+), 112 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex 850f651e4..224c098a8 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -1018,7 +1018,7 @@ test_expect_success SHA1 'validate git diff-files output for a know cache/work t\n :120000 120000 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c 0000000000000000000000000000000000000000 M\tpath3/subp3/file3sym\n EOF\n \tgit diff-files >current &&\n-\ttest_cmp current expected\n+\ttest_cmp expected current\n '\n \n test_expect_success 'git update-index --refresh should succeed' '\ndiff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh\nindex 308cd28f3..fd5f1ac64 100755\n--- a/t/t0021-conversion.sh\n+++ b/t/t0021-conversion.sh\n@@ -166,10 +166,10 @@ test_expect_success expanded_in_repo '\n \trm -f expanded-keywords expanded-keywords-crlf &&\n \n \tgit checkout -- expanded-keywords &&\n-\ttest_cmp expanded-keywords expected-output &&\n+\ttest_cmp expected-output expanded-keywords &&\n \n \tgit checkout -- expanded-keywords-crlf &&\n-\ttest_cmp expanded-keywords-crlf expected-output-crlf\n+\ttest_cmp expected-output-crlf expanded-keywords-crlf\n '\n \n # The use of %f in a filter definition is expanded to the path to\ndiff --git a/t/t1300-config.sh b/t/t1300-config.sh\nindex 5869d6cb6..e2cd50ecf 100755\n--- a/t/t1300-config.sh\n+++ b/t/t1300-config.sh\n@@ -1001,7 +1001,7 @@ EOF\n \n test_expect_success 'value continued on next line' '\n \tgit config --list > result &&\n-\ttest_cmp result expect\n+\ttest_cmp expect result\n '\n \n cat > .git/config <<\\EOF\n@@ -1882,7 +1882,7 @@ test_expect_success '--replace-all does not invent newlines' '\n \tQkey = b\n \tEOF\n \tgit config --replace-all abc.key b &&\n-\ttest_cmp .git/config expect\n+\ttest_cmp expect .git/config\n '\n \n test_done\ndiff --git a/t/t1303-wacky-config.sh b/t/t1303-wacky-config.sh\nindex 3b92083e1..0000e664e 100755\n--- a/t/t1303-wacky-config.sh\n+++ b/t/t1303-wacky-config.sh\n@@ -14,7 +14,7 @@ setup() {\n check() {\n \techo \"$2\" >expected\n \tgit config --get \"$1\" >actual 2>&1\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n }\n \n # 'check section.key regex value' verifies that the entry for\n@@ -22,7 +22,7 @@ check() {\n check_regex() {\n \techo \"$3\" >expected\n \tgit config --get \"$1\" \"$2\" >actual 2>&1\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n }\n \n test_expect_success 'modify same key' '\ndiff --git a/t/t2101-update-index-reupdate.sh b/t/t2101-update-index-reupdate.sh\nindex 685ec4563..6c32d42c8 100755\n--- a/t/t2101-update-index-reupdate.sh\n+++ b/t/t2101-update-index-reupdate.sh\n@@ -73,7 +73,7 @@ test_expect_success 'update-index --update from subdir' '\n \t100644 $(git hash-object dir1/file3) 0\tdir1/file3\n \t100644 $file2 0\tfile2\n \tEOF\n-\ttest_cmp current expected\n+\ttest_cmp expected current\n '\n \n test_expect_success 'update-index --update with pathspec' '\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex 93f21ab07..478b82cf9 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -1221,7 +1221,7 @@ test_expect_success 'use --edit-description' '\n \tEOF\n \tEDITOR=./editor git branch --edit-description &&\n \techo \"New contents\" >expect &&\n-\ttest_cmp EDITOR_OUTPUT expect\n+\ttest_cmp expect EDITOR_OUTPUT\n '\n \n test_expect_success 'detect typo in branch name when using --edit-description' '\ndiff --git a/t/t3320-notes-merge-worktrees.sh b/t/t3320-notes-merge-worktrees.sh\nindex 10bfc8b94..823fdbda1 100755\n--- a/t/t3320-notes-merge-worktrees.sh\n+++ b/t/t3320-notes-merge-worktrees.sh\n@@ -44,7 +44,7 @@ test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '\n \tgit config core.notesRef refs/notes/y &&\n \ttest_must_fail git notes merge z &&\n \techo \"ref: refs/notes/y\" >expect &&\n-\ttest_cmp .git/NOTES_MERGE_REF expect\n+\ttest_cmp expect .git/NOTES_MERGE_REF\n '\n \n test_expect_success 'merge z into y while mid-merge in another workdir fails' '\n@@ -66,7 +66,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '\n \t\tgrep -v \"A notes merge into refs/notes/x is already in-progress in\" out\n \t) &&\n \techo \"ref: refs/notes/x\" >expect &&\n-\ttest_cmp .git/worktrees/worktree2/NOTES_MERGE_REF expect\n+\ttest_cmp expect .git/worktrees/worktree2/NOTES_MERGE_REF\n '\n \n test_done\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 3996ee013..3e73f7584 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -183,13 +183,13 @@ test_expect_success 'cherry-picked commits and fork-point work together' '\n \ttest_commit final_B B \"Final B\" &&\n \tgit rebase &&\n \techo Amended >expect &&\n-\ttest_cmp A expect &&\n+\ttest_cmp expect A &&\n \techo \"Final B\" >expect &&\n-\ttest_cmp B expect &&\n+\ttest_cmp expect B &&\n \techo C >expect &&\n-\ttest_cmp C expect &&\n+\ttest_cmp expect C &&\n \techo D >expect &&\n-\ttest_cmp D expect\n+\ttest_cmp expect D\n '\n \n test_expect_success 'rebase -q is quiet' '\ndiff --git a/t/t3417-rebase-whitespace-fix.sh b/t/t3417-rebase-whitespace-fix.sh\nindex 1fb3e499b..e85cdc703 100755\n--- a/t/t3417-rebase-whitespace-fix.sh\n+++ b/t/t3417-rebase-whitespace-fix.sh\n@@ -55,7 +55,7 @@ test_expect_success 'blank line at end of file; extend at end of file' '\n \tgit add file &&\tgit commit -m second &&\n \tgit rebase --whitespace=fix HEAD^^ &&\n \tgit diff --exit-code HEAD^:file expect-first &&\n-\ttest_cmp file expect-second\n+\ttest_cmp expect-second file\n '\n \n # prepare third revision of \"file\"\n@@ -82,7 +82,7 @@ test_expect_success 'two blanks line at end of file; extend at end of file' '\n \tcp third file && git add file && git commit -m third &&\n \tgit rebase --whitespace=fix HEAD^^ &&\n \tgit diff --exit-code HEAD^:file expect-second &&\n-\ttest_cmp file expect-third\n+\ttest_cmp expect-third file\n '\n \n test_expect_success 'same, but do not remove trailing spaces' '\n@@ -120,7 +120,7 @@ test_expect_success 'at beginning of file' '\n \tdone >> file &&\n \tgit commit -m more file\t&&\n \tgit rebase --whitespace=fix HEAD^^ &&\n-\ttest_cmp file expect-beginning\n+\ttest_cmp expect-beginning file\n '\n \n test_done\ndiff --git a/t/t3702-add-edit.sh b/t/t3702-add-edit.sh\nindex c6af7f82b..6c676645d 100755\n--- a/t/t3702-add-edit.sh\n+++ b/t/t3702-add-edit.sh\n@@ -110,10 +110,10 @@ test_expect_success 'add -e' '\n \tcp second-part file &&\n \tgit add -e &&\n \ttest_cmp second-part file &&\n-\ttest_cmp orig-patch expected-patch &&\n+\ttest_cmp expected-patch orig-patch &&\n \tgit diff --cached >actual &&\n \tgrep -v index actual >out &&\n-\ttest_cmp out expected\n+\ttest_cmp expected out\n \n '\n \ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 6450bc669..cd216655b 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -36,7 +36,7 @@ EOF\n test_expect_success 'parents of stash' '\n \ttest $(git rev-parse stash^) = $(git rev-parse HEAD) &&\n \tgit diff stash^2..stash > output &&\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n '\n \n test_expect_success 'applying bogus stash does nothing' '\n@@ -210,9 +210,9 @@ test_expect_success 'stash branch' '\n \ttest refs/heads/stashbranch = $(git symbolic-ref HEAD) &&\n \ttest $(git rev-parse HEAD) = $(git rev-parse master^) &&\n \tgit diff --cached > output &&\n-\ttest_cmp output expect &&\n+\ttest_cmp expect output &&\n \tgit diff > output &&\n-\ttest_cmp output expect1 &&\n+\ttest_cmp expect1 output &&\n \tgit add file &&\n \tgit commit -m alternate\\ second &&\n \tgit diff master..stashbranch > output &&\n@@ -710,7 +710,7 @@ test_expect_success 'stash where working directory contains \"HEAD\" file' '\n \tgit diff-index --cached --quiet HEAD &&\n \ttest \"$(git rev-parse stash^)\" = \"$(git rev-parse HEAD)\" &&\n \tgit diff stash^..stash > output &&\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n '\n \n test_expect_success 'store called with invalid commit' '\ndiff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh\nindex 597b0637d..cc1c8a7bb 100755\n--- a/t/t3905-stash-include-untracked.sh\n+++ b/t/t3905-stash-include-untracked.sh\n@@ -142,7 +142,7 @@ test_expect_success 'stash save --include-untracked removed files' '\n \trm -f file &&\n \tgit stash save --include-untracked &&\n \techo 1 > expect &&\n-\ttest_cmp file expect\n+\ttest_cmp expect file\n '\n \n rm -f expect\ndiff --git a/t/t4025-hunk-header.sh b/t/t4025-hunk-header.sh\nindex fa44e7886..35578f2bb 100755\n--- a/t/t4025-hunk-header.sh\n+++ b/t/t4025-hunk-header.sh\n@@ -37,7 +37,7 @@ test_expect_success 'hunk header truncation with an overly long line' '\n \t\techo \" A $N$N$N$N$N$N$N$N$N2\" &&\n \t\techo \" L  $N$N$N$N$N$N$N$N$N1\"\n \t) >expected &&\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n \n '\n \ndiff --git a/t/t4117-apply-reject.sh b/t/t4117-apply-reject.sh\nindex d80187de9..f7de6f077 100755\n--- a/t/t4117-apply-reject.sh\n+++ b/t/t4117-apply-reject.sh\n@@ -72,7 +72,7 @@ test_expect_success 'apply with --reject should fail but update the file' '\n \trm -f file1.rej file2.rej &&\n \n \ttest_must_fail git apply --reject patch.1 &&\n-\ttest_cmp file1 expected &&\n+\ttest_cmp expected file1 &&\n \n \tcat file1.rej &&\n \ttest_path_is_missing file2.rej\n@@ -85,7 +85,7 @@ test_expect_success 'apply with --reject should fail but update the file' '\n \n \ttest_must_fail git apply --reject patch.2 >rejects &&\n \ttest_path_is_missing file1 &&\n-\ttest_cmp file2 expected &&\n+\ttest_cmp expected file2 &&\n \n \tcat file2.rej &&\n \ttest_path_is_missing file1.rej\n@@ -99,7 +99,7 @@ test_expect_success 'the same test with --verbose' '\n \n \ttest_must_fail git apply --reject --verbose patch.2 >rejects &&\n \ttest_path_is_missing file1 &&\n-\ttest_cmp file2 expected &&\n+\ttest_cmp expected file2 &&\n \n \tcat file2.rej &&\n \ttest_path_is_missing file1.rej\ndiff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh\nindex 7e32237a2..ff51e9e78 100755\n--- a/t/t4124-apply-ws-rule.sh\n+++ b/t/t4124-apply-ws-rule.sh\n@@ -313,9 +313,9 @@ test_expect_success 'applying beyond EOF requires one non-blank context line' '\n \t{ echo a; echo; } >one &&\n \tcp one expect &&\n \ttest_must_fail git apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \ttest_must_fail git apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'tons of blanks at EOF should not apply' '\n@@ -342,10 +342,10 @@ test_expect_success 'missing blank line at end with --whitespace=fix' '\n \tcp one saved-one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv saved-one one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'two missing blank lines at end with --whitespace=fix' '\n@@ -360,11 +360,11 @@ test_expect_success 'two missing blank lines at end with --whitespace=fix' '\n \tcp no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'missing blank line at end, insert before end, --whitespace=fix' '\n@@ -376,7 +376,7 @@ test_expect_success 'missing blank line at end, insert before end, --whitespace=\n \techo a >one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'shrink file with tons of missing blanks at end of file' '\n@@ -392,10 +392,10 @@ test_expect_success 'shrink file with tons of missing blanks at end of file' '\n \tcp no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv no-blank-lines one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'missing blanks at EOF must only match blank lines' '\n@@ -427,7 +427,7 @@ test_expect_success 'missing blank line should match context line with spaces' '\n \tgit add one &&\n \n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n sed -e's/Z//' >one <<EOF\n@@ -447,7 +447,7 @@ test_expect_success 'same, but with the --ignore-space-option' '\n \n \tgit checkout-index -f one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '\n@@ -464,7 +464,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '\n \tmv save-one one &&\n \n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'CR-LF line endings && add line && text=auto' '\n@@ -478,7 +478,7 @@ test_expect_success 'CR-LF line endings && add line && text=auto' '\n \tmv save-one one &&\n \techo \"one text=auto\" >.gitattributes &&\n \tgit apply patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'CR-LF line endings && change line && text=auto' '\n@@ -491,7 +491,7 @@ test_expect_success 'CR-LF line endings && change line && text=auto' '\n \tmv save-one one &&\n \techo \"one text=auto\" >.gitattributes &&\n \tgit apply patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'LF in repo, CRLF in worktree && change line && text=auto' '\n@@ -503,7 +503,7 @@ test_expect_success 'LF in repo, CRLF in worktree && change line && text=auto' '\n \techo \"one text=auto\" >.gitattributes &&\n \tgit -c core.eol=CRLF apply patch &&\n \tprintf \"b\\r\\n\" >expect &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'whitespace=fix to expand' '\ndiff --git a/t/t4138-apply-ws-expansion.sh b/t/t4138-apply-ws-expansion.sh\nindex 0ffe33fbe..3b636a63a 100755\n--- a/t/t4138-apply-ws-expansion.sh\n+++ b/t/t4138-apply-ws-expansion.sh\n@@ -114,7 +114,7 @@ for t in 1 2 3 4\n do\n \ttest_expect_success 'apply with ws expansion (t=$t)' '\n \t\tgit apply patch$t.patch &&\n-\t\ttest_cmp test-$t expect-$t\n+\t\ttest_cmp expect-$t test-$t\n \t'\n done\n \ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex ce69148ec..c093eb891 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -34,7 +34,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:none packfile has no blobs' '\n@@ -63,7 +63,7 @@ test_expect_success 'verify normal and blob:none packfiles have same commits/tre\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test blob:limit=<n>[kmg] filter.\n@@ -96,7 +96,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=500 omits all blobs' '\n@@ -144,7 +144,7 @@ test_expect_success 'verify blob:limit=1001' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=10001' '\n@@ -162,7 +162,7 @@ test_expect_success 'verify blob:limit=10001' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1k' '\n@@ -180,7 +180,7 @@ test_expect_success 'verify blob:limit=1k' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify explicitly specifying oversized blob in input' '\n@@ -199,7 +199,7 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1m' '\n@@ -217,7 +217,7 @@ test_expect_success 'verify blob:limit=1m' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '\n@@ -231,7 +231,7 @@ test_expect_success 'verify normal and blob:limit packfiles have same commits/tr\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:path=<path> filter.\n@@ -269,7 +269,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern1' '\n@@ -287,7 +287,7 @@ test_expect_success 'verify sparse:path=pattern1' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '\n@@ -301,7 +301,7 @@ test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern2' '\n@@ -319,7 +319,7 @@ test_expect_success 'verify sparse:path=pattern2' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '\n@@ -333,7 +333,7 @@ test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:oid=<oid-ish> filter.\n@@ -370,7 +370,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=OID' '\n@@ -389,7 +389,7 @@ test_expect_success 'verify sparse:oid=OID' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=oid-ish' '\n@@ -407,7 +407,7 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Delete some loose objects and use pack-objects, but WITHOUT any filtering.\ndiff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh\nindex 0c500f7ca..d6da3ce4e 100755\n--- a/t/t5318-commit-graph.sh\n+++ b/t/t5318-commit-graph.sh\n@@ -35,7 +35,7 @@ test_expect_success 'create commits and repack' '\n graph_git_two_modes() {\n \tgit -c core.commitGraph=true $1 >output\n \tgit -c core.commitGraph=false $1 >expect\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n }\n \n graph_git_behavior() {\ndiff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh\nindex 75ec79e6c..bf139e245 100755\n--- a/t/t5701-git-serve.sh\n+++ b/t/t5701-git-serve.sh\n@@ -16,7 +16,7 @@ test_expect_success 'test capability advertisement' '\n \n \tgit serve --advertise-capabilities >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'stateless-rpc flag does not list capabilities' '\n@@ -89,7 +89,7 @@ test_expect_success 'basics of ls-refs' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'basic ref-prefixes' '\n@@ -109,7 +109,7 @@ test_expect_success 'basic ref-prefixes' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'refs/heads prefix' '\n@@ -129,7 +129,7 @@ test_expect_success 'refs/heads prefix' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'peel parameter' '\n@@ -150,7 +150,7 @@ test_expect_success 'peel parameter' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'symrefs parameter' '\n@@ -171,7 +171,7 @@ test_expect_success 'symrefs parameter' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'sending server-options' '\n@@ -191,7 +191,7 @@ test_expect_success 'sending server-options' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'unexpected lines are not allowed in fetch request' '\ndiff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh\nindex 3beeed454..54727450b 100755\n--- a/t/t5702-protocol-v2.sh\n+++ b/t/t5702-protocol-v2.sh\n@@ -29,7 +29,7 @@ test_expect_success 'list refs with git:// using protocol v2' '\n \tgrep \"git< version 2\" log &&\n \n \tgit ls-remote --symref \"$GIT_DAEMON_URL/parent\" >expect &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'ref advertisment is filtered with ls-remote using protocol v2' '\n@@ -42,7 +42,7 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol\n \t$(git -C \"$daemon_parent\" rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'clone with git:// using protocol v2' '\n@@ -138,7 +138,7 @@ test_expect_success 'list refs with file:// using protocol v2' '\n \tgrep \"git< version 2\" log &&\n \n \tgit ls-remote --symref \"file://$(pwd)/file_parent\" >expect &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'ref advertisment is filtered with ls-remote using protocol v2' '\n@@ -151,7 +151,7 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol\n \t$(git -C file_parent rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'server-options are sent when using ls-remote' '\n@@ -164,7 +164,7 @@ test_expect_success 'server-options are sent when using ls-remote' '\n \t$(git -C file_parent rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect &&\n+\ttest_cmp expect actual &&\n \tgrep \"server-option=hello\" log &&\n \tgrep \"server-option=world\" log\n '\ndiff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh\nindex 20aee43f9..51ee887a7 100755\n--- a/t/t6023-merge-file.sh\n+++ b/t/t6023-merge-file.sh\n@@ -99,7 +99,7 @@ EOF\n printf \"propter nomen suum.\" >> expect.txt\n \n test_expect_success \"merge does not add LF away of change\" \\\n-\t\"test_cmp test3.txt expect.txt\"\n+\t\"test_cmp expect.txt test3.txt\"\n \n cp test.txt backup.txt\n test_expect_success \"merge with conflicts\" \\\n@@ -122,7 +122,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n \n-test_expect_success \"expected conflict markers\" \"test_cmp test.txt expect.txt\"\n+test_expect_success \"expected conflict markers\" \"test_cmp expect.txt test.txt\"\n \n cp backup.txt test.txt\n \n@@ -138,7 +138,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --ours\" \\\n-\t\"git merge-file --ours test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --ours test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n cat > expect.txt << EOF\n@@ -154,7 +154,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --theirs\" \\\n-\t\"git merge-file --theirs test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --theirs test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n cat > expect.txt << EOF\n@@ -171,7 +171,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --union\" \\\n-\t\"git merge-file --union test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --union test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n test_expect_success \"merge with conflicts, using -L\" \\\n@@ -195,7 +195,7 @@ virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n \n test_expect_success \"expected conflict markers, with -L\" \\\n-\t\"test_cmp test.txt expect.txt\"\n+\t\"test_cmp expect.txt test.txt\"\n \n sed \"s/ tu / TU /\" < new1.txt > new5.txt\n test_expect_success \"conflict in removed tail\" \\\ndiff --git a/t/t6027-merge-binary.sh b/t/t6027-merge-binary.sh\nindex 07735410b..4e6c7cb77 100755\n--- a/t/t6027-merge-binary.sh\n+++ b/t/t6027-merge-binary.sh\n@@ -45,7 +45,7 @@ test_expect_success resolve '\n \t\tfalse\n \telse\n \t\tgit ls-files -s >current\n-\t\ttest_cmp current expect\n+\t\ttest_cmp expect current\n \tfi\n '\n \n@@ -60,7 +60,7 @@ test_expect_success recursive '\n \t\tfalse\n \telse\n \t\tgit ls-files -s >current\n-\t\ttest_cmp current expect\n+\t\ttest_cmp expect current\n \tfi\n '\n \ndiff --git a/t/t6031-merge-filemode.sh b/t/t6031-merge-filemode.sh\nindex 7d06461f1..87741efad 100755\n--- a/t/t6031-merge-filemode.sh\n+++ b/t/t6031-merge-filemode.sh\n@@ -61,7 +61,7 @@ do_both_modes () {\n \t\tgit checkout -f a2 &&\n \t\ttest_must_fail git merge -s $strategy b2 &&\n \t\tgit ls-files -u >actual &&\n-\t\ttest_cmp actual expect &&\n+\t\ttest_cmp expect actual &&\n \t\tgit ls-files -s file2 | grep ^100755\n \t'\n \ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex 0f6b569e1..ae4402226 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -29,7 +29,7 @@ test_expect_success 'verify blob:none omits all 5 blobs' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n@@ -42,7 +42,7 @@ test_expect_success 'verify emitted+omitted == all' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n \n@@ -71,7 +71,7 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n@@ -84,7 +84,7 @@ test_expect_success 'verify emitted+omitted == all' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1000' '\n@@ -97,7 +97,7 @@ test_expect_success 'verify blob:limit=1000' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1001' '\n@@ -110,7 +110,7 @@ test_expect_success 'verify blob:limit=1001' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1k' '\n@@ -123,7 +123,7 @@ test_expect_success 'verify blob:limit=1k' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1m' '\n@@ -165,7 +165,7 @@ test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n@@ -178,7 +178,7 @@ test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:oid=<oid-ish> filter.\n@@ -203,7 +203,7 @@ test_expect_success 'verify sparse:oid=OID omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n@@ -216,7 +216,7 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Delete some loose objects and use rev-list, but WITHOUT any filtering.\n@@ -237,7 +237,7 @@ test_expect_success 'rev-list W/ --missing=print' '\n \tsed \"s/?//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'rev-list W/O --missing fails' '\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 324933acf..826987ca8 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -160,7 +160,7 @@ test_expect_success 'checkout -m with merge conflict' '\n \tgit diff master:one :3:uno |\n \tsed -e \"1,/^@@/d\" -e \"/^ /d\" -e \"s/^-/d/\" -e \"s/^+/a/\" >current &&\n \tfill d2 aT d7 aS >expect &&\n-\ttest_cmp current expect &&\n+\ttest_cmp expect current &&\n \tgit diff --cached two >current &&\n \ttest_must_be_empty current\n '\n@@ -174,7 +174,7 @@ test_expect_success 'format of merge conflict from checkout -m' '\n \n \tgit ls-files >current &&\n \tfill same two two two >expect &&\n-\ttest_cmp current expect &&\n+\ttest_cmp expect current &&\n \n \tcat <<-EOF >expect &&\n \t<<<<<<< simple\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex 10dc91620..e87164aa8 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -789,7 +789,7 @@ test_expect_success 'submodule add places git-dir in superprojects git-dir' '\n \t (cd .git/modules/deeper/submodule &&\n \t  git log > ../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -807,7 +807,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir' '\n \t (cd .git/modules/deeper/submodule &&\n \t  git log > ../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -827,7 +827,7 @@ test_expect_success 'submodule add places git-dir in superprojects git-dir recur\n \t git add deeper/submodule &&\n \t git commit -m \"update submodule\" &&\n \t git push origin : &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -874,7 +874,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re\n \t (cd .git/modules/submodule/modules/subsubmodule &&\n \t  git log > ../../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \ndiff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\nindex 668bbee73..562bd215a 100755\n--- a/t/t7800-difftool.sh\n+++ b/t/t7800-difftool.sh\n@@ -557,7 +557,7 @@ test_expect_success SYMLINKS 'difftool --dir-diff --symlink without unstaged cha\n \tEOF\n \tgit difftool --dir-diff --symlink \\\n \t\t--extcmd \"./.git/CHECK_SYMLINKS\" branch HEAD &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n write_script modify-right-file <<\\EOF\ndiff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh\nindex 9af607884..2c309a57d 100755\n--- a/t/t9100-git-svn-basic.sh\n+++ b/t/t9100-git-svn-basic.sh\n@@ -221,7 +221,7 @@ tree d667270a1f7b109f5eb3aaea21ede14b56bfdd6e\n tree 8f51f74cf0163afc9ad68a4b1537288c4558b5a4\n EOF\n \n-test_expect_success POSIXPERM,SYMLINKS \"$name\" \"test_cmp a expected\"\n+test_expect_success POSIXPERM,SYMLINKS \"$name\" \"test_cmp expected a\"\n \n test_expect_success 'exit if remote refs are ambigious' '\n         git config --add svn-remote.svn.fetch \\\ndiff --git a/t/t9133-git-svn-nested-git-repo.sh b/t/t9133-git-svn-nested-git-repo.sh\nindex f3c30e63b..f89486086 100755\n--- a/t/t9133-git-svn-nested-git-repo.sh\n+++ b/t/t9133-git-svn-nested-git-repo.sh\n@@ -45,7 +45,7 @@ test_expect_success 'update git svn-cloned repo' '\n \t\tgit svn rebase &&\n \t\techo a > expect &&\n \t\techo b >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\n@@ -69,7 +69,7 @@ test_expect_success 'update git svn-cloned repo' '\n \t\tgit svn rebase &&\n \t\techo a > expect &&\n \t\techo b >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\n@@ -93,7 +93,7 @@ test_expect_success 'update git svn-cloned repo again' '\n \t\techo a > expect &&\n \t\techo b >> expect &&\n \t\techo c >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\ndiff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh\nindex 5dfee07d9..251fdd66c 100755\n--- a/t/t9600-cvsimport.sh\n+++ b/t/t9600-cvsimport.sh\n@@ -148,7 +148,7 @@ test_expect_success PERL 'import from a CVS working tree' '\n \t\tgit cvsimport -a -z0 &&\n \t\techo 1 >expect &&\n \t\tgit log -1 --pretty=format:%s%n >actual &&\n-\t\ttest_cmp actual expect\n+\t\ttest_cmp expect actual\n \t)\n \n '\ndiff --git a/t/t9603-cvsimport-patchsets.sh b/t/t9603-cvsimport-patchsets.sh\nindex c4c3c4954..3e64b11ea 100755\n--- a/t/t9603-cvsimport-patchsets.sh\n+++ b/t/t9603-cvsimport-patchsets.sh\n@@ -29,11 +29,11 @@ test_expect_failure PERL 'import with criss cross times on revisions' '\n Rev 3\n Rev 2\n Rev 1\" > expect-master &&\n-    test_cmp actual-master expect-master &&\n+    test_cmp expect-master actual-master &&\n \n     echo \"Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000\n Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000\" > expect-A &&\n-    test_cmp actual-A expect-A\n+    test_cmp expect-A actual-A\n '\n \n test_done\ndiff --git a/t/t9604-cvsimport-timestamps.sh b/t/t9604-cvsimport-timestamps.sh\nindex a4b3db24b..2ff4aa932 100755\n--- a/t/t9604-cvsimport-timestamps.sh\n+++ b/t/t9604-cvsimport-timestamps.sh\n@@ -31,7 +31,7 @@ test_expect_success PERL 'check timestamps are UTC (TZ=CST6CDT)' '\n \tRev  2 2005-02-01 00:00:00 +0000\n \tRev  1 2005-01-01 00:00:00 +0000\n \tEOF\n-\ttest_cmp actual-1 expect-1\n+\ttest_cmp expect-1 actual-1\n '\n \n test_expect_success PERL 'check timestamps with author-specific timezones' '\n@@ -65,7 +65,7 @@ test_expect_success PERL 'check timestamps with author-specific timezones' '\n \tRev  2 2005-01-31 18:00:00 -0600 User Two\n \tRev  1 2005-01-01 00:00:00 +0000 User One\n \tEOF\n-\ttest_cmp actual-2 expect-2\n+\ttest_cmp expect-2 actual-2\n '\n \n test_done\n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358363","messageId":"44ee2bd27b510d4216525e24aa1734a1f5edbd95.1537222670.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1537222670.git.matvore@google.com","subject":"[PATCH v2 4/6] tests: Add linter check for pipe placement style","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-17T22:24:20Z","receivedAt":"2018-09-17T22:25:09Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"---\n t/Makefile | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)\n\ndiff --git a/t/Makefile b/t/Makefile\nindex c83fd1886..4eceabbd5 100644\n--- a/t/Makefile\n+++ b/t/Makefile\n@@ -78,7 +78,7 @@ check-chainlint:\n \tdone && exit $$err\n \n test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \\\n-\ttest-lint-filenames\n+\ttest-lint-filenames test-lint-pipes\n \n test-lint-duplicates:\n \t@dups=`echo $(T) | tr ' ' '\\n' | sed 's/-.*//' | sort | uniq -d` && \\\n@@ -101,6 +101,16 @@ test-lint-filenames:\n \t\ttest -z \"$$bad\" || { \\\n \t\techo >&2 \"non-portable file name(s): $$bad\"; exit 1; }\n \n+test-lint-pipes:\n+\t@# Do not use \\ to join lines when the next line starts with a\n+\t@# pipe. Instead, end the prior line with the pipe, and allow that to\n+\t@# join the lines implicitly.\n+\t@bad=\"$$(${PERL_PATH} -n0e 'm/(\\n[^\\n|]+\\\\\\n[\\t ]+\\|[^\\n]*)/ and \\\n+\t      print qq{$$ARGV:$$1\\n\\n}' $(T))\"; \\\n+\t\ttest -z \"$$bad\" || { \\\n+\t\tprintf >&2 \"pipe at start of line in file(s):\\n%s\\n\" \"$$bad\"; \\\n+\t\texit 1; }\n+\n aggregate-results-and-cleanup: $(T)\n \t$(MAKE) aggregate-results\n \t$(MAKE) clean\n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358364","messageId":"e4b548c65e93e5de70e043114a9a54bdc25160d4.1537223021.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1537223021.git.matvore@google.com","subject":"[PATCH v2 4/6] tests: add linter check for pipe placement style","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-17T22:24:21Z","receivedAt":"2018-09-17T22:25:12Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"---\n t/Makefile | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)\n\ndiff --git a/t/Makefile b/t/Makefile\nindex c83fd1886..4eceabbd5 100644\n--- a/t/Makefile\n+++ b/t/Makefile\n@@ -78,7 +78,7 @@ check-chainlint:\n \tdone && exit $$err\n \n test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \\\n-\ttest-lint-filenames\n+\ttest-lint-filenames test-lint-pipes\n \n test-lint-duplicates:\n \t@dups=`echo $(T) | tr ' ' '\\n' | sed 's/-.*//' | sort | uniq -d` && \\\n@@ -101,6 +101,16 @@ test-lint-filenames:\n \t\ttest -z \"$$bad\" || { \\\n \t\techo >&2 \"non-portable file name(s): $$bad\"; exit 1; }\n \n+test-lint-pipes:\n+\t@# Do not use \\ to join lines when the next line starts with a\n+\t@# pipe. Instead, end the prior line with the pipe, and allow that to\n+\t@# join the lines implicitly.\n+\t@bad=\"$$(${PERL_PATH} -n0e 'm/(\\n[^\\n|]+\\\\\\n[\\t ]+\\|[^\\n]*)/ and \\\n+\t      print qq{$$ARGV:$$1\\n\\n}' $(T))\"; \\\n+\t\ttest -z \"$$bad\" || { \\\n+\t\tprintf >&2 \"pipe at start of line in file(s):\\n%s\\n\" \"$$bad\"; \\\n+\t\texit 1; }\n+\n aggregate-results-and-cleanup: $(T)\n \t$(MAKE) aggregate-results\n \t$(MAKE) clean\n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358365","messageId":"12cc68aabf76e08f6214b21df786e61301c8f55e.1537223021.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1537223021.git.matvore@google.com","subject":"[PATCH v2 5/6] tests: split up pipes","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-17T22:24:22Z","receivedAt":"2018-09-17T22:25:16Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Some pipes in tests lose the exit code of git processes, which can mask\nunexpected behavior. Split these pipes up so that git commands are at\nthe end of pipes rather than the beginning or middle.\n---\n t/t5317-pack-objects-filter-objects.sh | 156 +++++++++++++------------\n t/t5500-fetch-pack.sh                  |   6 +-\n t/t5616-partial-clone.sh               |  14 ++-\n t/t6112-rev-list-filters-objects.sh    | 103 ++++++++--------\n t/t9101-git-svn-props.sh               |   3 +-\n 5 files changed, 147 insertions(+), 135 deletions(-)\n\ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex c093eb891..2e718f0bd 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -20,8 +20,9 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r1 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -29,8 +30,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r1 index-pack ../all.pack &&\n \n-\tgit -C r1 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r1 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -43,8 +44,8 @@ test_expect_success 'verify blob:none packfile has no blobs' '\n \tEOF\n \tgit -C r1 index-pack ../filter.pack &&\n \n-\tgit -C r1 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r1 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -53,13 +54,13 @@ test_expect_success 'verify blob:none packfile has no blobs' '\n '\n \n test_expect_success 'verify normal and blob:none packfiles have same commits/trees' '\n-\tgit -C r1 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r1 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r1 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r1 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -82,8 +83,8 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -91,8 +92,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r2 index-pack ../all.pack &&\n \n-\tgit -C r2 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -105,8 +106,8 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -120,8 +121,8 @@ test_expect_success 'verify blob:limit=1000' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -130,8 +131,8 @@ test_expect_success 'verify blob:limit=1000' '\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.1000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1001 >filter.pack <<-EOF &&\n@@ -139,8 +140,8 @@ test_expect_success 'verify blob:limit=1001' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -148,8 +149,8 @@ test_expect_success 'verify blob:limit=1001' '\n '\n \n test_expect_success 'verify blob:limit=10001' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=10001 >filter.pack <<-EOF &&\n@@ -157,8 +158,8 @@ test_expect_success 'verify blob:limit=10001' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -166,8 +167,8 @@ test_expect_success 'verify blob:limit=10001' '\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.1000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n@@ -175,8 +176,8 @@ test_expect_success 'verify blob:limit=1k' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -184,8 +185,8 @@ test_expect_success 'verify blob:limit=1k' '\n '\n \n test_expect_success 'verify explicitly specifying oversized blob in input' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n@@ -194,8 +195,8 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -203,8 +204,8 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1m >filter.pack <<-EOF &&\n@@ -212,8 +213,8 @@ test_expect_success 'verify blob:limit=1m' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -221,13 +222,13 @@ test_expect_success 'verify blob:limit=1m' '\n '\n \n test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '\n-\tgit -C r2 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r2 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -255,8 +256,9 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r3 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -264,8 +266,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r3 index-pack ../all.pack &&\n \n-\tgit -C r3 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r3 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -273,8 +275,8 @@ test_expect_success 'verify blob count in normal packfile' '\n '\n \n test_expect_success 'verify sparse:path=pattern1' '\n-\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&\n@@ -282,8 +284,8 @@ test_expect_success 'verify sparse:path=pattern1' '\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -291,13 +293,13 @@ test_expect_success 'verify sparse:path=pattern1' '\n '\n \n test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -305,8 +307,8 @@ test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same\n '\n \n test_expect_success 'verify sparse:path=pattern2' '\n-\tgit -C r3 ls-files -s sparse1 dir1/sparse1 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse1 dir1/sparse1 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&\n@@ -314,8 +316,8 @@ test_expect_success 'verify sparse:path=pattern2' '\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -323,13 +325,13 @@ test_expect_success 'verify sparse:path=pattern2' '\n '\n \n test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -356,8 +358,9 @@ test_expect_success 'setup r4' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r4 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -365,8 +368,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r4 index-pack ../all.pack &&\n \n-\tgit -C r4 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r4 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -374,8 +377,8 @@ test_expect_success 'verify blob count in normal packfile' '\n '\n \n test_expect_success 'verify sparse:oid=OID' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \toid=$(git -C r4 ls-files -s pattern | awk -f print_2.awk) &&\n@@ -384,8 +387,8 @@ test_expect_success 'verify sparse:oid=OID' '\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n \n-\tgit -C r4 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r4 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -393,8 +396,8 @@ test_expect_success 'verify sparse:oid=OID' '\n '\n \n test_expect_success 'verify sparse:oid=oid-ish' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r4 pack-objects --rev --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&\n@@ -402,8 +405,8 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n \n-\tgit -C r4 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r4 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -414,8 +417,9 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'setup r1 - delete loose blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tfor id in `cat expected | sed \"s|..|&/|\"`\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 5ac6f286d..086f2c40f 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -51,8 +51,10 @@ pull_to_client () {\n \t\t\t    git update-ref refs/heads/B \"$BTIP\";;\n \t\t\tesac &&\n \n-\t\t\tgit symbolic-ref HEAD refs/heads/$(echo $heads |\n-\t\t\tsed -e \"s/^\\(.\\).*$/\\1/\") &&\n+\t\t\tgit symbolic-ref HEAD refs/heads/$(\n+\t\t\t\techo $heads |\n+\t\t\t\tsed -e \"s/^\\(.\\).*$/\\1/\"\n+\t\t\t) &&\n \n \t\t\tgit fsck --full &&\n \ndiff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\nindex e4d032c9d..fc7aeb1ab 100755\n--- a/t/t5616-partial-clone.sh\n+++ b/t/t5616-partial-clone.sh\n@@ -35,8 +35,8 @@ test_expect_success 'setup bare clone for server' '\n test_expect_success 'do partial clone 1' '\n \tgit clone --no-checkout --filter=blob:none \"file://$(pwd)/srv.bare\" pc1 &&\n \n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print |\n-\tawk -f print_1.awk |\n+\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n \n@@ -133,16 +133,18 @@ test_expect_success 'push new commits to server for file.3.txt' '\n test_expect_success 'manual prefetch of missing objects' '\n \tgit -C pc1 fetch --filter=blob:none origin &&\n \n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n-\tawk -f print_1.awk |\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n+\t\t>revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n \n \ttest_line_count = 6 observed.oids &&\n \tgit -C pc1 fetch-pack --stdin \"file://$(pwd)/srv.bare\" <observed.oids &&\n \n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n-\tawk -f print_1.awk |\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n+\t\t>revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n \ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex ae4402226..b00cf6fa8 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -20,12 +20,13 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob:none omits all 5 blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -33,12 +34,13 @@ test_expect_success 'verify blob:none omits all 5 blobs' '\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r1 rev-list HEAD --objects |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list HEAD --objects >revs &&\n+\tawk -f print_1.awk revs |\n \tsort >expected &&\n \n-\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none \\\n+\t\t>revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -62,12 +64,12 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob:limit=500 omits all blobs' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -75,12 +77,12 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r2 rev-list HEAD --objects |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --objects >revs &&\n+\tawk -f print_1.awk revs |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -88,12 +90,12 @@ test_expect_success 'verify emitted+omitted == all' '\n '\n \n test_expect_success 'verify blob:limit=1000' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -101,12 +103,12 @@ test_expect_success 'verify blob:limit=1000' '\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -114,12 +116,12 @@ test_expect_success 'verify blob:limit=1001' '\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -127,8 +129,8 @@ test_expect_success 'verify blob:limit=1k' '\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -156,12 +158,12 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse1 sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -169,12 +171,12 @@ test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n '\n \n test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n-\tgit -C r3 ls-files -s sparse2 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse2 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -192,14 +194,14 @@ test_expect_success 'setup r3 part 2' '\n '\n \n test_expect_success 'verify sparse:oid=OID omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \toid=$(git -C r3 ls-files -s pattern | awk -f print_2.awk) &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -207,12 +209,12 @@ test_expect_success 'verify sparse:oid=OID omits top-level files' '\n '\n \n test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -223,8 +225,9 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'rev-list W/ --missing=print' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tfor id in `cat expected | sed \"s|..|&/|\"`\n@@ -232,8 +235,8 @@ test_expect_success 'rev-list W/ --missing=print' '\n \t\trm r1/.git/objects/$id\n \tdone &&\n \n-\tgit -C r1 rev-list --quiet HEAD --missing=print --objects |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list --quiet HEAD --missing=print --objects >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed &&\n \ndiff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\nindex 8a5c8dc1a..8cba331fc 100755\n--- a/t/t9101-git-svn-props.sh\n+++ b/t/t9101-git-svn-props.sh\n@@ -174,7 +174,8 @@ test_expect_success 'test create-ignore' \"\n \tcmp ./deeply/.gitignore create-ignore.expect &&\n \tcmp ./deeply/nested/.gitignore create-ignore.expect &&\n \tcmp ./deeply/nested/directory/.gitignore create-ignore.expect &&\n-\tgit ls-files -s | grep gitignore | cmp - create-ignore-index.expect\n+\tgit ls-files -s >ls_files_result &&\n+\tgrep gitignore ls_files_result | cmp - create-ignore-index.expect\n \t\"\n \n cat >prop.expect <<\\EOF\n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358366","messageId":"e01b719de662f0b150f78b5a6ab6ccfce9c675fa.1537223021.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1537223021.git.matvore@google.com","subject":"[PATCH v2 6/6] t9109-git-svn-props.sh: split up several pipes","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-17T22:24:23Z","receivedAt":"2018-09-17T22:25:16Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"A test uses several separate pipe sequences in a row which are awkward\nto split up. Wrap the split-up pipe in a function so the awkwardness is\nnot repeated.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/t9101-git-svn-props.sh | 21 +++++++++++++--------\n 1 file changed, 13 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\nindex 8cba331fc..952bd4814 100755\n--- a/t/t9101-git-svn-props.sh\n+++ b/t/t9101-git-svn-props.sh\n@@ -190,16 +190,21 @@ EOF\n # This test can be improved: since all the svn:ignore contain the same\n # pattern, it can pass even though the propget did not execute on the\n # right directory.\n+# Note we avoid using pipes in order to ensure that git exits with 0.\n test_expect_success 'test propget' \"\n-\tgit svn propget svn:ignore . | cmp - prop.expect &&\n+\ttest_propget () {\n+\t\tgit svn propget $1 $2 >observed\n+\t\tcmp - $3\n+\t} &&\n+\ttest_propget svn:ignore . prop.expect &&\n \tcd deeply &&\n-\tgit svn propget svn:ignore . | cmp - ../prop.expect &&\n-\tgit svn propget svn:entry:committed-rev nested/directory/.keep \\\n-\t  | cmp - ../prop2.expect &&\n-\tgit svn propget svn:ignore .. | cmp - ../prop.expect &&\n-\tgit svn propget svn:ignore nested/ | cmp - ../prop.expect &&\n-\tgit svn propget svn:ignore ./nested | cmp - ../prop.expect &&\n-\tgit svn propget svn:ignore .././deeply/nested | cmp - ../prop.expect\n+\ttest_propget svn:ignore . ../prop.expect &&\n+\ttest_propget svn:entry:committed-rev nested/directory/.keep \\\n+\t\t../prop2.expect &&\n+\ttest_propget svn:ignore .. ../prop.expect &&\n+\ttest_propget svn:ignore nested/ ../prop.expect &&\n+\ttest_propget svn:ignore ./nested ../prop.expect &&\n+\ttest_propget svn:ignore .././deeply/nested ../prop.expect\n \t\"\n \n cat >prop.expect <<\\EOF\n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358372","messageId":"CAPig+cSzddcS+8mx=GMbJ5BP+=fPtza+7UdA5ugN+83NuOHyiw@mail.gmail.com","threadId":"49352","inReplyTo":"c625bfe2205d51b3158ef71e4bf472708642c146.1537223021.git.matvore@google.com","subject":"Re: [PATCH v2 1/6] CodingGuidelines: add shell piping guidelines","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-09-18T00:16:46Z","receivedAt":"2018-09-18T00:17:01Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Sep 17, 2018 at 6:24 PM Matthew DeVore <matvore@google.com> wrote:\n> diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\n> @@ -163,6 +163,35 @@ For shell scripts specifically (not exhaustive):\n> + - In a piped sequence which spans multiple lines, put each statement\n> +   on a separate line and put pipes on the end of each line, rather\n> +   than the start. This means you don't need to use \\ to join lines,\n> +   since | implies a join already. Also, do not indent subsequent\n> +   lines; if you need a sequence to visually stand apart from the\n> +   surrounding code, use a blank line before and/or after the piped\n> +   sequence.\n> +\n> +       (incorrect)\n> +       [...]\n> +       (correct)\n> +       echo '...' > expected\n\nExisting tests seem to favor the name \"expect\" over \"expected\", so\nperhaps use that instead.\n\n    $ git grep '>expect\\b' -- t | wc -l\n    2674\n    $ git grep '>expected\\b' -- t | wc -l\n    1406\n\n> +       git ls-files -s file.1 file.2 file.3 file.4 file.5 |\n> +       awk '{print $1}' |\n> +       sort >observed\n\nThis is not a great example since it flatly contradicts the very next\nbit of advice added by this patch about not placing a Git command\nupstream in a pipe. Perhaps come up with an example which doesn't\nsuffer this shortcoming.\n\nI've seen the advice earlier in the thread of not indenting the\nsub-commands in a pipe, but I find that the result makes it far more\ndifficult to see which commands are part of the pipe sequence than\nwith them indented, so I'm not convinced that this advice should be in\nthe guidelines. (But that just my opinion.)\n\n> + - In a pipe, any non-zero exit codes returned by processes besides\n> +   the last will be ignored. If there is any possibility some\n> +   non-final command in the pipe will raise an error, prefer writing\n> +   the output of that command to a temporary file with '>' rather than\n> +   pipe it.\n\nIt's not so much that we care about losing a non-zero exit code (which\nmight be perfectly acceptable depending upon the context) but that we\ncare about missing a Git command which outright crashes. So, it might\nmake sense to make this text more specific by saying that (\"exit code\nindicating a crash\" and \"Git command\") rather than being generic in\nsaying only \"exit code\" and \"command\".\n\nAlso, what about expression like $(git foo) by which a crash of a Git\ncommand can also be lost? Do we want to talk about that, as well?\n"},{"id":"358373","messageId":"CAPig+cTO=BJ+-6+73fDmdWX7axCZvsyKMxE0E1bhGX-YUFrR-w@mail.gmail.com","threadId":"49352","inReplyTo":"44ee2bd27b510d4216525e24aa1734a1f5edbd95.1537222670.git.matvore@google.com","subject":"Re: [PATCH v2 4/6] tests: Add linter check for pipe placement style","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-09-18T00:34:07Z","receivedAt":"2018-09-18T00:34:21Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Sep 17, 2018 at 6:25 PM Matthew DeVore <matvore@google.com> wrote:\n> tests: Add linter check for pipe placement style\n\nUntil now, the various \"lint\" checks have been for genuine portability\nproblems (except perhaps 'test-lint-duplicates'). This new lint check\nmakes style violations worthy of failing \"make test\". Is the indeed\nthe direction we want to go? (Genuine question. I can formulate\narguments for either side.)\n\n> ---\n> diff --git a/t/Makefile b/t/Makefile\n> @@ -101,6 +101,16 @@ test-lint-filenames:\n> +test-lint-pipes:\n> +       @# Do not use \\ to join lines when the next line starts with a\n> +       @# pipe. Instead, end the prior line with the pipe, and allow that to\n> +       @# join the lines implicitly.\n> +       @bad=\"$$(${PERL_PATH} -n0e 'm/(\\n[^\\n|]+\\\\\\n[\\t ]+\\|[^\\n]*)/ and \\\n> +             print qq{$$ARGV:$$1\\n\\n}' $(T))\"; \\\n> +               test -z \"$$bad\" || { \\\n> +               printf >&2 \"pipe at start of line in file(s):\\n%s\\n\" \"$$bad\"; \\\n> +               exit 1; }\n\nIf we're going in the direction of linting style violations, then\nmaybe generalize this by calling it \"test-lint-style\" rather than\n\"test-lint-pipes\", and perhaps move the body of the test to a new\nscript check-shell-style.pl (or something), much as portability\nviolations are housed in check-non-portable-shell.pl.\n"},{"id":"358374","messageId":"CAPig+cQchHoWffobw3iGrsmRRPx2LKNu+EvR=t4c5RcV9Cmi9g@mail.gmail.com","threadId":"49352","inReplyTo":"12cc68aabf76e08f6214b21df786e61301c8f55e.1537223021.git.matvore@google.com","subject":"Re: [PATCH v2 5/6] tests: split up pipes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-09-18T01:30:13Z","receivedAt":"2018-09-18T01:30:28Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Sep 17, 2018 at 6:25 PM Matthew DeVore <matvore@google.com> wrote:\n> tests: split up pipes\n\nThis title explains the mechanical changes the patch is making but not\nthe intent. Perhaps reword it to say something like:\n\n    tests: avoid swallowing Git exit code upstream of a pipe\n\n> Some pipes in tests lose the exit code of git processes, which can mask\n> unexpected behavior. Split these pipes up so that git commands are at\n> the end of pipes rather than the beginning or middle.\n\nCan you say something about how you chose which tests to fix in this\npatch? Is this fixing all such cases or only a subset? It looks like\nit's only fixing \"ls-files\" and \"verify-pack\" invocations. If that's\nthe case, the commit message should explain that.\n\nAlso, missing sign-off.\n\n> ---\n> diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\n> @@ -51,8 +51,10 @@ pull_to_client () {\n> -                       git symbolic-ref HEAD refs/heads/$(echo $heads |\n> -                       sed -e \"s/^\\(.\\).*$/\\1/\") &&\n> +                       git symbolic-ref HEAD refs/heads/$(\n> +                               echo $heads |\n> +                               sed -e \"s/^\\(.\\).*$/\\1/\"\n> +                       ) &&\n\nWhy is this change included in the patch? There is no Git invocation\nupstream of a pipe here. While the cleanup itself may be desirable, it\ndoesn't belong in this patch.\n"},{"id":"358376","messageId":"CAPig+cT5BLu2onbuTBbZ_mMzNMkEuPk5-g2d5YKw4V6Z42Y3aQ@mail.gmail.com","threadId":"49352","inReplyTo":"e01b719de662f0b150f78b5a6ab6ccfce9c675fa.1537223021.git.matvore@google.com","subject":"Re: [PATCH v2 6/6] t9109-git-svn-props.sh: split up several pipes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-09-18T01:56:55Z","receivedAt":"2018-09-18T01:57:10Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Sep 17, 2018 at 6:25 PM Matthew DeVore <matvore@google.com> wrote:\n> t9109-git-svn-props.sh: split up several pipes\n\nSimilar to my comment about 5/6, this title talks about the mechanical\nchanges made by the patch but not the intent. Perhaps reword it like\nthis:\n\n    t9109: avoid swallowing Git exit code upstream of a pipe\n\n> A test uses several separate pipe sequences in a row which are awkward\n> to split up. Wrap the split-up pipe in a function so the awkwardness is\n> not repeated.\n>\n> Signed-off-by: Matthew DeVore <matvore@google.com>\n> ---\n> diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\n> @@ -190,16 +190,21 @@ EOF\n> +# Note we avoid using pipes in order to ensure that git exits with 0.\n\nThis new comment doesn't really add value for someone reading the\npatch without knowing the history leading up to the point the comment\nwas added. It should probably be dropped. (The actual text of the\ncomment is rather confusing anyhow since avoiding pipes has nothing to\ndo with ensuring that git exits with 0, thus another reason why this\ncomment ought to be dropped.)\n\n>  test_expect_success 'test propget' \"\n> -       git svn propget svn:ignore . | cmp - prop.expect &&\n> +       test_propget () {\n> +               git svn propget $1 $2 >observed\n\nThe &&-chain is broken here, which means you're losing the exit status\nfrom the Git command anyhow (despite the point of the patch being to\navoid losing it).\n\nAlso, for consistency, how about calling this \"actual\" rather than \"observed\"?\n\n> +               cmp - $3\n\nThis is just wrong. The \"-\" argument to 'cmp' says to read from\nstandard input, but there is nothing being passed to 'cmp' on standard\ninput anymore now that you're removed the pipe. I'm guessing that you\nreally meant to use \"observed\" here (and reverse the order of\narguments to be consistent with the expect-then-actual idiom).\nFinally, since these (apparently) might be binary, you can use\ntest_cmp_bin() instead.\n\n> +       } &&\n> +       test_propget svn:ignore . prop.expect &&\n>         cd deeply &&\n> -       git svn propget svn:ignore . | cmp - ../prop.expect &&\n> -       git svn propget svn:entry:committed-rev nested/directory/.keep \\\n> -         | cmp - ../prop2.expect &&\n> -       git svn propget svn:ignore .. | cmp - ../prop.expect &&\n> -       git svn propget svn:ignore nested/ | cmp - ../prop.expect &&\n> -       git svn propget svn:ignore ./nested | cmp - ../prop.expect &&\n> -       git svn propget svn:ignore .././deeply/nested | cmp - ../prop.expect\n> +       test_propget svn:ignore . ../prop.expect &&\n> +       test_propget svn:entry:committed-rev nested/directory/.keep \\\n> +               ../prop2.expect &&\n> +       test_propget svn:ignore .. ../prop.expect &&\n> +       test_propget svn:ignore nested/ ../prop.expect &&\n> +       test_propget svn:ignore ./nested ../prop.expect &&\n> +       test_propget svn:ignore .././deeply/nested ../prop.expect\n>         \"\n\nAfter this patch, the test is even more broken than appears at first\nglance since the test body is inside double-quotes. This means that\nthe $1, $2, $3 inside the test_propget() function are getting expanded\n_before_ the function itself is ever defined, to whatever bogus values\n$1, $2, $3 hold at that point. I can't see how this could ever have\nworked (except only appearing to work by pure accident).\n"},{"id":"358436","messageId":"CAMfpvhKejvbgzwtTv93iqLG8fMxqZW_MRTAU0q9bDArqJU2zUg@mail.gmail.com","threadId":"49352","inReplyTo":"CAPig+cSzddcS+8mx=GMbJ5BP+=fPtza+7UdA5ugN+83NuOHyiw@mail.gmail.com","subject":"Re: [PATCH v2 1/6] CodingGuidelines: add shell piping guidelines","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-19T02:11:34Z","receivedAt":"2018-09-19T02:11:49Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Mon, Sep 17, 2018 at 5:16 PM Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> On Mon, Sep 17, 2018 at 6:24 PM Matthew DeVore <matvore@google.com> wrote:\n> > diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\n> > @@ -163,6 +163,35 @@ For shell scripts specifically (not exhaustive):\n> > + - In a piped sequence which spans multiple lines, put each statement\n> > +   on a separate line and put pipes on the end of each line, rather\n> > +   than the start. This means you don't need to use \\ to join lines,\n> > +   since | implies a join already. Also, do not indent subsequent\n> > +   lines; if you need a sequence to visually stand apart from the\n> > +   surrounding code, use a blank line before and/or after the piped\n> > +   sequence.\n> > +\n> > +       (incorrect)\n> > +       [...]\n> > +       (correct)\n> > +       echo '...' > expected\n>\n> Existing tests seem to favor the name \"expect\" over \"expected\", so\n> perhaps use that instead.\n>\n>     $ git grep '>expect\\b' -- t | wc -l\n>     2674\n>     $ git grep '>expected\\b' -- t | wc -l\n>     1406\nThank you for clarifying that out for me, but I'm not longer using\nthat example, so it's moot.\n\n>\n> > +       git ls-files -s file.1 file.2 file.3 file.4 file.5 |\n> > +       awk '{print $1}' |\n> > +       sort >observed\n>\n> This is not a great example since it flatly contradicts the very next\n> bit of advice added by this patch about not placing a Git command\n> upstream in a pipe. Perhaps come up with an example which doesn't\n> suffer this shortcoming.\nDone.\n\n>\n> I've seen the advice earlier in the thread of not indenting the\n> sub-commands in a pipe, but I find that the result makes it far more\n> difficult to see which commands are part of the pipe sequence than\n> with them indented, so I'm not convinced that this advice should be in\n> the guidelines. (But that just my opinion.)\nI'm not totally sure either way, nor do I have a strong opinion. I\nagree it's probably better to not codify this in the documentation\nuntil there's a great reason to.\n\n>\n> > + - In a pipe, any non-zero exit codes returned by processes besides\n> > +   the last will be ignored. If there is any possibility some\n> > +   non-final command in the pipe will raise an error, prefer writing\n> > +   the output of that command to a temporary file with '>' rather than\n> > +   pipe it.\n>\n> It's not so much that we care about losing a non-zero exit code (which\n> might be perfectly acceptable depending upon the context) but that we\n> care about missing a Git command which outright crashes. So, it might\n> make sense to make this text more specific by saying that (\"exit code\n> indicating a crash\" and \"Git command\") rather than being generic in\n> saying only \"exit code\" and \"command\".\nFixed.\n\n>\n> Also, what about expression like $(git foo) by which a crash of a Git\n> command can also be lost? Do we want to talk about that, as well?\nYes, it's probably better to add a point about that. Here is the new\ndocumentation after applying your suggestions:\n\n - If a piped sequence which spans multiple lines, put each statement\n   on a separate line and put pipes on the end of each line, rather\n   than the start. This means you don't need to use \\ to join lines,\n   since | implies a join already.\n\n        (incorrect)\n        grep blob verify_pack_result \\\n        | awk -f print_1.awk \\\n        | sort >actual &&\n        ...\n\n        (correct)\n        grep blob verify_pack_result |\n        awk -f print_1.awk |\n        sort >actual &&\n        ...\n\n - In a pipe, any exit codes returned by processes besides the last\n   are ignored. This means that if git crashes at the beginning or\n   middle of a pipe, it may go undetected. Prefer writing the output\n   of that command to a temporary file with '>' rather than pipe it.\n\n - The $(git ...) construct also discards git's exit code, so if the\n   goal is to test that particular command, redirect its output to a\n   temporary file rather than wrap it with $( ).\n"},{"id":"358437","messageId":"CAMfpvh+0_x4UbPHK9jJoeN6rgZOS7F6iq7u_LRMP0YssMOZynw@mail.gmail.com","threadId":"49352","inReplyTo":"CAPig+cQchHoWffobw3iGrsmRRPx2LKNu+EvR=t4c5RcV9Cmi9g@mail.gmail.com","subject":"Re: [PATCH v2 5/6] tests: split up pipes","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-19T02:33:15Z","receivedAt":"2018-09-19T02:33:30Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Mon, Sep 17, 2018 at 6:30 PM Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> On Mon, Sep 17, 2018 at 6:25 PM Matthew DeVore <matvore@google.com> wrote:\n> > tests: split up pipes\n>\n> This title explains the mechanical changes the patch is making but not\n> the intent. Perhaps reword it to say something like:\n>\n>     tests: avoid swallowing Git exit code upstream of a pipe\n>\n> > Some pipes in tests lose the exit code of git processes, which can mask\n> > unexpected behavior. Split these pipes up so that git commands are at\n> > the end of pipes rather than the beginning or middle.\n>\n> Can you say something about how you chose which tests to fix in this\n> patch? Is this fixing all such cases or only a subset? It looks like\n> it's only fixing \"ls-files\" and \"verify-pack\" invocations. If that's\n> the case, the commit message should explain that.\n>\n> Also, missing sign-off.\nFixed - here is the new commit message (I changed the wording of your\nheader to fit within 50 chars):\n\n    tests: don't swallow Git errors upstream of pipes\n\n    Some pipes in tests lose the exit code of git processes, which can mask\n    unexpected behavior like crashes. Split these pipes up so that git\n    commands are only at the end of pipes rather than the beginning or\n    middle.\n\n    The violations fixed in this patch were found in the process of fixing\n    pipe placement in a prior patch.\n\n    Signed-off-by: Matthew DeVore <matvore@google.com>\n\n>\n> > ---\n> > diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\n> > @@ -51,8 +51,10 @@ pull_to_client () {\n> > -                       git symbolic-ref HEAD refs/heads/$(echo $heads |\n> > -                       sed -e \"s/^\\(.\\).*$/\\1/\") &&\n> > +                       git symbolic-ref HEAD refs/heads/$(\n> > +                               echo $heads |\n> > +                               sed -e \"s/^\\(.\\).*$/\\1/\"\n> > +                       ) &&\n>\n> Why is this change included in the patch? There is no Git invocation\n> upstream of a pipe here. While the cleanup itself may be desirable, it\n> doesn't belong in this patch.\nThis actually should have been part of the \"tests: standardize pipe\nplacement\" patch, but I did \"git commit --fixup=SHA\" with the wrong\nSHA. Fixed.\n"},{"id":"358438","messageId":"CAMfpvhJ3ye_7LWaQ1abXKtMB=O1sfOz6xYN=7acrVdLOksq9eA@mail.gmail.com","threadId":"49352","inReplyTo":"CAPig+cT5BLu2onbuTBbZ_mMzNMkEuPk5-g2d5YKw4V6Z42Y3aQ@mail.gmail.com","subject":"Re: [PATCH v2 6/6] t9109-git-svn-props.sh: split up several pipes","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-19T02:56:29Z","receivedAt":"2018-09-19T02:56:44Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Mon, Sep 17, 2018 at 6:57 PM Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> On Mon, Sep 17, 2018 at 6:25 PM Matthew DeVore <matvore@google.com> wrote:\n> > t9109-git-svn-props.sh: split up several pipes\n>\n> Similar to my comment about 5/6, this title talks about the mechanical\n> changes made by the patch but not the intent. Perhaps reword it like\n> this:\n>\n>     t9109: avoid swallowing Git exit code upstream of a pipe\n>\nHere is my new commit description:\n\n    t9109: don't swallow Git errors upstream of pipe\n\n    'git ... | foo' will mask any errors or crashes in git, so split up such\n    pipes.\n\n    One testcase uses several separate pipe sequences in a row which are\n    awkward to split up. Wrap the split-up pipe in a function so the\n    awkwardness is not repeated.\n\n    Signed-off-by: Matthew DeVore <matvore@google.com>\n\n> > diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\n> > @@ -190,16 +190,21 @@ EOF\n> > +# Note we avoid using pipes in order to ensure that git exits with 0.\n>\n> This new comment doesn't really add value for someone reading the\n> patch without knowing the history leading up to the point the comment\n> was added. It should probably be dropped. (The actual text of the\n> comment is rather confusing anyhow since avoiding pipes has nothing to\n> do with ensuring that git exits with 0, thus another reason why this\n> comment ought to be dropped.)\nYes, this comment was worded quite poorly. I've removed it since I\nagree it doesn't add a lot of value.\n\n>\n> >  test_expect_success 'test propget' \"\n> > -       git svn propget svn:ignore . | cmp - prop.expect &&\n> > +       test_propget () {\n> > +               git svn propget $1 $2 >observed\n>\n> The &&-chain is broken here, which means you're losing the exit status\n> from the Git command anyhow (despite the point of the patch being to\n> avoid losing it).\nFixed.\n\n>\n> Also, for consistency, how about calling this \"actual\" rather than \"observed\"?\nDone.\n\n>\n> > +               cmp - $3\n>\n> This is just wrong. The \"-\" argument to 'cmp' says to read from\n> standard input, but there is nothing being passed to 'cmp' on standard\n> input anymore now that you're removed the pipe. I'm guessing that you\n> really meant to use \"observed\" here (and reverse the order of\n> arguments to be consistent with the expect-then-actual idiom).\n> Finally, since these (apparently) might be binary, you can use\n> test_cmp_bin() instead.\nFixed, except for the test_cmp_bin part. My understanding is that git\nsvn propget is supposed to be printing human-readable strings. My\nunderstanding is based soley on this page:\nhttp://svnbook.red-bean.com/en/1.6/svn.ref.svn.c.propget.html\n\n>\n> > +       } &&\n> > +       test_propget svn:ignore . prop.expect &&\n> >         cd deeply &&\n> > -       git svn propget svn:ignore . | cmp - ../prop.expect &&\n> > -       git svn propget svn:entry:committed-rev nested/directory/.keep \\\n> > -         | cmp - ../prop2.expect &&\n> > -       git svn propget svn:ignore .. | cmp - ../prop.expect &&\n> > -       git svn propget svn:ignore nested/ | cmp - ../prop.expect &&\n> > -       git svn propget svn:ignore ./nested | cmp - ../prop.expect &&\n> > -       git svn propget svn:ignore .././deeply/nested | cmp - ../prop.expect\n> > +       test_propget svn:ignore . ../prop.expect &&\n> > +       test_propget svn:entry:committed-rev nested/directory/.keep \\\n> > +               ../prop2.expect &&\n> > +       test_propget svn:ignore .. ../prop.expect &&\n> > +       test_propget svn:ignore nested/ ../prop.expect &&\n> > +       test_propget svn:ignore ./nested ../prop.expect &&\n> > +       test_propget svn:ignore .././deeply/nested ../prop.expect\n> >         \"\n>\n> After this patch, the test is even more broken than appears at first\n> glance since the test body is inside double-quotes. This means that\n> the $1, $2, $3 inside the test_propget() function are getting expanded\n> _before_ the function itself is ever defined, to whatever bogus values\n> $1, $2, $3 hold at that point. I can't see how this could ever have\n> worked (except only appearing to work by pure accident).\nFixed, and here is the new test:\n\ntest_expect_success 'test propget' \"\n        test_propget () {\n                git svn propget \\$1 \\$2 >actual &&\n                cmp \\$3 actual\n        } &&\n        test_propget svn:ignore . prop.expect &&\n        cd deeply &&\n        test_propget svn:ignore . ../prop.expect &&\n        test_propget svn:entry:committed-rev nested/directory/.keep \\\n                ../prop2.expect &&\n        test_propget svn:ignore .. ../prop.expect &&\n        test_propget svn:ignore nested/ ../prop.expect &&\n        test_propget svn:ignore ./nested ../prop.expect &&\n        test_propget svn:ignore .././deeply/nested ../prop.expect\n        \"\n\nI confirmed that git's exit code is being checked by putting \"!\" in\nfront of git and making sure the test failed. I made sure that\n\"actual\" was actually being compared and the exit code of \"cmp\" was\nchecked by adding \"echo foo >> actual &&\" before cmp, and again making\nsure the test failed. This test should be well-formed now.\n"},{"id":"358444","messageId":"CAPig+cRmeyEsa_GXe6q6uh=O-GD6b=jE3ZkX-+UwzeL_HvrLoQ@mail.gmail.com","threadId":"49352","inReplyTo":"CAMfpvhKejvbgzwtTv93iqLG8fMxqZW_MRTAU0q9bDArqJU2zUg@mail.gmail.com","subject":"Re: [PATCH v2 1/6] CodingGuidelines: add shell piping guidelines","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-09-19T12:36:05Z","receivedAt":"2018-09-19T12:36:19Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Sep 18, 2018 at 10:11 PM Matthew DeVore <matvore@google.com> wrote:\n> Yes, it's probably better to add a point about that. Here is the new\n> documentation after applying your suggestions:\n>\n>  - If a piped sequence which spans multiple lines, put each statement\n\ns/which//\n\n>    on a separate line and put pipes on the end of each line, rather\n>    than the start. This means you don't need to use \\ to join lines,\n>    since | implies a join already.\n>         [...]\n>  - In a pipe, any exit codes returned by processes besides the last\n>    are ignored. This means that if git crashes at the beginning or\n>    middle of a pipe, it may go undetected. Prefer writing the output\n>    of that command to a temporary file with '>' rather than pipe it.\n>\n>  - The $(git ...) construct also discards git's exit code, so if the\n>    goal is to test that particular command, redirect its output to a\n>    temporary file rather than wrap it with $( ).\n\nThis all sounds better.\n"},{"id":"358445","messageId":"CAPig+cQ3M+Wtyrm_GGRhL7kgM0eWPsXanK-AbLtJiQsORJ3A5A@mail.gmail.com","threadId":"49352","inReplyTo":"CAMfpvhJ3ye_7LWaQ1abXKtMB=O1sfOz6xYN=7acrVdLOksq9eA@mail.gmail.com","subject":"Re: [PATCH v2 6/6] t9109-git-svn-props.sh: split up several pipes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-09-19T12:50:21Z","receivedAt":"2018-09-19T12:50:35Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Sep 18, 2018 at 10:56 PM Matthew DeVore <matvore@google.com> wrote:\n> On Mon, Sep 17, 2018 at 6:57 PM Eric Sunshine <sunshine@sunshineco.com> wrote:\n> > On Mon, Sep 17, 2018 at 6:25 PM Matthew DeVore <matvore@google.com> wrote:\n> > > +               cmp - $3\n> >\n> > This is just wrong. The \"-\" argument to 'cmp' says to read from\n> > standard input, but there is nothing being passed to 'cmp' on standard\n> > input anymore now that you're removed the pipe. I'm guessing that you\n> > really meant to use \"observed\" here (and reverse the order of\n> > arguments to be consistent with the expect-then-actual idiom).\n> > Finally, since these (apparently) might be binary, you can use\n> > test_cmp_bin() instead.\n> Fixed, except for the test_cmp_bin part. My understanding is that git\n> svn propget is supposed to be printing human-readable strings.\n\nIf so, then please use test_cmp() rather than raw 'cmp' since\ntest_cmp() will show the actual difference between the expected and\nactual files, which can be helpful when diagnosing a failing test.\n\n> > After this patch, the test is even more broken than appears at first\n> > glance since the test body is inside double-quotes. This means that\n> > the $1, $2, $3 inside the test_propget() function are getting expanded\n> > _before_ the function itself is ever defined, to whatever bogus values\n> > $1, $2, $3 hold at that point. I can't see how this could ever have\n> > worked (except only appearing to work by pure accident).\n> Fixed, and here is the new test:\n>\n> test_expect_success 'test propget' \"\n>         test_propget () {\n>                 git svn propget \\$1 \\$2 >actual &&\n>                 cmp \\$3 actual\n>         } &&\n\nRather than escaping \"$\" with backslash, a cleaner fix would be to\nchange the double quotes around the test body to single quotes. Those\ndouble quotes weren't needed anyhow since there are no variable\ninterpolations in the body. Single quotes would make that obvious at a\nglance in addition to avoiding unexpected behavior in the future (like\n$1, $2, etc. being interpolated at the wrong time). Single quotes\nwould also make the test more idiomatic and consistent with the bulk\nof other tests in the suite. If you do go the route of swapping\nquotes, please be sure to mention the change in the commit message.\n\nThanks.\n"},{"id":"358448","messageId":"xmqqo9ct4lap.fsf@gitster-ct.c.googlers.com","threadId":"49352","inReplyTo":"CAMfpvhKejvbgzwtTv93iqLG8fMxqZW_MRTAU0q9bDArqJU2zUg@mail.gmail.com","subject":"Re: [PATCH v2 1/6] CodingGuidelines: add shell piping guidelines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-09-19T14:24:46Z","receivedAt":"2018-09-19T14:24:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthew DeVore <matvore@google.com> writes:\n\n> Yes, it's probably better to add a point about that. Here is the new\n> documentation after applying your suggestions:\n>\n>  - If a piped sequence which spans multiple lines, put each statement\n>    on a separate line and put pipes on the end of each line, rather\n>    than the start. This means you don't need to use \\ to join lines,\n>    since | implies a join already.\n>\n>         (incorrect)\n>         grep blob verify_pack_result \\\n>         | awk -f print_1.awk \\\n>         | sort >actual &&\n>         ...\n>\n>         (correct)\n>         grep blob verify_pack_result |\n>         awk -f print_1.awk |\n>         sort >actual &&\n>         ...\n\nThe formatting advice to place '|' at the end applies equally to\n'&&' and '||' because these three syntactic elements share exactly\nthe same trait: the shell knows you haven't finished speaking when\nit sees them at the end of the line and keeps listening, and humans\nwould know that too, so there is no need for explicitly continuing\nthe line with backslash.\n\nOrganizationally speaking, I wonder if the above about formatting\nwould better appear separate from the latter two points that are\nabout semantics.\n\n>  - In a pipe, any exit codes returned by processes besides the last\n>    are ignored. This means that if git crashes at the beginning or\n>    middle of a pipe, it may go undetected. Prefer writing the output\n>    of that command to a temporary file with '>' rather than pipe it.\n>\n>  - The $(git ...) construct also discards git's exit code, so if the\n>    goal is to test that particular command, redirect its output to a\n>    temporary file rather than wrap it with $( ).\n"},{"id":"358468","messageId":"CAMfpvhJ21ZtpjcJvOH7s=5r496z4Fz+tw94ymGD54xe=0RJ8Eg@mail.gmail.com","threadId":"49352","inReplyTo":"CAPig+cTO=BJ+-6+73fDmdWX7axCZvsyKMxE0E1bhGX-YUFrR-w@mail.gmail.com","subject":"Re: [PATCH v2 4/6] tests: Add linter check for pipe placement style","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-19T17:39:03Z","receivedAt":"2018-09-19T17:39:19Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Mon, Sep 17, 2018 at 5:34 PM Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> On Mon, Sep 17, 2018 at 6:25 PM Matthew DeVore <matvore@google.com> wrote:\n> > tests: Add linter check for pipe placement style\n>\n> Until now, the various \"lint\" checks have been for genuine portability\n> problems (except perhaps 'test-lint-duplicates'). This new lint check\n> makes style violations worthy of failing \"make test\". Is the indeed\n> the direction we want to go? (Genuine question. I can formulate\n> arguments for either side.)\n>\n> > ---\n> > diff --git a/t/Makefile b/t/Makefile\n> > @@ -101,6 +101,16 @@ test-lint-filenames:\n> > +test-lint-pipes:\n> > +       @# Do not use \\ to join lines when the next line starts with a\n> > +       @# pipe. Instead, end the prior line with the pipe, and allow that to\n> > +       @# join the lines implicitly.\n> > +       @bad=\"$$(${PERL_PATH} -n0e 'm/(\\n[^\\n|]+\\\\\\n[\\t ]+\\|[^\\n]*)/ and \\\n> > +             print qq{$$ARGV:$$1\\n\\n}' $(T))\"; \\\n> > +               test -z \"$$bad\" || { \\\n> > +               printf >&2 \"pipe at start of line in file(s):\\n%s\\n\" \"$$bad\"; \\\n> > +               exit 1; }\n>\n> If we're going in the direction of linting style violations, then\n> maybe generalize this by calling it \"test-lint-style\" rather than\n> \"test-lint-pipes\", and perhaps move the body of the test to a new\n> script check-shell-style.pl (or something), much as portability\n> violations are housed in check-non-portable-shell.pl.\n\nI agree with moving this code to a separate file. I also notice that\nthere is logic in a file called t/chainlint.sed which normalizes\nscripts for the purpose of lint checks (e.g. it removes heredocs) and\nI ought to be re-using this logic in order to make the new lint check\nrobust.\n\nI think I'd like to shelve this particular commit and come back to it\nonce I have the time and I'm more familiar with the code base. It is\nnot critical to this patchset.\n"},{"id":"358474","messageId":"CAMfpvh+BO_7z_K52jNupLMmx-gbNSwJzfswVQeNsPWVx7onTEw@mail.gmail.com","threadId":"49352","inReplyTo":"CAPig+cQ3M+Wtyrm_GGRhL7kgM0eWPsXanK-AbLtJiQsORJ3A5A@mail.gmail.com","subject":"Re: [PATCH v2 6/6] t9109-git-svn-props.sh: split up several pipes","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-19T18:43:05Z","receivedAt":"2018-09-19T18:43:20Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Wed, Sep 19, 2018 at 5:50 AM Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> If so, then please use test_cmp() rather than raw 'cmp' since\n> test_cmp() will show the actual difference between the expected and\n> actual files, which can be helpful when diagnosing a failing test.\n>\nAll the other testcases in this file use \"cmp\" and I would prefer to\nmaintain the consistency in this file. Note that the non-stylistic\nfixes (breaking up pipes) in this test were originally not the goal of\nthis patchset, so changing this entire file to use test_cmp (or even\njust a single testcase) seems like it's just getting even farther away\nfrom the original goal of making pipe placement consistent in the code\nbase.\n\n> Rather than escaping \"$\" with backslash, a cleaner fix would be to\n> change the double quotes around the test body to single quotes. Those\n> double quotes weren't needed anyhow since there are no variable\n> interpolations in the body. Single quotes would make that obvious at a\n> glance in addition to avoiding unexpected behavior in the future (like\n> $1, $2, etc. being interpolated at the wrong time). Single quotes\n> would also make the test more idiomatic and consistent with the bulk\n> of other tests in the suite. If you do go the route of swapping\n> quotes, please be sure to mention the change in the commit message.\nDone. I thought of that earlier and thought that I should use double\nquotes for consistency with the surrounding code, but then I saw that\nthere were testcases farther away in the same file that used single\nquotes.\n\nHere is the new commit message:\n\nt9109: don't swallow Git errors upstream of pipes\n\n'git ... | foo' will mask any errors or crashes in git, so split up such\npipes in this file.\n\nOne testcase uses several separate pipe sequences in a row which are\nawkward to split up. Wrap the split-up pipe in a function so the\nawkwardness is not repeated. Also change that testcase's surrounding\nquotes from double to single to avoid premature string interpolation.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n\n>\n> Thanks.\nThank you!\n"},{"id":"358484","messageId":"CAMfpvhLYjmb4kF8tObAiROtcDHfpah0J=Y1KhUHZnvFoyK6sgA@mail.gmail.com","threadId":"49352","inReplyTo":"xmqqo9ct4lap.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v2 1/6] CodingGuidelines: add shell piping guidelines","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-19T20:06:27Z","receivedAt":"2018-09-19T20:06:41Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Wed, Sep 19, 2018 at 5:36 AM Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> On Tue, Sep 18, 2018 at 10:11 PM Matthew DeVore <matvore@google.com> wrote:\n> > Yes, it's probably better to add a point about that. Here is the new\n> > documentation after applying your suggestions:\n> >\n> >  - If a piped sequence which spans multiple lines, put each statement\n>\n> s/which//\nDone.\n\nOn Wed, Sep 19, 2018 at 7:24 AM Junio C Hamano <gitster@pobox.com> wrote:\n> The formatting advice to place '|' at the end applies equally to\n> '&&' and '||' because these three syntactic elements share exactly\n> the same trait: the shell knows you haven't finished speaking when\n> it sees them at the end of the line and keeps listening, and humans\n> would know that too, so there is no need for explicitly continuing\n> the line with backslash.\n>\nI've reworded the text to indicate the advice applies to && and || as well.\n\n> Organizationally speaking, I wonder if the above about formatting\n> would better appear separate from the latter two points that are\n> about semantics.\n>\nI moved the formatting point to right under the point about formatting\nif statements, which does seem like a more natural progression.\n\nHere is the new patch to summarize the changes (warning: tabs are mangled):\n\n--------------------------------------------------------------------------------\n\n    CodingGuidelines: add shell piping guidelines\n\n    Add two guidelines:\n\n     - pipe characters should appear at the end of lines, and not cause\n       indentation\n     - pipes should be avoided when they swallow exit codes that can\n       potentially fail\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex 48aa4edfb..6d265327c 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -118,6 +118,24 @@ For shell scripts specifically (not exhaustive):\n                 do this\n         fi\n\n+ - If a command sequence joined with && or || or | spans multiple\n+   lines, put each command on a separate line and put && and || and |\n+   operators at the end of each line, rather than the start. This\n+   means you don't need to use \\ to join lines, since the above\n+   operators imply the sequence isn't finished.\n+\n+        (incorrect)\n+        grep blob verify_pack_result \\\n+        | awk -f print_1.awk \\\n+        | sort >actual &&\n+        ...\n+\n+        (correct)\n+        grep blob verify_pack_result |\n+        awk -f print_1.awk |\n+        sort >actual &&\n+        ...\n+\n  - We prefer \"test\" over \"[ ... ]\".\n\n  - We do not write the noiseword \"function\" in front of shell\n@@ -163,6 +181,15 @@ For shell scripts specifically (not exhaustive):\n\n    does not have such a problem.\n\n+ - In a piped chain such as \"grep blob objects | sort\", the exit codes\n+   returned by processes besides the last are ignored. This means that\n+   if git crashes at the beginning or middle of a chain, it may go\n+   undetected. Prefer writing the output of that command to a\n+   temporary file with '>' rather than pipe it.\n+\n+ - The $(git ...) construct also discards git's exit code, so if the\n+   goal is to test that particular command, redirect its output to a\n+   temporary file rather than wrap it with $( ).\n\n For C programs:\n"},{"id":"358545","messageId":"cover.1537493611.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1536969438.git.matvore@google.com","subject":"[PATCH v3 0/5] Clean up tests for test_cmp arg ordering and pipe placement","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-21T01:43:26Z","receivedAt":"2018-09-21T01:43:51Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Two of the commits have changed drastically (see second and third points below)\nso I'm sending this again.\n\nSummary of changes since last time:\n - Remove the hacky linter check which makes sure pipes are placed at the end of\n   the line in tests - I may add this back in a more polished form when I have\n   time.\n - Unbroke t9101 git-svn test which I had broken pretty badly in v2 of the\n   patchset.\n - Cleaned up and generalized the wording of the added points in\n   CodingGuidelines.\n\nThank you,\n\nMatthew DeVore (5):\n  CodingGuidelines: add shell piping guidelines\n  tests: standardize pipe placement\n  t/*: fix ordering of expected/observed arguments\n  tests: don't swallow Git errors upstream of pipes\n  t9109: don't swallow Git errors upstream of pipes\n\n Documentation/CodingGuidelines         |  27 ++\n t/lib-gpg.sh                           |   9 +-\n t/t0000-basic.sh                       |   2 +-\n t/t0021-conversion.sh                  |   4 +-\n t/t1006-cat-file.sh                    |   8 +-\n t/t1300-config.sh                      |   9 +-\n t/t1303-wacky-config.sh                |   4 +-\n t/t2101-update-index-reupdate.sh       |   2 +-\n t/t3200-branch.sh                      |   2 +-\n t/t3320-notes-merge-worktrees.sh       |   4 +-\n t/t3400-rebase.sh                      |   8 +-\n t/t3417-rebase-whitespace-fix.sh       |   6 +-\n t/t3702-add-edit.sh                    |   4 +-\n t/t3903-stash.sh                       |   8 +-\n t/t3905-stash-include-untracked.sh     |   2 +-\n t/t4025-hunk-header.sh                 |   2 +-\n t/t4117-apply-reject.sh                |   6 +-\n t/t4124-apply-ws-rule.sh               |  30 +--\n t/t4138-apply-ws-expansion.sh          |   2 +-\n t/t5317-pack-objects-filter-objects.sh | 360 ++++++++++++++-----------\n t/t5318-commit-graph.sh                |   2 +-\n t/t5500-fetch-pack.sh                  |   7 +-\n t/t5616-partial-clone.sh               |  30 ++-\n t/t5701-git-serve.sh                   |  14 +-\n t/t5702-protocol-v2.sh                 |  10 +-\n t/t6023-merge-file.sh                  |  12 +-\n t/t6027-merge-binary.sh                |   4 +-\n t/t6031-merge-filemode.sh              |   2 +-\n t/t6112-rev-list-filters-objects.sh    | 224 ++++++++-------\n t/t7201-co.sh                          |   4 +-\n t/t7406-submodule-update.sh            |   8 +-\n t/t7800-difftool.sh                    |   2 +-\n t/t9100-git-svn-basic.sh               |   2 +-\n t/t9101-git-svn-props.sh               |  34 ++-\n t/t9133-git-svn-nested-git-repo.sh     |   6 +-\n t/t9600-cvsimport.sh                   |   2 +-\n t/t9603-cvsimport-patchsets.sh         |   4 +-\n t/t9604-cvsimport-timestamps.sh        |   4 +-\n 38 files changed, 504 insertions(+), 366 deletions(-)\n\n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358546","messageId":"7dd9a1120726dee34aeebdfa4bf45a232c185500.1537493611.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1537493611.git.matvore@google.com","subject":"[PATCH v3 1/5] CodingGuidelines: add shell piping guidelines","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-21T01:43:27Z","receivedAt":"2018-09-21T01:43:53Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Add two guidelines:\n\n - pipe characters should appear at the end of lines, and not cause\n   indentation\n - pipes should be avoided when they swallow exit codes that can\n   potentially fail\n---\n Documentation/CodingGuidelines | 27 +++++++++++++++++++++++++++\n 1 file changed, 27 insertions(+)\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex 48aa4edfb..6d265327c 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -118,6 +118,24 @@ For shell scripts specifically (not exhaustive):\n \t\tdo this\n \tfi\n \n+ - If a command sequence joined with && or || or | spans multiple\n+   lines, put each command on a separate line and put && and || and |\n+   operators at the end of each line, rather than the start. This\n+   means you don't need to use \\ to join lines, since the above\n+   operators imply the sequence isn't finished.\n+\n+\t(incorrect)\n+\tgrep blob verify_pack_result \\\n+\t| awk -f print_1.awk \\\n+\t| sort >actual &&\n+\t...\n+\n+\t(correct)\n+\tgrep blob verify_pack_result |\n+\tawk -f print_1.awk |\n+\tsort >actual &&\n+\t...\n+\n  - We prefer \"test\" over \"[ ... ]\".\n \n  - We do not write the noiseword \"function\" in front of shell\n@@ -163,6 +181,15 @@ For shell scripts specifically (not exhaustive):\n \n    does not have such a problem.\n \n+ - In a piped chain such as \"grep blob objects | sort\", the exit codes\n+   returned by processes besides the last are ignored. This means that\n+   if git crashes at the beginning or middle of a chain, it may go\n+   undetected. Prefer writing the output of that command to a\n+   temporary file with '>' rather than pipe it.\n+\n+ - The $(git ...) construct also discards git's exit code, so if the\n+   goal is to test that particular command, redirect its output to a\n+   temporary file rather than wrap it with $( ).\n \n For C programs:\n \n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358547","messageId":"45251cefdeb1f099ff6c410b44d8fde3f33cd6c4.1537493611.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1537493611.git.matvore@google.com","subject":"[PATCH v3 2/5] tests: standardize pipe placement","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-21T01:43:28Z","receivedAt":"2018-09-21T01:43:56Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Instead of using a line-continuation and pipe on the second line, take\nadvantage of the shell's implicit line continuation after a pipe\ncharacter.  So for example, instead of\n\n\tsome long line \\\n\t\t| next line\n\nuse\n\n\tsome long line |\n\tnext line\n\nAnd add a blank line before and after the pipe where it aids readability\n(it usually does).\n\nThis better matches the coding style documented in\nDocumentation/CodingGuidelines and used in shell scripts elsewhere in\nthe tree.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/lib-gpg.sh                           |   9 +-\n t/t1006-cat-file.sh                    |   8 +-\n t/t1300-config.sh                      |   5 +-\n t/t5317-pack-objects-filter-objects.sh | 330 ++++++++++++++-----------\n t/t5500-fetch-pack.sh                  |   7 +-\n t/t5616-partial-clone.sh               |  32 ++-\n t/t6112-rev-list-filters-objects.sh    | 203 ++++++++-------\n 7 files changed, 344 insertions(+), 250 deletions(-)\n\ndiff --git a/t/lib-gpg.sh b/t/lib-gpg.sh\nindex 3fe02876c..f1277bef4 100755\n--- a/t/lib-gpg.sh\n+++ b/t/lib-gpg.sh\n@@ -57,9 +57,12 @@ then\n \t\techo | gpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null \\\n \t\t\t--passphrase-fd 0 --pinentry-mode loopback \\\n \t\t\t--import \"$TEST_DIRECTORY\"/lib-gpg/gpgsm_cert.p12 &&\n-\t\tgpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null -K \\\n-\t\t\t| grep fingerprint: | cut -d\" \" -f4 | tr -d '\\n' > \\\n-\t\t\t${GNUPGHOME}/trustlist.txt &&\n+\n+\t\tgpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null -K |\n+\t\tgrep fingerprint: |\n+\t\tcut -d\" \" -f4 |\n+\t\ttr -d '\\n' >\"${GNUPGHOME}/trustlist.txt\" &&\n+\n \t\techo \" S relax\" >> ${GNUPGHOME}/trustlist.txt &&\n \t\t(gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) &&\n \t\techo hello | gpgsm --homedir \"${GNUPGHOME}\" >/dev/null \\\ndiff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh\nindex 7f19d591f..a0fa926d3 100755\n--- a/t/t1006-cat-file.sh\n+++ b/t/t1006-cat-file.sh\n@@ -218,8 +218,8 @@ test_expect_success \"--batch-check for a non-existent hash\" '\n     test \"0000000000000000000000000000000000000042 missing\n 0000000000000000000000000000000000000084 missing\" = \\\n     \"$( ( echo 0000000000000000000000000000000000000042;\n-         echo_without_newline 0000000000000000000000000000000000000084; ) \\\n-       | git cat-file --batch-check)\"\n+         echo_without_newline 0000000000000000000000000000000000000084; ) |\n+       git cat-file --batch-check)\"\n '\n \n test_expect_success \"--batch for an existent and a non-existent hash\" '\n@@ -227,8 +227,8 @@ test_expect_success \"--batch for an existent and a non-existent hash\" '\n $tag_content\n 0000000000000000000000000000000000000000 missing\" = \\\n     \"$( ( echo $tag_sha1;\n-         echo_without_newline 0000000000000000000000000000000000000000; ) \\\n-       | git cat-file --batch)\"\n+         echo_without_newline 0000000000000000000000000000000000000000; ) |\n+       git cat-file --batch)\"\n '\n \n test_expect_success \"--batch-check for an empty line\" '\ndiff --git a/t/t1300-config.sh b/t/t1300-config.sh\nindex cdf1fed5d..5869d6cb6 100755\n--- a/t/t1300-config.sh\n+++ b/t/t1300-config.sh\n@@ -1770,8 +1770,9 @@ test_expect_success '--show-origin stdin with file include' '\n \tcat >expect <<-EOF &&\n \t\tfile:$INCLUDE_DIR/stdin.include\tinclude\n \tEOF\n-\techo \"[include]path=\\\"$INCLUDE_DIR\\\"/stdin.include\" \\\n-\t\t| git config --show-origin --includes --file - user.stdin >output &&\n+\techo \"[include]path=\\\"$INCLUDE_DIR\\\"/stdin.include\" |\n+\tgit config --show-origin --includes --file - user.stdin >output &&\n+\n \ttest_cmp expect output\n '\n \ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex 6710c8bc8..ce69148ec 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -20,17 +20,20 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r1 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r1 index-pack ../all.pack &&\n-\tgit -C r1 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -39,23 +42,27 @@ test_expect_success 'verify blob:none packfile has no blobs' '\n \tHEAD\n \tEOF\n \tgit -C r1 index-pack ../filter.pack &&\n-\tgit -C r1 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n \n test_expect_success 'verify normal and blob:none packfiles have same commits/trees' '\n-\tgit -C r1 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r1 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -75,17 +82,20 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../all.pack &&\n-\tgit -C r2 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -94,10 +104,12 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n@@ -107,99 +119,118 @@ test_expect_success 'verify blob:limit=1000' '\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.1000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1001 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=10001' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=10001 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.1000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify explicitly specifying oversized blob in input' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n \tHEAD\n \t$(git -C r2 rev-parse HEAD:large.10000)\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1m >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '\n-\tgit -C r2 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r2 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -224,71 +255,84 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../all.pack &&\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern1' '\n-\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern2' '\n-\tgit -C r3 ls-files -s sparse1 dir1/sparse1 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s sparse1 dir1/sparse1 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -312,48 +356,57 @@ test_expect_success 'setup r4' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r4 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../all.pack &&\n-\tgit -C r4 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=OID' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \toid=$(git -C r4 ls-files -s pattern | awk -f print_2.awk) &&\n \tgit -C r4 pack-objects --rev --stdout --filter=sparse:oid=$oid >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n-\tgit -C r4 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=oid-ish' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r4 pack-objects --rev --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n-\tgit -C r4 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -361,9 +414,10 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'setup r1 - delete loose blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tfor id in `cat expected | sed \"s|..|&/|\"`\n \tdo\n \t\trm r1/.git/objects/$id\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 1b5a4a6d3..086f2c40f 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -50,8 +50,11 @@ pull_to_client () {\n \t\t\tcase \"$heads\" in *B*)\n \t\t\t    git update-ref refs/heads/B \"$BTIP\";;\n \t\t\tesac &&\n-\t\t\tgit symbolic-ref HEAD refs/heads/$(echo $heads \\\n-\t\t\t\t| sed -e \"s/^\\(.\\).*$/\\1/\") &&\n+\n+\t\t\tgit symbolic-ref HEAD refs/heads/$(\n+\t\t\t\techo $heads |\n+\t\t\t\tsed -e \"s/^\\(.\\).*$/\\1/\"\n+\t\t\t) &&\n \n \t\t\tgit fsck --full &&\n \ndiff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\nindex bbbe7537d..e4d032c9d 100755\n--- a/t/t5616-partial-clone.sh\n+++ b/t/t5616-partial-clone.sh\n@@ -34,10 +34,12 @@ test_expect_success 'setup bare clone for server' '\n # confirm partial clone was registered in the local config.\n test_expect_success 'do partial clone 1' '\n \tgit clone --no-checkout --filter=blob:none \"file://$(pwd)/srv.bare\" pc1 &&\n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_cmp expect_1.oids observed.oids &&\n \ttest \"$(git -C pc1 config --local core.repositoryformatversion)\" = \"1\" &&\n \ttest \"$(git -C pc1 config --local extensions.partialclone)\" = \"origin\" &&\n@@ -130,16 +132,20 @@ test_expect_success 'push new commits to server for file.3.txt' '\n # perhaps combined with a command in dry-run mode.\n test_expect_success 'manual prefetch of missing objects' '\n \tgit -C pc1 fetch --filter=blob:none origin &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_line_count = 6 observed.oids &&\n \tgit -C pc1 fetch-pack --stdin \"file://$(pwd)/srv.bare\" <observed.oids &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_line_count = 0 observed.oids\n '\n \n@@ -194,7 +200,7 @@ test_expect_success 'upon cloning, check that all refs point to objects' '\n \n \t# Craft a packfile not including that blob.\n \tgit -C \"$SERVER\" rev-parse HEAD |\n-\t\tgit -C \"$SERVER\" pack-objects --stdout >incomplete.pack &&\n+\tgit -C \"$SERVER\" pack-objects --stdout >incomplete.pack &&\n \n \t# Replace the existing packfile with the crafted one. The protocol\n \t# requires that the packfile be sent in sideband 1, hence the extra\ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex d4ff0b3be..0f6b569e1 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -20,24 +20,28 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob:none omits all 5 blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r1 rev-list HEAD --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r1 rev-list HEAD --objects |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -58,65 +62,76 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob:limit=500 omits all blobs' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r2 rev-list HEAD --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 rev-list HEAD --objects |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1000' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_must_be_empty observed\n '\n \n@@ -141,24 +156,28 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n-\tgit -C r3 ls-files -s sparse2 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s sparse2 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -173,25 +192,30 @@ test_expect_success 'setup r3 part 2' '\n '\n \n test_expect_success 'verify sparse:oid=OID omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \toid=$(git -C r3 ls-files -s pattern | awk -f print_2.awk) &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -199,17 +223,20 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'rev-list W/ --missing=print' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tfor id in `cat expected | sed \"s|..|&/|\"`\n \tdo\n \t\trm r1/.git/objects/$id\n \tdone &&\n-\tgit -C r1 rev-list --quiet HEAD --missing=print --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 rev-list --quiet HEAD --missing=print --objects |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358548","messageId":"a563555db3170bb8bcaad29d84b80e43ae9c2217.1537493611.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1537493611.git.matvore@google.com","subject":"[PATCH v3 3/5] t/*: fix ordering of expected/observed arguments","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-21T01:43:29Z","receivedAt":"2018-09-21T01:43:59Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Fix various places where the ordering was obviously wrong, meaning it\nwas easy to find with grep.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/t0000-basic.sh                       |  2 +-\n t/t0021-conversion.sh                  |  4 +--\n t/t1300-config.sh                      |  4 +--\n t/t1303-wacky-config.sh                |  4 +--\n t/t2101-update-index-reupdate.sh       |  2 +-\n t/t3200-branch.sh                      |  2 +-\n t/t3320-notes-merge-worktrees.sh       |  4 +--\n t/t3400-rebase.sh                      |  8 +++---\n t/t3417-rebase-whitespace-fix.sh       |  6 ++---\n t/t3702-add-edit.sh                    |  4 +--\n t/t3903-stash.sh                       |  8 +++---\n t/t3905-stash-include-untracked.sh     |  2 +-\n t/t4025-hunk-header.sh                 |  2 +-\n t/t4117-apply-reject.sh                |  6 ++---\n t/t4124-apply-ws-rule.sh               | 30 +++++++++++------------\n t/t4138-apply-ws-expansion.sh          |  2 +-\n t/t5317-pack-objects-filter-objects.sh | 34 +++++++++++++-------------\n t/t5318-commit-graph.sh                |  2 +-\n t/t5701-git-serve.sh                   | 14 +++++------\n t/t5702-protocol-v2.sh                 | 10 ++++----\n t/t6023-merge-file.sh                  | 12 ++++-----\n t/t6027-merge-binary.sh                |  4 +--\n t/t6031-merge-filemode.sh              |  2 +-\n t/t6112-rev-list-filters-objects.sh    | 24 +++++++++---------\n t/t7201-co.sh                          |  4 +--\n t/t7406-submodule-update.sh            |  8 +++---\n t/t7800-difftool.sh                    |  2 +-\n t/t9100-git-svn-basic.sh               |  2 +-\n t/t9133-git-svn-nested-git-repo.sh     |  6 ++---\n t/t9600-cvsimport.sh                   |  2 +-\n t/t9603-cvsimport-patchsets.sh         |  4 +--\n t/t9604-cvsimport-timestamps.sh        |  4 +--\n 32 files changed, 112 insertions(+), 112 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex 850f651e4..224c098a8 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -1018,7 +1018,7 @@ test_expect_success SHA1 'validate git diff-files output for a know cache/work t\n :120000 120000 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c 0000000000000000000000000000000000000000 M\tpath3/subp3/file3sym\n EOF\n \tgit diff-files >current &&\n-\ttest_cmp current expected\n+\ttest_cmp expected current\n '\n \n test_expect_success 'git update-index --refresh should succeed' '\ndiff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh\nindex 308cd28f3..fd5f1ac64 100755\n--- a/t/t0021-conversion.sh\n+++ b/t/t0021-conversion.sh\n@@ -166,10 +166,10 @@ test_expect_success expanded_in_repo '\n \trm -f expanded-keywords expanded-keywords-crlf &&\n \n \tgit checkout -- expanded-keywords &&\n-\ttest_cmp expanded-keywords expected-output &&\n+\ttest_cmp expected-output expanded-keywords &&\n \n \tgit checkout -- expanded-keywords-crlf &&\n-\ttest_cmp expanded-keywords-crlf expected-output-crlf\n+\ttest_cmp expected-output-crlf expanded-keywords-crlf\n '\n \n # The use of %f in a filter definition is expanded to the path to\ndiff --git a/t/t1300-config.sh b/t/t1300-config.sh\nindex 5869d6cb6..e2cd50ecf 100755\n--- a/t/t1300-config.sh\n+++ b/t/t1300-config.sh\n@@ -1001,7 +1001,7 @@ EOF\n \n test_expect_success 'value continued on next line' '\n \tgit config --list > result &&\n-\ttest_cmp result expect\n+\ttest_cmp expect result\n '\n \n cat > .git/config <<\\EOF\n@@ -1882,7 +1882,7 @@ test_expect_success '--replace-all does not invent newlines' '\n \tQkey = b\n \tEOF\n \tgit config --replace-all abc.key b &&\n-\ttest_cmp .git/config expect\n+\ttest_cmp expect .git/config\n '\n \n test_done\ndiff --git a/t/t1303-wacky-config.sh b/t/t1303-wacky-config.sh\nindex 3b92083e1..0000e664e 100755\n--- a/t/t1303-wacky-config.sh\n+++ b/t/t1303-wacky-config.sh\n@@ -14,7 +14,7 @@ setup() {\n check() {\n \techo \"$2\" >expected\n \tgit config --get \"$1\" >actual 2>&1\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n }\n \n # 'check section.key regex value' verifies that the entry for\n@@ -22,7 +22,7 @@ check() {\n check_regex() {\n \techo \"$3\" >expected\n \tgit config --get \"$1\" \"$2\" >actual 2>&1\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n }\n \n test_expect_success 'modify same key' '\ndiff --git a/t/t2101-update-index-reupdate.sh b/t/t2101-update-index-reupdate.sh\nindex 685ec4563..6c32d42c8 100755\n--- a/t/t2101-update-index-reupdate.sh\n+++ b/t/t2101-update-index-reupdate.sh\n@@ -73,7 +73,7 @@ test_expect_success 'update-index --update from subdir' '\n \t100644 $(git hash-object dir1/file3) 0\tdir1/file3\n \t100644 $file2 0\tfile2\n \tEOF\n-\ttest_cmp current expected\n+\ttest_cmp expected current\n '\n \n test_expect_success 'update-index --update with pathspec' '\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex 93f21ab07..478b82cf9 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -1221,7 +1221,7 @@ test_expect_success 'use --edit-description' '\n \tEOF\n \tEDITOR=./editor git branch --edit-description &&\n \techo \"New contents\" >expect &&\n-\ttest_cmp EDITOR_OUTPUT expect\n+\ttest_cmp expect EDITOR_OUTPUT\n '\n \n test_expect_success 'detect typo in branch name when using --edit-description' '\ndiff --git a/t/t3320-notes-merge-worktrees.sh b/t/t3320-notes-merge-worktrees.sh\nindex 10bfc8b94..823fdbda1 100755\n--- a/t/t3320-notes-merge-worktrees.sh\n+++ b/t/t3320-notes-merge-worktrees.sh\n@@ -44,7 +44,7 @@ test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '\n \tgit config core.notesRef refs/notes/y &&\n \ttest_must_fail git notes merge z &&\n \techo \"ref: refs/notes/y\" >expect &&\n-\ttest_cmp .git/NOTES_MERGE_REF expect\n+\ttest_cmp expect .git/NOTES_MERGE_REF\n '\n \n test_expect_success 'merge z into y while mid-merge in another workdir fails' '\n@@ -66,7 +66,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '\n \t\tgrep -v \"A notes merge into refs/notes/x is already in-progress in\" out\n \t) &&\n \techo \"ref: refs/notes/x\" >expect &&\n-\ttest_cmp .git/worktrees/worktree2/NOTES_MERGE_REF expect\n+\ttest_cmp expect .git/worktrees/worktree2/NOTES_MERGE_REF\n '\n \n test_done\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 3996ee013..3e73f7584 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -183,13 +183,13 @@ test_expect_success 'cherry-picked commits and fork-point work together' '\n \ttest_commit final_B B \"Final B\" &&\n \tgit rebase &&\n \techo Amended >expect &&\n-\ttest_cmp A expect &&\n+\ttest_cmp expect A &&\n \techo \"Final B\" >expect &&\n-\ttest_cmp B expect &&\n+\ttest_cmp expect B &&\n \techo C >expect &&\n-\ttest_cmp C expect &&\n+\ttest_cmp expect C &&\n \techo D >expect &&\n-\ttest_cmp D expect\n+\ttest_cmp expect D\n '\n \n test_expect_success 'rebase -q is quiet' '\ndiff --git a/t/t3417-rebase-whitespace-fix.sh b/t/t3417-rebase-whitespace-fix.sh\nindex 1fb3e499b..e85cdc703 100755\n--- a/t/t3417-rebase-whitespace-fix.sh\n+++ b/t/t3417-rebase-whitespace-fix.sh\n@@ -55,7 +55,7 @@ test_expect_success 'blank line at end of file; extend at end of file' '\n \tgit add file &&\tgit commit -m second &&\n \tgit rebase --whitespace=fix HEAD^^ &&\n \tgit diff --exit-code HEAD^:file expect-first &&\n-\ttest_cmp file expect-second\n+\ttest_cmp expect-second file\n '\n \n # prepare third revision of \"file\"\n@@ -82,7 +82,7 @@ test_expect_success 'two blanks line at end of file; extend at end of file' '\n \tcp third file && git add file && git commit -m third &&\n \tgit rebase --whitespace=fix HEAD^^ &&\n \tgit diff --exit-code HEAD^:file expect-second &&\n-\ttest_cmp file expect-third\n+\ttest_cmp expect-third file\n '\n \n test_expect_success 'same, but do not remove trailing spaces' '\n@@ -120,7 +120,7 @@ test_expect_success 'at beginning of file' '\n \tdone >> file &&\n \tgit commit -m more file\t&&\n \tgit rebase --whitespace=fix HEAD^^ &&\n-\ttest_cmp file expect-beginning\n+\ttest_cmp expect-beginning file\n '\n \n test_done\ndiff --git a/t/t3702-add-edit.sh b/t/t3702-add-edit.sh\nindex c6af7f82b..6c676645d 100755\n--- a/t/t3702-add-edit.sh\n+++ b/t/t3702-add-edit.sh\n@@ -110,10 +110,10 @@ test_expect_success 'add -e' '\n \tcp second-part file &&\n \tgit add -e &&\n \ttest_cmp second-part file &&\n-\ttest_cmp orig-patch expected-patch &&\n+\ttest_cmp expected-patch orig-patch &&\n \tgit diff --cached >actual &&\n \tgrep -v index actual >out &&\n-\ttest_cmp out expected\n+\ttest_cmp expected out\n \n '\n \ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 6450bc669..cd216655b 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -36,7 +36,7 @@ EOF\n test_expect_success 'parents of stash' '\n \ttest $(git rev-parse stash^) = $(git rev-parse HEAD) &&\n \tgit diff stash^2..stash > output &&\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n '\n \n test_expect_success 'applying bogus stash does nothing' '\n@@ -210,9 +210,9 @@ test_expect_success 'stash branch' '\n \ttest refs/heads/stashbranch = $(git symbolic-ref HEAD) &&\n \ttest $(git rev-parse HEAD) = $(git rev-parse master^) &&\n \tgit diff --cached > output &&\n-\ttest_cmp output expect &&\n+\ttest_cmp expect output &&\n \tgit diff > output &&\n-\ttest_cmp output expect1 &&\n+\ttest_cmp expect1 output &&\n \tgit add file &&\n \tgit commit -m alternate\\ second &&\n \tgit diff master..stashbranch > output &&\n@@ -710,7 +710,7 @@ test_expect_success 'stash where working directory contains \"HEAD\" file' '\n \tgit diff-index --cached --quiet HEAD &&\n \ttest \"$(git rev-parse stash^)\" = \"$(git rev-parse HEAD)\" &&\n \tgit diff stash^..stash > output &&\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n '\n \n test_expect_success 'store called with invalid commit' '\ndiff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh\nindex 597b0637d..cc1c8a7bb 100755\n--- a/t/t3905-stash-include-untracked.sh\n+++ b/t/t3905-stash-include-untracked.sh\n@@ -142,7 +142,7 @@ test_expect_success 'stash save --include-untracked removed files' '\n \trm -f file &&\n \tgit stash save --include-untracked &&\n \techo 1 > expect &&\n-\ttest_cmp file expect\n+\ttest_cmp expect file\n '\n \n rm -f expect\ndiff --git a/t/t4025-hunk-header.sh b/t/t4025-hunk-header.sh\nindex fa44e7886..35578f2bb 100755\n--- a/t/t4025-hunk-header.sh\n+++ b/t/t4025-hunk-header.sh\n@@ -37,7 +37,7 @@ test_expect_success 'hunk header truncation with an overly long line' '\n \t\techo \" A $N$N$N$N$N$N$N$N$N2\" &&\n \t\techo \" L  $N$N$N$N$N$N$N$N$N1\"\n \t) >expected &&\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n \n '\n \ndiff --git a/t/t4117-apply-reject.sh b/t/t4117-apply-reject.sh\nindex d80187de9..f7de6f077 100755\n--- a/t/t4117-apply-reject.sh\n+++ b/t/t4117-apply-reject.sh\n@@ -72,7 +72,7 @@ test_expect_success 'apply with --reject should fail but update the file' '\n \trm -f file1.rej file2.rej &&\n \n \ttest_must_fail git apply --reject patch.1 &&\n-\ttest_cmp file1 expected &&\n+\ttest_cmp expected file1 &&\n \n \tcat file1.rej &&\n \ttest_path_is_missing file2.rej\n@@ -85,7 +85,7 @@ test_expect_success 'apply with --reject should fail but update the file' '\n \n \ttest_must_fail git apply --reject patch.2 >rejects &&\n \ttest_path_is_missing file1 &&\n-\ttest_cmp file2 expected &&\n+\ttest_cmp expected file2 &&\n \n \tcat file2.rej &&\n \ttest_path_is_missing file1.rej\n@@ -99,7 +99,7 @@ test_expect_success 'the same test with --verbose' '\n \n \ttest_must_fail git apply --reject --verbose patch.2 >rejects &&\n \ttest_path_is_missing file1 &&\n-\ttest_cmp file2 expected &&\n+\ttest_cmp expected file2 &&\n \n \tcat file2.rej &&\n \ttest_path_is_missing file1.rej\ndiff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh\nindex 7e32237a2..ff51e9e78 100755\n--- a/t/t4124-apply-ws-rule.sh\n+++ b/t/t4124-apply-ws-rule.sh\n@@ -313,9 +313,9 @@ test_expect_success 'applying beyond EOF requires one non-blank context line' '\n \t{ echo a; echo; } >one &&\n \tcp one expect &&\n \ttest_must_fail git apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \ttest_must_fail git apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'tons of blanks at EOF should not apply' '\n@@ -342,10 +342,10 @@ test_expect_success 'missing blank line at end with --whitespace=fix' '\n \tcp one saved-one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv saved-one one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'two missing blank lines at end with --whitespace=fix' '\n@@ -360,11 +360,11 @@ test_expect_success 'two missing blank lines at end with --whitespace=fix' '\n \tcp no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'missing blank line at end, insert before end, --whitespace=fix' '\n@@ -376,7 +376,7 @@ test_expect_success 'missing blank line at end, insert before end, --whitespace=\n \techo a >one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'shrink file with tons of missing blanks at end of file' '\n@@ -392,10 +392,10 @@ test_expect_success 'shrink file with tons of missing blanks at end of file' '\n \tcp no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv no-blank-lines one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'missing blanks at EOF must only match blank lines' '\n@@ -427,7 +427,7 @@ test_expect_success 'missing blank line should match context line with spaces' '\n \tgit add one &&\n \n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n sed -e's/Z//' >one <<EOF\n@@ -447,7 +447,7 @@ test_expect_success 'same, but with the --ignore-space-option' '\n \n \tgit checkout-index -f one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '\n@@ -464,7 +464,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '\n \tmv save-one one &&\n \n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'CR-LF line endings && add line && text=auto' '\n@@ -478,7 +478,7 @@ test_expect_success 'CR-LF line endings && add line && text=auto' '\n \tmv save-one one &&\n \techo \"one text=auto\" >.gitattributes &&\n \tgit apply patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'CR-LF line endings && change line && text=auto' '\n@@ -491,7 +491,7 @@ test_expect_success 'CR-LF line endings && change line && text=auto' '\n \tmv save-one one &&\n \techo \"one text=auto\" >.gitattributes &&\n \tgit apply patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'LF in repo, CRLF in worktree && change line && text=auto' '\n@@ -503,7 +503,7 @@ test_expect_success 'LF in repo, CRLF in worktree && change line && text=auto' '\n \techo \"one text=auto\" >.gitattributes &&\n \tgit -c core.eol=CRLF apply patch &&\n \tprintf \"b\\r\\n\" >expect &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'whitespace=fix to expand' '\ndiff --git a/t/t4138-apply-ws-expansion.sh b/t/t4138-apply-ws-expansion.sh\nindex 0ffe33fbe..3b636a63a 100755\n--- a/t/t4138-apply-ws-expansion.sh\n+++ b/t/t4138-apply-ws-expansion.sh\n@@ -114,7 +114,7 @@ for t in 1 2 3 4\n do\n \ttest_expect_success 'apply with ws expansion (t=$t)' '\n \t\tgit apply patch$t.patch &&\n-\t\ttest_cmp test-$t expect-$t\n+\t\ttest_cmp expect-$t test-$t\n \t'\n done\n \ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex ce69148ec..c093eb891 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -34,7 +34,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:none packfile has no blobs' '\n@@ -63,7 +63,7 @@ test_expect_success 'verify normal and blob:none packfiles have same commits/tre\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test blob:limit=<n>[kmg] filter.\n@@ -96,7 +96,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=500 omits all blobs' '\n@@ -144,7 +144,7 @@ test_expect_success 'verify blob:limit=1001' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=10001' '\n@@ -162,7 +162,7 @@ test_expect_success 'verify blob:limit=10001' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1k' '\n@@ -180,7 +180,7 @@ test_expect_success 'verify blob:limit=1k' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify explicitly specifying oversized blob in input' '\n@@ -199,7 +199,7 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1m' '\n@@ -217,7 +217,7 @@ test_expect_success 'verify blob:limit=1m' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '\n@@ -231,7 +231,7 @@ test_expect_success 'verify normal and blob:limit packfiles have same commits/tr\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:path=<path> filter.\n@@ -269,7 +269,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern1' '\n@@ -287,7 +287,7 @@ test_expect_success 'verify sparse:path=pattern1' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '\n@@ -301,7 +301,7 @@ test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern2' '\n@@ -319,7 +319,7 @@ test_expect_success 'verify sparse:path=pattern2' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '\n@@ -333,7 +333,7 @@ test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:oid=<oid-ish> filter.\n@@ -370,7 +370,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=OID' '\n@@ -389,7 +389,7 @@ test_expect_success 'verify sparse:oid=OID' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=oid-ish' '\n@@ -407,7 +407,7 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Delete some loose objects and use pack-objects, but WITHOUT any filtering.\ndiff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh\nindex 0c500f7ca..d6da3ce4e 100755\n--- a/t/t5318-commit-graph.sh\n+++ b/t/t5318-commit-graph.sh\n@@ -35,7 +35,7 @@ test_expect_success 'create commits and repack' '\n graph_git_two_modes() {\n \tgit -c core.commitGraph=true $1 >output\n \tgit -c core.commitGraph=false $1 >expect\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n }\n \n graph_git_behavior() {\ndiff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh\nindex 75ec79e6c..bf139e245 100755\n--- a/t/t5701-git-serve.sh\n+++ b/t/t5701-git-serve.sh\n@@ -16,7 +16,7 @@ test_expect_success 'test capability advertisement' '\n \n \tgit serve --advertise-capabilities >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'stateless-rpc flag does not list capabilities' '\n@@ -89,7 +89,7 @@ test_expect_success 'basics of ls-refs' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'basic ref-prefixes' '\n@@ -109,7 +109,7 @@ test_expect_success 'basic ref-prefixes' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'refs/heads prefix' '\n@@ -129,7 +129,7 @@ test_expect_success 'refs/heads prefix' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'peel parameter' '\n@@ -150,7 +150,7 @@ test_expect_success 'peel parameter' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'symrefs parameter' '\n@@ -171,7 +171,7 @@ test_expect_success 'symrefs parameter' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'sending server-options' '\n@@ -191,7 +191,7 @@ test_expect_success 'sending server-options' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'unexpected lines are not allowed in fetch request' '\ndiff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh\nindex 3beeed454..54727450b 100755\n--- a/t/t5702-protocol-v2.sh\n+++ b/t/t5702-protocol-v2.sh\n@@ -29,7 +29,7 @@ test_expect_success 'list refs with git:// using protocol v2' '\n \tgrep \"git< version 2\" log &&\n \n \tgit ls-remote --symref \"$GIT_DAEMON_URL/parent\" >expect &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'ref advertisment is filtered with ls-remote using protocol v2' '\n@@ -42,7 +42,7 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol\n \t$(git -C \"$daemon_parent\" rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'clone with git:// using protocol v2' '\n@@ -138,7 +138,7 @@ test_expect_success 'list refs with file:// using protocol v2' '\n \tgrep \"git< version 2\" log &&\n \n \tgit ls-remote --symref \"file://$(pwd)/file_parent\" >expect &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'ref advertisment is filtered with ls-remote using protocol v2' '\n@@ -151,7 +151,7 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol\n \t$(git -C file_parent rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'server-options are sent when using ls-remote' '\n@@ -164,7 +164,7 @@ test_expect_success 'server-options are sent when using ls-remote' '\n \t$(git -C file_parent rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect &&\n+\ttest_cmp expect actual &&\n \tgrep \"server-option=hello\" log &&\n \tgrep \"server-option=world\" log\n '\ndiff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh\nindex 20aee43f9..51ee887a7 100755\n--- a/t/t6023-merge-file.sh\n+++ b/t/t6023-merge-file.sh\n@@ -99,7 +99,7 @@ EOF\n printf \"propter nomen suum.\" >> expect.txt\n \n test_expect_success \"merge does not add LF away of change\" \\\n-\t\"test_cmp test3.txt expect.txt\"\n+\t\"test_cmp expect.txt test3.txt\"\n \n cp test.txt backup.txt\n test_expect_success \"merge with conflicts\" \\\n@@ -122,7 +122,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n \n-test_expect_success \"expected conflict markers\" \"test_cmp test.txt expect.txt\"\n+test_expect_success \"expected conflict markers\" \"test_cmp expect.txt test.txt\"\n \n cp backup.txt test.txt\n \n@@ -138,7 +138,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --ours\" \\\n-\t\"git merge-file --ours test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --ours test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n cat > expect.txt << EOF\n@@ -154,7 +154,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --theirs\" \\\n-\t\"git merge-file --theirs test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --theirs test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n cat > expect.txt << EOF\n@@ -171,7 +171,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --union\" \\\n-\t\"git merge-file --union test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --union test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n test_expect_success \"merge with conflicts, using -L\" \\\n@@ -195,7 +195,7 @@ virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n \n test_expect_success \"expected conflict markers, with -L\" \\\n-\t\"test_cmp test.txt expect.txt\"\n+\t\"test_cmp expect.txt test.txt\"\n \n sed \"s/ tu / TU /\" < new1.txt > new5.txt\n test_expect_success \"conflict in removed tail\" \\\ndiff --git a/t/t6027-merge-binary.sh b/t/t6027-merge-binary.sh\nindex 07735410b..4e6c7cb77 100755\n--- a/t/t6027-merge-binary.sh\n+++ b/t/t6027-merge-binary.sh\n@@ -45,7 +45,7 @@ test_expect_success resolve '\n \t\tfalse\n \telse\n \t\tgit ls-files -s >current\n-\t\ttest_cmp current expect\n+\t\ttest_cmp expect current\n \tfi\n '\n \n@@ -60,7 +60,7 @@ test_expect_success recursive '\n \t\tfalse\n \telse\n \t\tgit ls-files -s >current\n-\t\ttest_cmp current expect\n+\t\ttest_cmp expect current\n \tfi\n '\n \ndiff --git a/t/t6031-merge-filemode.sh b/t/t6031-merge-filemode.sh\nindex 7d06461f1..87741efad 100755\n--- a/t/t6031-merge-filemode.sh\n+++ b/t/t6031-merge-filemode.sh\n@@ -61,7 +61,7 @@ do_both_modes () {\n \t\tgit checkout -f a2 &&\n \t\ttest_must_fail git merge -s $strategy b2 &&\n \t\tgit ls-files -u >actual &&\n-\t\ttest_cmp actual expect &&\n+\t\ttest_cmp expect actual &&\n \t\tgit ls-files -s file2 | grep ^100755\n \t'\n \ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex 0f6b569e1..ae4402226 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -29,7 +29,7 @@ test_expect_success 'verify blob:none omits all 5 blobs' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n@@ -42,7 +42,7 @@ test_expect_success 'verify emitted+omitted == all' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n \n@@ -71,7 +71,7 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n@@ -84,7 +84,7 @@ test_expect_success 'verify emitted+omitted == all' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1000' '\n@@ -97,7 +97,7 @@ test_expect_success 'verify blob:limit=1000' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1001' '\n@@ -110,7 +110,7 @@ test_expect_success 'verify blob:limit=1001' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1k' '\n@@ -123,7 +123,7 @@ test_expect_success 'verify blob:limit=1k' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1m' '\n@@ -165,7 +165,7 @@ test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n@@ -178,7 +178,7 @@ test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:oid=<oid-ish> filter.\n@@ -203,7 +203,7 @@ test_expect_success 'verify sparse:oid=OID omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n@@ -216,7 +216,7 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Delete some loose objects and use rev-list, but WITHOUT any filtering.\n@@ -237,7 +237,7 @@ test_expect_success 'rev-list W/ --missing=print' '\n \tsed \"s/?//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'rev-list W/O --missing fails' '\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 324933acf..826987ca8 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -160,7 +160,7 @@ test_expect_success 'checkout -m with merge conflict' '\n \tgit diff master:one :3:uno |\n \tsed -e \"1,/^@@/d\" -e \"/^ /d\" -e \"s/^-/d/\" -e \"s/^+/a/\" >current &&\n \tfill d2 aT d7 aS >expect &&\n-\ttest_cmp current expect &&\n+\ttest_cmp expect current &&\n \tgit diff --cached two >current &&\n \ttest_must_be_empty current\n '\n@@ -174,7 +174,7 @@ test_expect_success 'format of merge conflict from checkout -m' '\n \n \tgit ls-files >current &&\n \tfill same two two two >expect &&\n-\ttest_cmp current expect &&\n+\ttest_cmp expect current &&\n \n \tcat <<-EOF >expect &&\n \t<<<<<<< simple\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex 10dc91620..e87164aa8 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -789,7 +789,7 @@ test_expect_success 'submodule add places git-dir in superprojects git-dir' '\n \t (cd .git/modules/deeper/submodule &&\n \t  git log > ../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -807,7 +807,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir' '\n \t (cd .git/modules/deeper/submodule &&\n \t  git log > ../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -827,7 +827,7 @@ test_expect_success 'submodule add places git-dir in superprojects git-dir recur\n \t git add deeper/submodule &&\n \t git commit -m \"update submodule\" &&\n \t git push origin : &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -874,7 +874,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re\n \t (cd .git/modules/submodule/modules/subsubmodule &&\n \t  git log > ../../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \ndiff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\nindex 668bbee73..562bd215a 100755\n--- a/t/t7800-difftool.sh\n+++ b/t/t7800-difftool.sh\n@@ -557,7 +557,7 @@ test_expect_success SYMLINKS 'difftool --dir-diff --symlink without unstaged cha\n \tEOF\n \tgit difftool --dir-diff --symlink \\\n \t\t--extcmd \"./.git/CHECK_SYMLINKS\" branch HEAD &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n write_script modify-right-file <<\\EOF\ndiff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh\nindex 9af607884..2c309a57d 100755\n--- a/t/t9100-git-svn-basic.sh\n+++ b/t/t9100-git-svn-basic.sh\n@@ -221,7 +221,7 @@ tree d667270a1f7b109f5eb3aaea21ede14b56bfdd6e\n tree 8f51f74cf0163afc9ad68a4b1537288c4558b5a4\n EOF\n \n-test_expect_success POSIXPERM,SYMLINKS \"$name\" \"test_cmp a expected\"\n+test_expect_success POSIXPERM,SYMLINKS \"$name\" \"test_cmp expected a\"\n \n test_expect_success 'exit if remote refs are ambigious' '\n         git config --add svn-remote.svn.fetch \\\ndiff --git a/t/t9133-git-svn-nested-git-repo.sh b/t/t9133-git-svn-nested-git-repo.sh\nindex f3c30e63b..f89486086 100755\n--- a/t/t9133-git-svn-nested-git-repo.sh\n+++ b/t/t9133-git-svn-nested-git-repo.sh\n@@ -45,7 +45,7 @@ test_expect_success 'update git svn-cloned repo' '\n \t\tgit svn rebase &&\n \t\techo a > expect &&\n \t\techo b >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\n@@ -69,7 +69,7 @@ test_expect_success 'update git svn-cloned repo' '\n \t\tgit svn rebase &&\n \t\techo a > expect &&\n \t\techo b >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\n@@ -93,7 +93,7 @@ test_expect_success 'update git svn-cloned repo again' '\n \t\techo a > expect &&\n \t\techo b >> expect &&\n \t\techo c >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\ndiff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh\nindex 5dfee07d9..251fdd66c 100755\n--- a/t/t9600-cvsimport.sh\n+++ b/t/t9600-cvsimport.sh\n@@ -148,7 +148,7 @@ test_expect_success PERL 'import from a CVS working tree' '\n \t\tgit cvsimport -a -z0 &&\n \t\techo 1 >expect &&\n \t\tgit log -1 --pretty=format:%s%n >actual &&\n-\t\ttest_cmp actual expect\n+\t\ttest_cmp expect actual\n \t)\n \n '\ndiff --git a/t/t9603-cvsimport-patchsets.sh b/t/t9603-cvsimport-patchsets.sh\nindex c4c3c4954..3e64b11ea 100755\n--- a/t/t9603-cvsimport-patchsets.sh\n+++ b/t/t9603-cvsimport-patchsets.sh\n@@ -29,11 +29,11 @@ test_expect_failure PERL 'import with criss cross times on revisions' '\n Rev 3\n Rev 2\n Rev 1\" > expect-master &&\n-    test_cmp actual-master expect-master &&\n+    test_cmp expect-master actual-master &&\n \n     echo \"Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000\n Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000\" > expect-A &&\n-    test_cmp actual-A expect-A\n+    test_cmp expect-A actual-A\n '\n \n test_done\ndiff --git a/t/t9604-cvsimport-timestamps.sh b/t/t9604-cvsimport-timestamps.sh\nindex a4b3db24b..2ff4aa932 100755\n--- a/t/t9604-cvsimport-timestamps.sh\n+++ b/t/t9604-cvsimport-timestamps.sh\n@@ -31,7 +31,7 @@ test_expect_success PERL 'check timestamps are UTC (TZ=CST6CDT)' '\n \tRev  2 2005-02-01 00:00:00 +0000\n \tRev  1 2005-01-01 00:00:00 +0000\n \tEOF\n-\ttest_cmp actual-1 expect-1\n+\ttest_cmp expect-1 actual-1\n '\n \n test_expect_success PERL 'check timestamps with author-specific timezones' '\n@@ -65,7 +65,7 @@ test_expect_success PERL 'check timestamps with author-specific timezones' '\n \tRev  2 2005-01-31 18:00:00 -0600 User Two\n \tRev  1 2005-01-01 00:00:00 +0000 User One\n \tEOF\n-\ttest_cmp actual-2 expect-2\n+\ttest_cmp expect-2 actual-2\n '\n \n test_done\n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358549","messageId":"e61bc462dab95a2ef964b7913766e777e971a800.1537493611.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1537493611.git.matvore@google.com","subject":"[PATCH v3 4/5] tests: don't swallow Git errors upstream of pipes","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-21T01:43:30Z","receivedAt":"2018-09-21T01:44:01Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Some pipes in tests lose the exit code of git processes, which can mask\nunexpected behavior like crashes. Split these pipes up so that git\ncommands are only at the end of pipes rather than the beginning or\nmiddle.\n\nThe violations fixed in this patch were found in the process of fixing\npipe placement in a prior patch.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/t5317-pack-objects-filter-objects.sh | 156 +++++++++++++------------\n t/t5616-partial-clone.sh               |  14 ++-\n t/t6112-rev-list-filters-objects.sh    | 103 ++++++++--------\n t/t9101-git-svn-props.sh               |   3 +-\n 4 files changed, 143 insertions(+), 133 deletions(-)\n\ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex c093eb891..2e718f0bd 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -20,8 +20,9 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r1 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -29,8 +30,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r1 index-pack ../all.pack &&\n \n-\tgit -C r1 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r1 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -43,8 +44,8 @@ test_expect_success 'verify blob:none packfile has no blobs' '\n \tEOF\n \tgit -C r1 index-pack ../filter.pack &&\n \n-\tgit -C r1 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r1 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -53,13 +54,13 @@ test_expect_success 'verify blob:none packfile has no blobs' '\n '\n \n test_expect_success 'verify normal and blob:none packfiles have same commits/trees' '\n-\tgit -C r1 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r1 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r1 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r1 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -82,8 +83,8 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -91,8 +92,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r2 index-pack ../all.pack &&\n \n-\tgit -C r2 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -105,8 +106,8 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -120,8 +121,8 @@ test_expect_success 'verify blob:limit=1000' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -130,8 +131,8 @@ test_expect_success 'verify blob:limit=1000' '\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.1000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1001 >filter.pack <<-EOF &&\n@@ -139,8 +140,8 @@ test_expect_success 'verify blob:limit=1001' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -148,8 +149,8 @@ test_expect_success 'verify blob:limit=1001' '\n '\n \n test_expect_success 'verify blob:limit=10001' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=10001 >filter.pack <<-EOF &&\n@@ -157,8 +158,8 @@ test_expect_success 'verify blob:limit=10001' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -166,8 +167,8 @@ test_expect_success 'verify blob:limit=10001' '\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.1000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n@@ -175,8 +176,8 @@ test_expect_success 'verify blob:limit=1k' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -184,8 +185,8 @@ test_expect_success 'verify blob:limit=1k' '\n '\n \n test_expect_success 'verify explicitly specifying oversized blob in input' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n@@ -194,8 +195,8 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -203,8 +204,8 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1m >filter.pack <<-EOF &&\n@@ -212,8 +213,8 @@ test_expect_success 'verify blob:limit=1m' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -221,13 +222,13 @@ test_expect_success 'verify blob:limit=1m' '\n '\n \n test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '\n-\tgit -C r2 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r2 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -255,8 +256,9 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r3 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -264,8 +266,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r3 index-pack ../all.pack &&\n \n-\tgit -C r3 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r3 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -273,8 +275,8 @@ test_expect_success 'verify blob count in normal packfile' '\n '\n \n test_expect_success 'verify sparse:path=pattern1' '\n-\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&\n@@ -282,8 +284,8 @@ test_expect_success 'verify sparse:path=pattern1' '\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -291,13 +293,13 @@ test_expect_success 'verify sparse:path=pattern1' '\n '\n \n test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -305,8 +307,8 @@ test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same\n '\n \n test_expect_success 'verify sparse:path=pattern2' '\n-\tgit -C r3 ls-files -s sparse1 dir1/sparse1 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse1 dir1/sparse1 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&\n@@ -314,8 +316,8 @@ test_expect_success 'verify sparse:path=pattern2' '\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -323,13 +325,13 @@ test_expect_success 'verify sparse:path=pattern2' '\n '\n \n test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -356,8 +358,9 @@ test_expect_success 'setup r4' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r4 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -365,8 +368,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r4 index-pack ../all.pack &&\n \n-\tgit -C r4 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r4 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -374,8 +377,8 @@ test_expect_success 'verify blob count in normal packfile' '\n '\n \n test_expect_success 'verify sparse:oid=OID' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \toid=$(git -C r4 ls-files -s pattern | awk -f print_2.awk) &&\n@@ -384,8 +387,8 @@ test_expect_success 'verify sparse:oid=OID' '\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n \n-\tgit -C r4 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r4 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -393,8 +396,8 @@ test_expect_success 'verify sparse:oid=OID' '\n '\n \n test_expect_success 'verify sparse:oid=oid-ish' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r4 pack-objects --rev --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&\n@@ -402,8 +405,8 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n \n-\tgit -C r4 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r4 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -414,8 +417,9 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'setup r1 - delete loose blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tfor id in `cat expected | sed \"s|..|&/|\"`\ndiff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\nindex e4d032c9d..fc7aeb1ab 100755\n--- a/t/t5616-partial-clone.sh\n+++ b/t/t5616-partial-clone.sh\n@@ -35,8 +35,8 @@ test_expect_success 'setup bare clone for server' '\n test_expect_success 'do partial clone 1' '\n \tgit clone --no-checkout --filter=blob:none \"file://$(pwd)/srv.bare\" pc1 &&\n \n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print |\n-\tawk -f print_1.awk |\n+\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n \n@@ -133,16 +133,18 @@ test_expect_success 'push new commits to server for file.3.txt' '\n test_expect_success 'manual prefetch of missing objects' '\n \tgit -C pc1 fetch --filter=blob:none origin &&\n \n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n-\tawk -f print_1.awk |\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n+\t\t>revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n \n \ttest_line_count = 6 observed.oids &&\n \tgit -C pc1 fetch-pack --stdin \"file://$(pwd)/srv.bare\" <observed.oids &&\n \n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n-\tawk -f print_1.awk |\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n+\t\t>revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n \ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex ae4402226..b00cf6fa8 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -20,12 +20,13 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob:none omits all 5 blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -33,12 +34,13 @@ test_expect_success 'verify blob:none omits all 5 blobs' '\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r1 rev-list HEAD --objects |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list HEAD --objects >revs &&\n+\tawk -f print_1.awk revs |\n \tsort >expected &&\n \n-\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none \\\n+\t\t>revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -62,12 +64,12 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob:limit=500 omits all blobs' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -75,12 +77,12 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r2 rev-list HEAD --objects |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --objects >revs &&\n+\tawk -f print_1.awk revs |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -88,12 +90,12 @@ test_expect_success 'verify emitted+omitted == all' '\n '\n \n test_expect_success 'verify blob:limit=1000' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -101,12 +103,12 @@ test_expect_success 'verify blob:limit=1000' '\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -114,12 +116,12 @@ test_expect_success 'verify blob:limit=1001' '\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -127,8 +129,8 @@ test_expect_success 'verify blob:limit=1k' '\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -156,12 +158,12 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse1 sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -169,12 +171,12 @@ test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n '\n \n test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n-\tgit -C r3 ls-files -s sparse2 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse2 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -192,14 +194,14 @@ test_expect_success 'setup r3 part 2' '\n '\n \n test_expect_success 'verify sparse:oid=OID omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \toid=$(git -C r3 ls-files -s pattern | awk -f print_2.awk) &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -207,12 +209,12 @@ test_expect_success 'verify sparse:oid=OID omits top-level files' '\n '\n \n test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -223,8 +225,9 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'rev-list W/ --missing=print' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tfor id in `cat expected | sed \"s|..|&/|\"`\n@@ -232,8 +235,8 @@ test_expect_success 'rev-list W/ --missing=print' '\n \t\trm r1/.git/objects/$id\n \tdone &&\n \n-\tgit -C r1 rev-list --quiet HEAD --missing=print --objects |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list --quiet HEAD --missing=print --objects >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed &&\n \ndiff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\nindex 8a5c8dc1a..8cba331fc 100755\n--- a/t/t9101-git-svn-props.sh\n+++ b/t/t9101-git-svn-props.sh\n@@ -174,7 +174,8 @@ test_expect_success 'test create-ignore' \"\n \tcmp ./deeply/.gitignore create-ignore.expect &&\n \tcmp ./deeply/nested/.gitignore create-ignore.expect &&\n \tcmp ./deeply/nested/directory/.gitignore create-ignore.expect &&\n-\tgit ls-files -s | grep gitignore | cmp - create-ignore-index.expect\n+\tgit ls-files -s >ls_files_result &&\n+\tgrep gitignore ls_files_result | cmp - create-ignore-index.expect\n \t\"\n \n cat >prop.expect <<\\EOF\n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358550","messageId":"52456f96545d2034b1fe01f4ae82fe9b75ff6c4c.1537493611.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1537493611.git.matvore@google.com","subject":"[PATCH v3 5/5] t9109: don't swallow Git errors upstream of pipes","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-21T01:43:31Z","receivedAt":"2018-09-21T01:44:02Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"'git ... | foo' will mask any errors or crashes in git, so split up such\npipes in this file.\n\nOne testcase uses several separate pipe sequences in a row which are\nawkward to split up. Wrap the split-up pipe in a function so the\nawkwardness is not repeated. Also change that testcase's surrounding\nquotes from double to single to avoid premature string interpolation.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/t9101-git-svn-props.sh | 31 +++++++++++++++++++------------\n 1 file changed, 19 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\nindex 8cba331fc..c26c4b092 100755\n--- a/t/t9101-git-svn-props.sh\n+++ b/t/t9101-git-svn-props.sh\n@@ -190,17 +190,21 @@ EOF\n # This test can be improved: since all the svn:ignore contain the same\n # pattern, it can pass even though the propget did not execute on the\n # right directory.\n-test_expect_success 'test propget' \"\n-\tgit svn propget svn:ignore . | cmp - prop.expect &&\n+test_expect_success 'test propget' '\n+\ttest_propget () {\n+\t\tgit svn propget $1 $2 >actual &&\n+\t\tcmp $3 actual\n+\t} &&\n+\ttest_propget svn:ignore . prop.expect &&\n \tcd deeply &&\n-\tgit svn propget svn:ignore . | cmp - ../prop.expect &&\n-\tgit svn propget svn:entry:committed-rev nested/directory/.keep \\\n-\t  | cmp - ../prop2.expect &&\n-\tgit svn propget svn:ignore .. | cmp - ../prop.expect &&\n-\tgit svn propget svn:ignore nested/ | cmp - ../prop.expect &&\n-\tgit svn propget svn:ignore ./nested | cmp - ../prop.expect &&\n-\tgit svn propget svn:ignore .././deeply/nested | cmp - ../prop.expect\n-\t\"\n+\ttest_propget svn:ignore . ../prop.expect &&\n+\ttest_propget svn:entry:committed-rev nested/directory/.keep \\\n+\t\t../prop2.expect &&\n+\ttest_propget svn:ignore .. ../prop.expect &&\n+\ttest_propget svn:ignore nested/ ../prop.expect &&\n+\ttest_propget svn:ignore ./nested ../prop.expect &&\n+\ttest_propget svn:ignore .././deeply/nested ../prop.expect\n+\t'\n \n cat >prop.expect <<\\EOF\n Properties on '.':\n@@ -219,8 +223,11 @@ Properties on 'nested/directory/.keep':\n EOF\n \n test_expect_success 'test proplist' \"\n-\tgit svn proplist . | cmp - prop.expect &&\n-\tgit svn proplist nested/directory/.keep | cmp - prop2.expect\n+\tgit svn proplist . >actual &&\n+\tcmp prop.expect actual &&\n+\n+\tgit svn proplist nested/directory/.keep >actual &&\n+\tcmp prop2.expect actual\n \t\"\n \n test_done\n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358551","messageId":"CAPig+cT2qMvT2LW482cXQpGnTmNw8KWsH3d0bW4t0vgJ3p59SQ@mail.gmail.com","threadId":"49352","inReplyTo":"7dd9a1120726dee34aeebdfa4bf45a232c185500.1537493611.git.matvore@google.com","subject":"Re: [PATCH v3 1/5] CodingGuidelines: add shell piping guidelines","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-09-21T02:06:46Z","receivedAt":"2018-09-21T02:07:00Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, Sep 20, 2018 at 9:43 PM Matthew DeVore <matvore@google.com> wrote:\n> Add two guidelines:\n\nProbably s/two/three/ or s/two/several/ since the patch now adds three\nguidelines.\n\n>  - pipe characters should appear at the end of lines, and not cause\n>    indentation\n\nThe \"not cause indentation\" bit is outdated since the added guideline\nno longer says this.\n\n>  - pipes should be avoided when they swallow exit codes that can\n>    potentially fail\n\nAnd:\n\n    - $(git ...) should be avoided ...\n"},{"id":"358655","messageId":"CAMfpvhJX-KJa7aoGvNLLzQOJQq=BOxQubrUhO1mXpP+6Je6WAg@mail.gmail.com","threadId":"49352","inReplyTo":"CAPig+cT2qMvT2LW482cXQpGnTmNw8KWsH3d0bW4t0vgJ3p59SQ@mail.gmail.com","subject":"Re: [PATCH v3 1/5] CodingGuidelines: add shell piping guidelines","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-21T21:03:59Z","receivedAt":"2018-09-21T21:04:15Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Thu, Sep 20, 2018 at 7:06 PM Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> On Thu, Sep 20, 2018 at 9:43 PM Matthew DeVore <matvore@google.com> wrote:\n> > Add two guidelines:\n>\n> Probably s/two/three/ or s/two/several/ since the patch now adds three\n> guidelines.\n>\n> >  - pipe characters should appear at the end of lines, and not cause\n> >    indentation\n>\n> The \"not cause indentation\" bit is outdated since the added guideline\n> no longer says this.\n>\n> >  - pipes should be avoided when they swallow exit codes that can\n> >    potentially fail\n>\n> And:\n>\n>     - $(git ...) should be avoided ...\n\nThank you for pointing this out - I obviously forgot to update the\ncommit message. Here is the revised message:\n\nCodingGuidelines: add shell piping guidelines\n\nAdd the following guidelines:\n\n - pipe characters should appear at the end of lines, not the beginning,\n   and the \\ line continuation character should be omitted\n - pipes and $(git ...) should be avoided when they swallow exit codes\n   of processes that can potentially fail\n"},{"id":"358788","messageId":"20180924210314.GE27036@localhost","threadId":"49352","inReplyTo":"7dd9a1120726dee34aeebdfa4bf45a232c185500.1537493611.git.matvore@google.com","subject":"Re: [PATCH v3 1/5] CodingGuidelines: add shell piping guidelines","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-09-24T21:03:14Z","receivedAt":"2018-09-24T21:03:20Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Thu, Sep 20, 2018 at 06:43:27PM -0700, Matthew DeVore wrote:\n> Add two guidelines:\n> \n>  - pipe characters should appear at the end of lines, and not cause\n>    indentation\n>  - pipes should be avoided when they swallow exit codes that can\n>    potentially fail\n> ---\n>  Documentation/CodingGuidelines | 27 +++++++++++++++++++++++++++\n>  1 file changed, 27 insertions(+)\n> \n> diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\n> index 48aa4edfb..6d265327c 100644\n> --- a/Documentation/CodingGuidelines\n> +++ b/Documentation/CodingGuidelines\n> @@ -118,6 +118,24 @@ For shell scripts specifically (not exhaustive):\n>  \t\tdo this\n>  \tfi\n>  \n> + - If a command sequence joined with && or || or | spans multiple\n> +   lines, put each command on a separate line and put && and || and |\n> +   operators at the end of each line, rather than the start. This\n> +   means you don't need to use \\ to join lines, since the above\n> +   operators imply the sequence isn't finished.\n> +\n> +\t(incorrect)\n> +\tgrep blob verify_pack_result \\\n> +\t| awk -f print_1.awk \\\n> +\t| sort >actual &&\n> +\t...\n> +\n> +\t(correct)\n> +\tgrep blob verify_pack_result |\n> +\tawk -f print_1.awk |\n> +\tsort >actual &&\n> +\t...\n> +\n\nThe above are general shell coding style guidelines, so it makes sense\nto include them in 'Documentation/CodingGuidelines'.\n\n\n>   - We prefer \"test\" over \"[ ... ]\".\n>  \n>   - We do not write the noiseword \"function\" in front of shell\n> @@ -163,6 +181,15 @@ For shell scripts specifically (not exhaustive):\n>  \n>     does not have such a problem.\n>  \n> + - In a piped chain such as \"grep blob objects | sort\", the exit codes\n\nLet's make an example with git in it, e.g. something like this:\n\n  git cmd | grep important | sort\n\nsince just two lines below the new text mentions git crashing.\n\n> +   returned by processes besides the last are ignored. This means that\n> +   if git crashes at the beginning or middle of a chain, it may go\n> +   undetected. Prefer writing the output of that command to a\n> +   temporary file with '>' rather than pipe it.\n> +\n> + - The $(git ...) construct also discards git's exit code, so if the\n\nThis contruct is called command substitution, and it does preserve the\ncommand's exit code, when the expanded text is assigned to a variable:\n\n  $ var=$(exit 42) ; echo $?\n  42\n\nNote, however, that even in that case only the exit code of the last\ncommand substitution is preserved:\n\n  $ var=$(exit 1)foo$(exit 2)bar$(exit 3) ; echo $?\n  3\n\n> +   goal is to test that particular command, redirect its output to a\n> +   temporary file rather than wrap it with $( ).\n\nI find this a bit vague, and to me it implies that ignoring the exit\ncode of a git command that is not the main focus of the given test is\nacceptable, e.g. (made up pseudo example):\n\n  test_expect_success 'fetch gets what it should' '\n    git fetch $remote &&\n    test \"$(git rev-parse just-fetched)\" = $expected_oid\n  '\n\nIn my opinion no tests should ignore the exit code of any git\ncommand, ever.\n\n\nThese last two points, however, are specific to test scripts,\ntherefore I think they would be better placed in 't/README', where the\nrest of the test-specific guidelines are.\n\n>  For C programs:\n>  \n> -- \n> 2.19.0.444.g18242da7ef-goog\n> \n"},{"id":"358878","messageId":"CAMfpvhJ-chi7OMRKjjk79r0uqCqW67Vj9J=tT7Kz-XUmw41H5A@mail.gmail.com","threadId":"49352","inReplyTo":"20180924210314.GE27036@localhost","subject":"Re: [PATCH v3 1/5] CodingGuidelines: add shell piping guidelines","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-09-25T21:58:08Z","receivedAt":"2018-09-25T21:58:23Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Mon, Sep 24, 2018 at 2:03 PM SZEDER Gábor <szeder.dev@gmail.com> wrote:\n> > + - In a piped chain such as \"grep blob objects | sort\", the exit codes\n>\n> Let's make an example with git in it, e.g. something like this:\n>\n>   git cmd | grep important | sort\n>\n> since just two lines below the new text mentions git crashing.\nDone.\n\n> > + - The $(git ...) construct also discards git's exit code, so if the\n>\n> This contruct is called command substitution, and it does preserve the\n> command's exit code, when the expanded text is assigned to a variable:\n>\n>   $ var=$(exit 42) ; echo $?\n>   42\n>\n> Note, however, that even in that case only the exit code of the last\n> command substitution is preserved:\n>\n>   $ var=$(exit 1)foo$(exit 2)bar$(exit 3) ; echo $?\n>   3\n>\nOK, I've changed this guideline to allow for setting a variable with\ncommand substitution, but not in other contexts. It's worded\nsufficiently openly such that your latter example will be forbidden.\n\n> > +   goal is to test that particular command, redirect its output to a\n> > +   temporary file rather than wrap it with $( ).\n>\n> I find this a bit vague, and to me it implies that ignoring the exit\n> code of a git command that is not the main focus of the given test is\n> acceptable, e.g. (made up pseudo example):\n>\n>   test_expect_success 'fetch gets what it should' '\n>     git fetch $remote &&\n>     test \"$(git rev-parse just-fetched)\" = $expected_oid\n>   '\n>\n> In my opinion no tests should ignore the exit code of any git\n> command, ever.\n\nThis seems like a pretty strong assertion, but something very similar\nis written in t/README (in the \"don't\" section):\n\n - use '! git cmd' when you want to make sure the git command exits\n   with failure in a controlled way by calling \"die()\".  Instead,\n   use 'test_must_fail git cmd'.  This will signal a failure if git\n   dies in an unexpected way (e.g. segfault).\n\nSo I've changed this to basically say you should never ignore git's exit code.\n\nHere is the new commit with updated message (I will wait for a day or\ntwo before I send a reroll):\n\n    Documentation: add shell guidelines\n\n    Add the following guideline to Documentation/CodingGuidelines:\n\n            &&, ||, and | should appear at the end of lines, not the\n            beginning, and the \\ line continuation character should be\n            omitted\n\n    And the following to t/README (since it is specific to writing tests):\n\n            pipes and $(git ...) should be avoided when they swallow exit\n            codes of Git processes\n\n    Signed-off-by: Matthew DeVore <matvore@google.com>\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex 48aa4edfb..3d2cfea9b 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -118,6 +118,24 @@ For shell scripts specifically (not exhaustive):\n                 do this\n         fi\n\n+ - If a command sequence joined with && or || or | spans multiple\n+   lines, put each command on a separate line and put && and || and |\n+   operators at the end of each line, rather than the start. This\n+   means you don't need to use \\ to join lines, since the above\n+   operators imply the sequence isn't finished.\n+\n+        (incorrect)\n+        grep blob verify_pack_result \\\n+        | awk -f print_1.awk \\\n+        | sort >actual &&\n+        ...\n+\n+        (correct)\n+        grep blob verify_pack_result |\n+        awk -f print_1.awk |\n+        sort >actual &&\n+        ...\n+\n  - We prefer \"test\" over \"[ ... ]\".\n\n  - We do not write the noiseword \"function\" in front of shell\n@@ -163,7 +181,6 @@ For shell scripts specifically (not exhaustive):\n\n    does not have such a problem.\n\n-\n For C programs:\n\n  - We use tabs to indent, and interpret tabs as taking up to\ndiff --git a/t/README b/t/README\nindex 9028b47d9..3e28b72c4 100644\n--- a/t/README\n+++ b/t/README\n@@ -461,6 +461,32 @@ Don't:\n    platform commands; just use '! cmd'.  We are not in the business\n    of verifying that the world given to us sanely works.\n\n+ - Use Git upstream in the non-final position in a piped chain, as in:\n+\n+     git -C repo ls-files |\n+     xargs -n 1 basename |\n+     grep foo\n+\n+   which will discard git's exit code and may mask a crash. In the\n+   above example, all exit codes are ignored except grep's.\n+\n+   Instead, write the output of that command to a temporary\n+   file with \">\" or assign it to a variable with \"x=$(git ...)\" rather\n+   than pipe it.\n+\n+ - Use command substitution in a way that discards git's exit code.\n+   When assigning to a variable, the exit code is not discarded, e.g.:\n+\n+     x=$(git cat-file -p $sha) &&\n+     ...\n+\n+   is OK because a crash in \"git cat-file\" will cause the \"&&\" chain\n+   to fail, but:\n+\n+     test_cmp expect $(git cat-file -p $sha)\n+\n+   is not OK and a crash in git could go undetected.\n+\n  - use perl without spelling it as \"$PERL_PATH\". This is to help our\n    friends on Windows where the platform Perl often adds CR before\n    the end of line, and they bundle Git with a version of Perl that\n\n\n>\n>\n> These last two points, however, are specific to test scripts,\n> therefore I think they would be better placed in 't/README', where the\n> rest of the test-specific guidelines are.\n>\n> >  For C programs:\n> >\n> > --\n> > 2.19.0.444.g18242da7ef-goog\n> >\n"},{"id":"359120","messageId":"20180927211826.GL27036@localhost","threadId":"49352","inReplyTo":"CAMfpvhJ-chi7OMRKjjk79r0uqCqW67Vj9J=tT7Kz-XUmw41H5A@mail.gmail.com","subject":"Re: [PATCH v3 1/5] CodingGuidelines: add shell piping guidelines","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-09-27T21:18:26Z","receivedAt":"2018-09-27T21:18:33Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Tue, Sep 25, 2018 at 02:58:08PM -0700, Matthew DeVore wrote:\n> Here is the new commit with updated message (I will wait for a day or\n> two before I send a reroll):\n> \n>     Documentation: add shell guidelines\n> \n>     Add the following guideline to Documentation/CodingGuidelines:\n> \n>             &&, ||, and | should appear at the end of lines, not the\n>             beginning, and the \\ line continuation character should be\n>             omitted\n> \n>     And the following to t/README (since it is specific to writing tests):\n> \n>             pipes and $(git ...) should be avoided when they swallow exit\n>             codes of Git processes\n> \n>     Signed-off-by: Matthew DeVore <matvore@google.com>\n> \n> diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\n> index 48aa4edfb..3d2cfea9b 100644\n> --- a/Documentation/CodingGuidelines\n> +++ b/Documentation/CodingGuidelines\n> @@ -118,6 +118,24 @@ For shell scripts specifically (not exhaustive):\n>                  do this\n>          fi\n> \n> + - If a command sequence joined with && or || or | spans multiple\n> +   lines, put each command on a separate line and put && and || and |\n> +   operators at the end of each line, rather than the start. This\n> +   means you don't need to use \\ to join lines, since the above\n> +   operators imply the sequence isn't finished.\n> +\n> +        (incorrect)\n> +        grep blob verify_pack_result \\\n> +        | awk -f print_1.awk \\\n> +        | sort >actual &&\n> +        ...\n> +\n> +        (correct)\n> +        grep blob verify_pack_result |\n> +        awk -f print_1.awk |\n> +        sort >actual &&\n> +        ...\n> +\n>   - We prefer \"test\" over \"[ ... ]\".\n> \n>   - We do not write the noiseword \"function\" in front of shell\n> @@ -163,7 +181,6 @@ For shell scripts specifically (not exhaustive):\n> \n>     does not have such a problem.\n> \n> -\n>  For C programs:\n> \n>   - We use tabs to indent, and interpret tabs as taking up to\n> diff --git a/t/README b/t/README\n> index 9028b47d9..3e28b72c4 100644\n> --- a/t/README\n> +++ b/t/README\n> @@ -461,6 +461,32 @@ Don't:\n>     platform commands; just use '! cmd'.  We are not in the business\n>     of verifying that the world given to us sanely works.\n> \n> + - Use Git upstream in the non-final position in a piped chain, as in:\n\nNote the starting upper case 'U'.\n\n> +\n> +     git -C repo ls-files |\n> +     xargs -n 1 basename |\n> +     grep foo\n> +\n> +   which will discard git's exit code and may mask a crash. In the\n> +   above example, all exit codes are ignored except grep's.\n> +\n> +   Instead, write the output of that command to a temporary\n> +   file with \">\" or assign it to a variable with \"x=$(git ...)\" rather\n> +   than pipe it.\n> +\n> + - Use command substitution in a way that discards git's exit code.\n\n'U' again.\n\n> +   When assigning to a variable, the exit code is not discarded, e.g.:\n> +\n> +     x=$(git cat-file -p $sha) &&\n> +     ...\n> +\n> +   is OK because a crash in \"git cat-file\" will cause the \"&&\" chain\n> +   to fail, but:\n> +\n> +     test_cmp expect $(git cat-file -p $sha)\n> +\n> +   is not OK and a crash in git could go undetected.\n\nWell, this is not OK indeed, because it doesn't make any sense in the\nfirst place :)  'test_cmp' requires two paths as argumens, but the\noutput of 'git cat-file -p' is the whole _content_ of the given object.\n\n>   - use perl without spelling it as \"$PERL_PATH\". This is to help our\n\nNote the starting lower case 'u'.\n\nThis is because these are the continuation of the \"Don't:\" some lines\nearlier, so your new points should start with a lower case 'u' as\nwell.\n\n\nSidenote: I think we should consider reformatting this whole section\nas:\n\n  - Don't do this.\n  - Don't do that.\n\nbecause it grew so much that when I look at the last points, then that\nstarting \"Don't:\" has already scrolled out of my screen.\n\n>     friends on Windows where the platform Perl often adds CR before\n>     the end of line, and they bundle Git with a version of Perl that\n> \n> \n> >\n> >\n> > These last two points, however, are specific to test scripts,\n> > therefore I think they would be better placed in 't/README', where the\n> > rest of the test-specific guidelines are.\n> >\n> > >  For C programs:\n> > >\n> > > --\n> > > 2.19.0.444.g18242da7ef-goog\n> > >\n"},{"id":"359393","messageId":"CAMfpvhLcWp_1xxjhBZtsOXYHuBak10K2P8Q1Yy4thfwioYysXw@mail.gmail.com","threadId":"49352","inReplyTo":"20180927211826.GL27036@localhost","subject":"Re: [PATCH v3 1/5] CodingGuidelines: add shell piping guidelines","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-01T23:07:19Z","receivedAt":"2018-10-01T23:07:35Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Thu, Sep 27, 2018 at 2:18 PM SZEDER Gábor <szeder.dev@gmail.com> wrote:\n>\n> On Tue, Sep 25, 2018 at 02:58:08PM -0700, Matthew DeVore wrote:\n> > + - Use Git upstream in the non-final position in a piped chain, as in:\n>\n> Note the starting upper case 'U'.\n>\n> > + - Use command substitution in a way that discards git's exit code.\n>\n> 'U' again.\n>\n...\n> > +\n> > +     test_cmp expect $(git cat-file -p $sha)\n> > +\n> > +   is not OK and a crash in git could go undetected.\n>\n> Well, this is not OK indeed, because it doesn't make any sense in the\n> first place :)  'test_cmp' requires two paths as argumens, but the\n> output of 'git cat-file -p' is the whole _content_ of the given object.\n\nI've replaced the example and added \"Don't\" in front of each new item\n(explanation for this below). Here is a new diff for this file - the\nrest of the commit is the same:\n\n    platform commands; just use '! cmd'.  We are not in the business\n    of verifying that the world given to us sanely works.\n\n+ - Don't use Git upstream in the non-final position in a piped chain, as\n+   in:\n+\n+     git -C repo ls-files |\n+     xargs -n 1 basename |\n+     grep foo\n+\n+   which will discard git's exit code and may mask a crash. In the\n+   above example, all exit codes are ignored except grep's.\n+\n+   Instead, write the output of that command to a temporary\n+   file with \">\" or assign it to a variable with \"x=$(git ...)\" rather\n+   than pipe it.\n+\n+ - Don't use command substitution in a way that discards git's exit\n+   code. When assigning to a variable, the exit code is not discarded,\n+   e.g.:\n+\n+     x=$(git cat-file -p $sha) &&\n+     ...\n+\n+   is OK because a crash in \"git cat-file\" will cause the \"&&\" chain\n+   to fail, but:\n+\n+     test \"refs/heads/foo\" = \"$(git symbolic-ref HEAD)\"\n+\n+   is not OK and a crash in git could go undetected.\n+\n  - Don't use perl without spelling it as \"$PERL_PATH\". This is to help\n    our friends on Windows where the platform Perl often adds CR before\n    the end of line, and they bundle Git with a version of Perl that\n\n\n>\n> >   - use perl without spelling it as \"$PERL_PATH\". This is to help our\n>\n> Note the starting lower case 'u'.\n>\n> This is because these are the continuation of the \"Don't:\" some lines\n> earlier, so your new points should start with a lower case 'u' as\n> well.\n>\n>\n> Sidenote: I think we should consider reformatting this whole section\n> as:\n>\n>   - Don't do this.\n>   - Don't do that.\n>\n> because it grew so much that when I look at the last points, then that\n> starting \"Don't:\" has already scrolled out of my screen.\n>\nI didn't like how easy it was to mistake a \"Don't\" item for a \"Do\"\n(although temporarily until you read the first sentence, but it's\nstill confusing). So I added a new commit to clean this section up.\nHere it is:\n\nAuthor: Matthew DeVore <matvore@google.com>\nDate:   Mon Oct 1 15:30:49 2018 -0700\n\n    t/README: reformat Do, Don't, Keep in mind lists\n\n    The list of Don'ts for test writing has grown large such that it is hard\n    to see at a glance which section an item is in. In other words, if I\n    ignore a little bit of surrounding context, the \"don'ts\" look like\n    \"do's.\"\n\n    To make the list more readable, prefix \"Don't\" in front of every first\n    sentence in the items.\n\n    Also, the \"Keep in mind\" list is out of place and awkward, because it\n    was a very short \"list\" beneath two very long ones, and it seemed easy\n    to miss under the list of \"don'ts,\" and it only had one item. So move\n    this item to the list of \"do's\" and phrase as \"Remember...\"\n\n    Signed-off-by: Matthew DeVore <matvore@google.com>\n\ndiff --git a/t/README b/t/README\nindex 9028b47d9..85024aba6 100644\n--- a/t/README\n+++ b/t/README\n@@ -393,13 +393,13 @@ This test harness library does the following things:\n    consistently when command line arguments --verbose (or -v),\n    --debug (or -d), and --immediate (or -i) is given.\n\n-Do's, don'ts & things to keep in mind\n+Do's & don'ts\n -------------------------------------\n\n Here are a few examples of things you probably should and shouldn't do\n when writing tests.\n\n-Do:\n+Here are the \"do's:\"\n\n  - Put all code inside test_expect_success and other assertions.\n\n@@ -444,16 +444,21 @@ Do:\n    Windows, where the shell (MSYS bash) mangles absolute path names.\n    For details, see the commit message of 4114156ae9.\n\n-Don't:\n+ - Remember that inside the <script> part, the standard output and\n+   standard error streams are discarded, and the test harness only\n+   reports \"ok\" or \"not ok\" to the end user running the tests. Under\n+   --verbose, they are shown to help debug the tests.\n\n- - exit() within a <script> part.\n+And here are the \"don'ts:\"\n+\n+ - Don't exit() within a <script> part.\n\n    The harness will catch this as a programming error of the test.\n    Use test_done instead if you need to stop the tests early (see\n    \"Skipping tests\" below).\n\n- - use '! git cmd' when you want to make sure the git command exits\n-   with failure in a controlled way by calling \"die()\".  Instead,\n+ - Don't use '! git cmd' when you want to make sure the git command\n+   exits with failure in a controlled way by calling \"die()\".  Instead,\n    use 'test_must_fail git cmd'.  This will signal a failure if git\n    dies in an unexpected way (e.g. segfault).\n\n@@ -461,8 +466,8 @@ Don't:\n    platform commands; just use '! cmd'.  We are not in the business\n    of verifying that the world given to us sanely works.\n\n- - use perl without spelling it as \"$PERL_PATH\". This is to help our\n-   friends on Windows where the platform Perl often adds CR before\n+ - Don't use perl without spelling it as \"$PERL_PATH\". This is to help\n+   our friends on Windows where the platform Perl often adds CR before\n    the end of line, and they bundle Git with a version of Perl that\n    does not do so, whose path is specified with $PERL_PATH. Note that we\n    provide a \"perl\" function which uses $PERL_PATH under the hood, so\n@@ -470,17 +475,17 @@ Don't:\n    (but you do, for example, on a shebang line or in a sub script\n    created via \"write_script\").\n\n- - use sh without spelling it as \"$SHELL_PATH\", when the script can\n-   be misinterpreted by broken platform shell (e.g. Solaris).\n+ - Don't use sh without spelling it as \"$SHELL_PATH\", when the script\n+   can be misinterpreted by broken platform shell (e.g. Solaris).\n\n- - chdir around in tests.  It is not sufficient to chdir to\n+ - Don't chdir around in tests.  It is not sufficient to chdir to\n    somewhere and then chdir back to the original location later in\n    the test, as any intermediate step can fail and abort the test,\n    causing the next test to start in an unexpected directory.  Do so\n    inside a subshell if necessary.\n\n- - save and verify the standard error of compound commands, i.e. group\n-   commands, subshells, and shell functions (except test helper\n+ - Don't save and verify the standard error of compound commands, i.e.\n+   group commands, subshells, and shell functions (except test helper\n    functions like 'test_must_fail') like this:\n\n      ( cd dir && git cmd ) 2>error &&\n@@ -495,7 +500,7 @@ Don't:\n      ( cd dir && git cmd 2>../error ) &&\n      test_cmp expect error\n\n- - Break the TAP output\n+ - Don't break the TAP output\n\n    The raw output from your test may be interpreted by a TAP harness. TAP\n    harnesses will ignore everything they don't know about, but don't step\n@@ -515,13 +520,6 @@ Don't:\n    but the best indication is to just run the tests with prove(1),\n    it'll complain if anything is amiss.\n\n-Keep in mind:\n-\n- - Inside the <script> part, the standard output and standard error\n-   streams are discarded, and the test harness only reports \"ok\" or\n-   \"not ok\" to the end user running the tests. Under --verbose, they\n-   are shown to help debugging the tests.\n-\n\n Skipping tests\n --------------\n"},{"id":"359541","messageId":"cover.1538581868.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1536969438.git.matvore@google.com","subject":"[PATCH v4 0/7] Clean up tests for test_cmp arg ordering and pipe placement","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-03T16:25:58Z","receivedAt":"2018-10-03T16:26:20Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Apply suggestions by Szeder and Eric from last version of the patch,\nnamely:\n - Use a sensible example for how one can unknowingly drop a Git exit\n   code in tests.\n - Fixed the message for the second commit.\n - Move the test-specific coding guidelines to t/README from\n   Documentation/CodingGuidelines.\n - Particularly forbid invoking Git in ways that will mask crashes, but\n   don't say this for non-Git commands, since validating them isn't or\n   job.\n - Including a guideline about dropping exit codes for command\n   substitution.\n - Reformat Do/Don't lists in Documentation/CodingGuidelines, and make my\n   added points have consistent format. This is a new commit.\n\nThere may be other changes I didn't list above, but I would have\nmentioned them in prior mails.\n\nI created a new commit which cleans up invocations of git-rev-list so\nthat positional arguments are last, since my other patchset modifies the\ntests where most of these mistakes are present, and I want the tests\nadded in the other patchset to be consistent with the code around it.\n\nThank you,\n\nMatthew DeVore (7):\n  t/README: reformat Do, Don't, Keep in mind lists\n  Documentation: add shell guidelines\n  tests: standardize pipe placement\n  t/*: fix ordering of expected/observed arguments\n  tests: don't swallow Git errors upstream of pipes\n  t9109: don't swallow Git errors upstream of pipes\n  tests: order arguments to git-rev-list properly\n\n Documentation/CodingGuidelines         |  18 ++\n t/README                               |  68 +++--\n t/lib-gpg.sh                           |   9 +-\n t/t0000-basic.sh                       |   2 +-\n t/t0021-conversion.sh                  |   4 +-\n t/t1006-cat-file.sh                    |   8 +-\n t/t1300-config.sh                      |   9 +-\n t/t1303-wacky-config.sh                |   4 +-\n t/t2101-update-index-reupdate.sh       |   2 +-\n t/t3200-branch.sh                      |   2 +-\n t/t3320-notes-merge-worktrees.sh       |   4 +-\n t/t3400-rebase.sh                      |   8 +-\n t/t3417-rebase-whitespace-fix.sh       |   6 +-\n t/t3702-add-edit.sh                    |   4 +-\n t/t3903-stash.sh                       |   8 +-\n t/t3905-stash-include-untracked.sh     |   2 +-\n t/t4025-hunk-header.sh                 |   2 +-\n t/t4117-apply-reject.sh                |   6 +-\n t/t4124-apply-ws-rule.sh               |  30 +--\n t/t4138-apply-ws-expansion.sh          |   2 +-\n t/t5317-pack-objects-filter-objects.sh | 360 ++++++++++++++-----------\n t/t5318-commit-graph.sh                |   2 +-\n t/t5500-fetch-pack.sh                  |   7 +-\n t/t5616-partial-clone.sh               |  50 ++--\n t/t5701-git-serve.sh                   |  14 +-\n t/t5702-protocol-v2.sh                 |  14 +-\n t/t6023-merge-file.sh                  |  12 +-\n t/t6027-merge-binary.sh                |   4 +-\n t/t6031-merge-filemode.sh              |   2 +-\n t/t6112-rev-list-filters-objects.sh    | 237 +++++++++-------\n t/t7201-co.sh                          |   4 +-\n t/t7406-submodule-update.sh            |   8 +-\n t/t7800-difftool.sh                    |   2 +-\n t/t9100-git-svn-basic.sh               |   2 +-\n t/t9101-git-svn-props.sh               |  34 ++-\n t/t9133-git-svn-nested-git-repo.sh     |   6 +-\n t/t9600-cvsimport.sh                   |   2 +-\n t/t9603-cvsimport-patchsets.sh         |   4 +-\n t/t9604-cvsimport-timestamps.sh        |   4 +-\n 39 files changed, 568 insertions(+), 398 deletions(-)\n\n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359542","messageId":"32f6f14f8d3323468b4255927cca028a82f64b39.1538581868.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1538581868.git.matvore@google.com","subject":"[PATCH v4 1/7] t/README: reformat Do, Don't, Keep in mind lists","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-03T16:25:59Z","receivedAt":"2018-10-03T16:26:26Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"The list of Don'ts for test writing has grown large such that it is hard\nto see at a glance which section an item is in. In other words, if I\nignore a little bit of surrounding context, the \"don'ts\" look like\n\"do's.\"\n\nTo make the list more readable, prefix \"Don't\" in front of every first\nsentence in the items.\n\nAlso, the \"Keep in mind\" list is out of place and awkward, because it\nwas a very short \"list\" beneath two very long ones, and it seemed easy\nto miss under the list of \"don'ts,\" and it only had one item. So move\nthis item to the list of \"do's\" and phrase as \"Remember...\"\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/README | 40 +++++++++++++++++++---------------------\n 1 file changed, 19 insertions(+), 21 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex 9028b47d9..85024aba6 100644\n--- a/t/README\n+++ b/t/README\n@@ -393,13 +393,13 @@ This test harness library does the following things:\n    consistently when command line arguments --verbose (or -v),\n    --debug (or -d), and --immediate (or -i) is given.\n \n-Do's, don'ts & things to keep in mind\n+Do's & don'ts\n -------------------------------------\n \n Here are a few examples of things you probably should and shouldn't do\n when writing tests.\n \n-Do:\n+Here are the \"do's:\"\n \n  - Put all code inside test_expect_success and other assertions.\n \n@@ -444,16 +444,21 @@ Do:\n    Windows, where the shell (MSYS bash) mangles absolute path names.\n    For details, see the commit message of 4114156ae9.\n \n-Don't:\n+ - Remember that inside the <script> part, the standard output and\n+   standard error streams are discarded, and the test harness only\n+   reports \"ok\" or \"not ok\" to the end user running the tests. Under\n+   --verbose, they are shown to help debug the tests.\n \n- - exit() within a <script> part.\n+And here are the \"don'ts:\"\n+\n+ - Don't exit() within a <script> part.\n \n    The harness will catch this as a programming error of the test.\n    Use test_done instead if you need to stop the tests early (see\n    \"Skipping tests\" below).\n \n- - use '! git cmd' when you want to make sure the git command exits\n-   with failure in a controlled way by calling \"die()\".  Instead,\n+ - Don't use '! git cmd' when you want to make sure the git command\n+   exits with failure in a controlled way by calling \"die()\".  Instead,\n    use 'test_must_fail git cmd'.  This will signal a failure if git\n    dies in an unexpected way (e.g. segfault).\n \n@@ -461,8 +466,8 @@ Don't:\n    platform commands; just use '! cmd'.  We are not in the business\n    of verifying that the world given to us sanely works.\n \n- - use perl without spelling it as \"$PERL_PATH\". This is to help our\n-   friends on Windows where the platform Perl often adds CR before\n+ - Don't use perl without spelling it as \"$PERL_PATH\". This is to help\n+   our friends on Windows where the platform Perl often adds CR before\n    the end of line, and they bundle Git with a version of Perl that\n    does not do so, whose path is specified with $PERL_PATH. Note that we\n    provide a \"perl\" function which uses $PERL_PATH under the hood, so\n@@ -470,17 +475,17 @@ Don't:\n    (but you do, for example, on a shebang line or in a sub script\n    created via \"write_script\").\n \n- - use sh without spelling it as \"$SHELL_PATH\", when the script can\n-   be misinterpreted by broken platform shell (e.g. Solaris).\n+ - Don't use sh without spelling it as \"$SHELL_PATH\", when the script\n+   can be misinterpreted by broken platform shell (e.g. Solaris).\n \n- - chdir around in tests.  It is not sufficient to chdir to\n+ - Don't chdir around in tests.  It is not sufficient to chdir to\n    somewhere and then chdir back to the original location later in\n    the test, as any intermediate step can fail and abort the test,\n    causing the next test to start in an unexpected directory.  Do so\n    inside a subshell if necessary.\n \n- - save and verify the standard error of compound commands, i.e. group\n-   commands, subshells, and shell functions (except test helper\n+ - Don't save and verify the standard error of compound commands, i.e.\n+   group commands, subshells, and shell functions (except test helper\n    functions like 'test_must_fail') like this:\n \n      ( cd dir && git cmd ) 2>error &&\n@@ -495,7 +500,7 @@ Don't:\n      ( cd dir && git cmd 2>../error ) &&\n      test_cmp expect error\n \n- - Break the TAP output\n+ - Don't break the TAP output\n \n    The raw output from your test may be interpreted by a TAP harness. TAP\n    harnesses will ignore everything they don't know about, but don't step\n@@ -515,13 +520,6 @@ Don't:\n    but the best indication is to just run the tests with prove(1),\n    it'll complain if anything is amiss.\n \n-Keep in mind:\n-\n- - Inside the <script> part, the standard output and standard error\n-   streams are discarded, and the test harness only reports \"ok\" or\n-   \"not ok\" to the end user running the tests. Under --verbose, they\n-   are shown to help debugging the tests.\n-\n \n Skipping tests\n --------------\n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359543","messageId":"a45b646fced228e5a7fab4db7a35c1c6084e58d0.1538581868.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1538581868.git.matvore@google.com","subject":"[PATCH v4 2/7] Documentation: add shell guidelines","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-03T16:26:00Z","receivedAt":"2018-10-03T16:26:29Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Add the following guideline to Documentation/CodingGuidelines:\n\n\t&&, ||, and | should appear at the end of lines, not the\n\tbeginning, and the \\ line continuation character should be\n\tomitted\n\nAnd the following to t/README (since it is specific to writing tests):\n\n\tpipes and $(git ...) should be avoided when they swallow exit\n\tcodes of Git processes\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n Documentation/CodingGuidelines | 18 ++++++++++++++++++\n t/README                       | 28 ++++++++++++++++++++++++++++\n 2 files changed, 46 insertions(+)\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex 48aa4edfb..72967deb7 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -118,6 +118,24 @@ For shell scripts specifically (not exhaustive):\n \t\tdo this\n \tfi\n \n+ - If a command sequence joined with && or || or | spans multiple\n+   lines, put each command on a separate line and put && and || and |\n+   operators at the end of each line, rather than the start. This\n+   means you don't need to use \\ to join lines, since the above\n+   operators imply the sequence isn't finished.\n+\n+\t(incorrect)\n+\tgrep blob verify_pack_result \\\n+\t| awk -f print_1.awk \\\n+\t| sort >actual &&\n+\t...\n+\n+\t(correct)\n+\tgrep blob verify_pack_result |\n+\tawk -f print_1.awk |\n+\tsort >actual &&\n+\t...\n+\n  - We prefer \"test\" over \"[ ... ]\".\n \n  - We do not write the noiseword \"function\" in front of shell\ndiff --git a/t/README b/t/README\nindex 85024aba6..9a71d5732 100644\n--- a/t/README\n+++ b/t/README\n@@ -466,6 +466,34 @@ And here are the \"don'ts:\"\n    platform commands; just use '! cmd'.  We are not in the business\n    of verifying that the world given to us sanely works.\n \n+ - Don't use Git upstream in the non-final position in a piped chain, as\n+   in:\n+\n+     git -C repo ls-files |\n+     xargs -n 1 basename |\n+     grep foo\n+\n+   which will discard git's exit code and may mask a crash. In the\n+   above example, all exit codes are ignored except grep's.\n+\n+   Instead, write the output of that command to a temporary\n+   file with \">\" or assign it to a variable with \"x=$(git ...)\" rather\n+   than pipe it.\n+\n+ - Don't use command substitution in a way that discards git's exit\n+   code. When assigning to a variable, the exit code is not discarded,\n+   e.g.:\n+\n+     x=$(git cat-file -p $sha) &&\n+     ...\n+\n+   is OK because a crash in \"git cat-file\" will cause the \"&&\" chain\n+   to fail, but:\n+\n+     test \"refs/heads/foo\" = \"$(git symbolic-ref HEAD)\"\n+\n+   is not OK and a crash in git could go undetected.\n+\n  - Don't use perl without spelling it as \"$PERL_PATH\". This is to help\n    our friends on Windows where the platform Perl often adds CR before\n    the end of line, and they bundle Git with a version of Perl that\n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359544","messageId":"abb574187e8f1ab70f71ed35b1e11d00172b7053.1538581868.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1538581868.git.matvore@google.com","subject":"[PATCH v4 3/7] tests: standardize pipe placement","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-03T16:26:01Z","receivedAt":"2018-10-03T16:26:32Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Instead of using a line-continuation and pipe on the second line, take\nadvantage of the shell's implicit line continuation after a pipe\ncharacter.  So for example, instead of\n\n\tsome long line \\\n\t\t| next line\n\nuse\n\n\tsome long line |\n\tnext line\n\nAnd add a blank line before and after the pipe where it aids readability\n(it usually does).\n\nThis better matches the coding style documented in\nDocumentation/CodingGuidelines and used in shell scripts elsewhere in\nthe tree.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/lib-gpg.sh                           |   9 +-\n t/t1006-cat-file.sh                    |   8 +-\n t/t1300-config.sh                      |   5 +-\n t/t5317-pack-objects-filter-objects.sh | 330 ++++++++++++++-----------\n t/t5500-fetch-pack.sh                  |   7 +-\n t/t5616-partial-clone.sh               |  32 ++-\n t/t6112-rev-list-filters-objects.sh    | 203 ++++++++-------\n 7 files changed, 344 insertions(+), 250 deletions(-)\n\ndiff --git a/t/lib-gpg.sh b/t/lib-gpg.sh\nindex 3fe02876c..f1277bef4 100755\n--- a/t/lib-gpg.sh\n+++ b/t/lib-gpg.sh\n@@ -57,9 +57,12 @@ then\n \t\techo | gpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null \\\n \t\t\t--passphrase-fd 0 --pinentry-mode loopback \\\n \t\t\t--import \"$TEST_DIRECTORY\"/lib-gpg/gpgsm_cert.p12 &&\n-\t\tgpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null -K \\\n-\t\t\t| grep fingerprint: | cut -d\" \" -f4 | tr -d '\\n' > \\\n-\t\t\t${GNUPGHOME}/trustlist.txt &&\n+\n+\t\tgpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null -K |\n+\t\tgrep fingerprint: |\n+\t\tcut -d\" \" -f4 |\n+\t\ttr -d '\\n' >\"${GNUPGHOME}/trustlist.txt\" &&\n+\n \t\techo \" S relax\" >> ${GNUPGHOME}/trustlist.txt &&\n \t\t(gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) &&\n \t\techo hello | gpgsm --homedir \"${GNUPGHOME}\" >/dev/null \\\ndiff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh\nindex 7f19d591f..a0fa926d3 100755\n--- a/t/t1006-cat-file.sh\n+++ b/t/t1006-cat-file.sh\n@@ -218,8 +218,8 @@ test_expect_success \"--batch-check for a non-existent hash\" '\n     test \"0000000000000000000000000000000000000042 missing\n 0000000000000000000000000000000000000084 missing\" = \\\n     \"$( ( echo 0000000000000000000000000000000000000042;\n-         echo_without_newline 0000000000000000000000000000000000000084; ) \\\n-       | git cat-file --batch-check)\"\n+         echo_without_newline 0000000000000000000000000000000000000084; ) |\n+       git cat-file --batch-check)\"\n '\n \n test_expect_success \"--batch for an existent and a non-existent hash\" '\n@@ -227,8 +227,8 @@ test_expect_success \"--batch for an existent and a non-existent hash\" '\n $tag_content\n 0000000000000000000000000000000000000000 missing\" = \\\n     \"$( ( echo $tag_sha1;\n-         echo_without_newline 0000000000000000000000000000000000000000; ) \\\n-       | git cat-file --batch)\"\n+         echo_without_newline 0000000000000000000000000000000000000000; ) |\n+       git cat-file --batch)\"\n '\n \n test_expect_success \"--batch-check for an empty line\" '\ndiff --git a/t/t1300-config.sh b/t/t1300-config.sh\nindex cdf1fed5d..5869d6cb6 100755\n--- a/t/t1300-config.sh\n+++ b/t/t1300-config.sh\n@@ -1770,8 +1770,9 @@ test_expect_success '--show-origin stdin with file include' '\n \tcat >expect <<-EOF &&\n \t\tfile:$INCLUDE_DIR/stdin.include\tinclude\n \tEOF\n-\techo \"[include]path=\\\"$INCLUDE_DIR\\\"/stdin.include\" \\\n-\t\t| git config --show-origin --includes --file - user.stdin >output &&\n+\techo \"[include]path=\\\"$INCLUDE_DIR\\\"/stdin.include\" |\n+\tgit config --show-origin --includes --file - user.stdin >output &&\n+\n \ttest_cmp expect output\n '\n \ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex 6710c8bc8..ce69148ec 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -20,17 +20,20 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r1 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r1 index-pack ../all.pack &&\n-\tgit -C r1 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -39,23 +42,27 @@ test_expect_success 'verify blob:none packfile has no blobs' '\n \tHEAD\n \tEOF\n \tgit -C r1 index-pack ../filter.pack &&\n-\tgit -C r1 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n \n test_expect_success 'verify normal and blob:none packfiles have same commits/trees' '\n-\tgit -C r1 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r1 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -75,17 +82,20 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../all.pack &&\n-\tgit -C r2 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -94,10 +104,12 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n@@ -107,99 +119,118 @@ test_expect_success 'verify blob:limit=1000' '\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.1000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1001 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=10001' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=10001 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.1000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify explicitly specifying oversized blob in input' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n \tHEAD\n \t$(git -C r2 rev-parse HEAD:large.10000)\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1m >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '\n-\tgit -C r2 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r2 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -224,71 +255,84 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../all.pack &&\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern1' '\n-\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern2' '\n-\tgit -C r3 ls-files -s sparse1 dir1/sparse1 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s sparse1 dir1/sparse1 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -312,48 +356,57 @@ test_expect_success 'setup r4' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r4 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../all.pack &&\n-\tgit -C r4 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=OID' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \toid=$(git -C r4 ls-files -s pattern | awk -f print_2.awk) &&\n \tgit -C r4 pack-objects --rev --stdout --filter=sparse:oid=$oid >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n-\tgit -C r4 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=oid-ish' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r4 pack-objects --rev --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n-\tgit -C r4 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -361,9 +414,10 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'setup r1 - delete loose blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tfor id in `cat expected | sed \"s|..|&/|\"`\n \tdo\n \t\trm r1/.git/objects/$id\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 1b5a4a6d3..086f2c40f 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -50,8 +50,11 @@ pull_to_client () {\n \t\t\tcase \"$heads\" in *B*)\n \t\t\t    git update-ref refs/heads/B \"$BTIP\";;\n \t\t\tesac &&\n-\t\t\tgit symbolic-ref HEAD refs/heads/$(echo $heads \\\n-\t\t\t\t| sed -e \"s/^\\(.\\).*$/\\1/\") &&\n+\n+\t\t\tgit symbolic-ref HEAD refs/heads/$(\n+\t\t\t\techo $heads |\n+\t\t\t\tsed -e \"s/^\\(.\\).*$/\\1/\"\n+\t\t\t) &&\n \n \t\t\tgit fsck --full &&\n \ndiff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\nindex bbbe7537d..e4d032c9d 100755\n--- a/t/t5616-partial-clone.sh\n+++ b/t/t5616-partial-clone.sh\n@@ -34,10 +34,12 @@ test_expect_success 'setup bare clone for server' '\n # confirm partial clone was registered in the local config.\n test_expect_success 'do partial clone 1' '\n \tgit clone --no-checkout --filter=blob:none \"file://$(pwd)/srv.bare\" pc1 &&\n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_cmp expect_1.oids observed.oids &&\n \ttest \"$(git -C pc1 config --local core.repositoryformatversion)\" = \"1\" &&\n \ttest \"$(git -C pc1 config --local extensions.partialclone)\" = \"origin\" &&\n@@ -130,16 +132,20 @@ test_expect_success 'push new commits to server for file.3.txt' '\n # perhaps combined with a command in dry-run mode.\n test_expect_success 'manual prefetch of missing objects' '\n \tgit -C pc1 fetch --filter=blob:none origin &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_line_count = 6 observed.oids &&\n \tgit -C pc1 fetch-pack --stdin \"file://$(pwd)/srv.bare\" <observed.oids &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_line_count = 0 observed.oids\n '\n \n@@ -194,7 +200,7 @@ test_expect_success 'upon cloning, check that all refs point to objects' '\n \n \t# Craft a packfile not including that blob.\n \tgit -C \"$SERVER\" rev-parse HEAD |\n-\t\tgit -C \"$SERVER\" pack-objects --stdout >incomplete.pack &&\n+\tgit -C \"$SERVER\" pack-objects --stdout >incomplete.pack &&\n \n \t# Replace the existing packfile with the crafted one. The protocol\n \t# requires that the packfile be sent in sideband 1, hence the extra\ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex d4ff0b3be..0f6b569e1 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -20,24 +20,28 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob:none omits all 5 blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r1 rev-list HEAD --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r1 rev-list HEAD --objects |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -58,65 +62,76 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob:limit=500 omits all blobs' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r2 rev-list HEAD --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 rev-list HEAD --objects |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1000' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_must_be_empty observed\n '\n \n@@ -141,24 +156,28 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n-\tgit -C r3 ls-files -s sparse2 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s sparse2 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -173,25 +192,30 @@ test_expect_success 'setup r3 part 2' '\n '\n \n test_expect_success 'verify sparse:oid=OID omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \toid=$(git -C r3 ls-files -s pattern | awk -f print_2.awk) &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -199,17 +223,20 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'rev-list W/ --missing=print' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tfor id in `cat expected | sed \"s|..|&/|\"`\n \tdo\n \t\trm r1/.git/objects/$id\n \tdone &&\n-\tgit -C r1 rev-list --quiet HEAD --missing=print --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 rev-list --quiet HEAD --missing=print --objects |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359545","messageId":"b327b3f9dba74a0327fbf1c56843699f8275c693.1538581868.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1538581868.git.matvore@google.com","subject":"[PATCH v4 4/7] t/*: fix ordering of expected/observed arguments","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-03T16:26:02Z","receivedAt":"2018-10-03T16:26:34Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Fix various places where the ordering was obviously wrong, meaning it\nwas easy to find with grep.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/t0000-basic.sh                       |  2 +-\n t/t0021-conversion.sh                  |  4 +--\n t/t1300-config.sh                      |  4 +--\n t/t1303-wacky-config.sh                |  4 +--\n t/t2101-update-index-reupdate.sh       |  2 +-\n t/t3200-branch.sh                      |  2 +-\n t/t3320-notes-merge-worktrees.sh       |  4 +--\n t/t3400-rebase.sh                      |  8 +++---\n t/t3417-rebase-whitespace-fix.sh       |  6 ++---\n t/t3702-add-edit.sh                    |  4 +--\n t/t3903-stash.sh                       |  8 +++---\n t/t3905-stash-include-untracked.sh     |  2 +-\n t/t4025-hunk-header.sh                 |  2 +-\n t/t4117-apply-reject.sh                |  6 ++---\n t/t4124-apply-ws-rule.sh               | 30 +++++++++++------------\n t/t4138-apply-ws-expansion.sh          |  2 +-\n t/t5317-pack-objects-filter-objects.sh | 34 +++++++++++++-------------\n t/t5318-commit-graph.sh                |  2 +-\n t/t5701-git-serve.sh                   | 14 +++++------\n t/t5702-protocol-v2.sh                 | 10 ++++----\n t/t6023-merge-file.sh                  | 12 ++++-----\n t/t6027-merge-binary.sh                |  4 +--\n t/t6031-merge-filemode.sh              |  2 +-\n t/t6112-rev-list-filters-objects.sh    | 24 +++++++++---------\n t/t7201-co.sh                          |  4 +--\n t/t7406-submodule-update.sh            |  8 +++---\n t/t7800-difftool.sh                    |  2 +-\n t/t9100-git-svn-basic.sh               |  2 +-\n t/t9133-git-svn-nested-git-repo.sh     |  6 ++---\n t/t9600-cvsimport.sh                   |  2 +-\n t/t9603-cvsimport-patchsets.sh         |  4 +--\n t/t9604-cvsimport-timestamps.sh        |  4 +--\n 32 files changed, 112 insertions(+), 112 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex 850f651e4..224c098a8 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -1018,7 +1018,7 @@ test_expect_success SHA1 'validate git diff-files output for a know cache/work t\n :120000 120000 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c 0000000000000000000000000000000000000000 M\tpath3/subp3/file3sym\n EOF\n \tgit diff-files >current &&\n-\ttest_cmp current expected\n+\ttest_cmp expected current\n '\n \n test_expect_success 'git update-index --refresh should succeed' '\ndiff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh\nindex 308cd28f3..fd5f1ac64 100755\n--- a/t/t0021-conversion.sh\n+++ b/t/t0021-conversion.sh\n@@ -166,10 +166,10 @@ test_expect_success expanded_in_repo '\n \trm -f expanded-keywords expanded-keywords-crlf &&\n \n \tgit checkout -- expanded-keywords &&\n-\ttest_cmp expanded-keywords expected-output &&\n+\ttest_cmp expected-output expanded-keywords &&\n \n \tgit checkout -- expanded-keywords-crlf &&\n-\ttest_cmp expanded-keywords-crlf expected-output-crlf\n+\ttest_cmp expected-output-crlf expanded-keywords-crlf\n '\n \n # The use of %f in a filter definition is expanded to the path to\ndiff --git a/t/t1300-config.sh b/t/t1300-config.sh\nindex 5869d6cb6..e2cd50ecf 100755\n--- a/t/t1300-config.sh\n+++ b/t/t1300-config.sh\n@@ -1001,7 +1001,7 @@ EOF\n \n test_expect_success 'value continued on next line' '\n \tgit config --list > result &&\n-\ttest_cmp result expect\n+\ttest_cmp expect result\n '\n \n cat > .git/config <<\\EOF\n@@ -1882,7 +1882,7 @@ test_expect_success '--replace-all does not invent newlines' '\n \tQkey = b\n \tEOF\n \tgit config --replace-all abc.key b &&\n-\ttest_cmp .git/config expect\n+\ttest_cmp expect .git/config\n '\n \n test_done\ndiff --git a/t/t1303-wacky-config.sh b/t/t1303-wacky-config.sh\nindex 3b92083e1..0000e664e 100755\n--- a/t/t1303-wacky-config.sh\n+++ b/t/t1303-wacky-config.sh\n@@ -14,7 +14,7 @@ setup() {\n check() {\n \techo \"$2\" >expected\n \tgit config --get \"$1\" >actual 2>&1\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n }\n \n # 'check section.key regex value' verifies that the entry for\n@@ -22,7 +22,7 @@ check() {\n check_regex() {\n \techo \"$3\" >expected\n \tgit config --get \"$1\" \"$2\" >actual 2>&1\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n }\n \n test_expect_success 'modify same key' '\ndiff --git a/t/t2101-update-index-reupdate.sh b/t/t2101-update-index-reupdate.sh\nindex 685ec4563..6c32d42c8 100755\n--- a/t/t2101-update-index-reupdate.sh\n+++ b/t/t2101-update-index-reupdate.sh\n@@ -73,7 +73,7 @@ test_expect_success 'update-index --update from subdir' '\n \t100644 $(git hash-object dir1/file3) 0\tdir1/file3\n \t100644 $file2 0\tfile2\n \tEOF\n-\ttest_cmp current expected\n+\ttest_cmp expected current\n '\n \n test_expect_success 'update-index --update with pathspec' '\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex 93f21ab07..478b82cf9 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -1221,7 +1221,7 @@ test_expect_success 'use --edit-description' '\n \tEOF\n \tEDITOR=./editor git branch --edit-description &&\n \techo \"New contents\" >expect &&\n-\ttest_cmp EDITOR_OUTPUT expect\n+\ttest_cmp expect EDITOR_OUTPUT\n '\n \n test_expect_success 'detect typo in branch name when using --edit-description' '\ndiff --git a/t/t3320-notes-merge-worktrees.sh b/t/t3320-notes-merge-worktrees.sh\nindex 10bfc8b94..823fdbda1 100755\n--- a/t/t3320-notes-merge-worktrees.sh\n+++ b/t/t3320-notes-merge-worktrees.sh\n@@ -44,7 +44,7 @@ test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '\n \tgit config core.notesRef refs/notes/y &&\n \ttest_must_fail git notes merge z &&\n \techo \"ref: refs/notes/y\" >expect &&\n-\ttest_cmp .git/NOTES_MERGE_REF expect\n+\ttest_cmp expect .git/NOTES_MERGE_REF\n '\n \n test_expect_success 'merge z into y while mid-merge in another workdir fails' '\n@@ -66,7 +66,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '\n \t\tgrep -v \"A notes merge into refs/notes/x is already in-progress in\" out\n \t) &&\n \techo \"ref: refs/notes/x\" >expect &&\n-\ttest_cmp .git/worktrees/worktree2/NOTES_MERGE_REF expect\n+\ttest_cmp expect .git/worktrees/worktree2/NOTES_MERGE_REF\n '\n \n test_done\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 3996ee013..3e73f7584 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -183,13 +183,13 @@ test_expect_success 'cherry-picked commits and fork-point work together' '\n \ttest_commit final_B B \"Final B\" &&\n \tgit rebase &&\n \techo Amended >expect &&\n-\ttest_cmp A expect &&\n+\ttest_cmp expect A &&\n \techo \"Final B\" >expect &&\n-\ttest_cmp B expect &&\n+\ttest_cmp expect B &&\n \techo C >expect &&\n-\ttest_cmp C expect &&\n+\ttest_cmp expect C &&\n \techo D >expect &&\n-\ttest_cmp D expect\n+\ttest_cmp expect D\n '\n \n test_expect_success 'rebase -q is quiet' '\ndiff --git a/t/t3417-rebase-whitespace-fix.sh b/t/t3417-rebase-whitespace-fix.sh\nindex 1fb3e499b..e85cdc703 100755\n--- a/t/t3417-rebase-whitespace-fix.sh\n+++ b/t/t3417-rebase-whitespace-fix.sh\n@@ -55,7 +55,7 @@ test_expect_success 'blank line at end of file; extend at end of file' '\n \tgit add file &&\tgit commit -m second &&\n \tgit rebase --whitespace=fix HEAD^^ &&\n \tgit diff --exit-code HEAD^:file expect-first &&\n-\ttest_cmp file expect-second\n+\ttest_cmp expect-second file\n '\n \n # prepare third revision of \"file\"\n@@ -82,7 +82,7 @@ test_expect_success 'two blanks line at end of file; extend at end of file' '\n \tcp third file && git add file && git commit -m third &&\n \tgit rebase --whitespace=fix HEAD^^ &&\n \tgit diff --exit-code HEAD^:file expect-second &&\n-\ttest_cmp file expect-third\n+\ttest_cmp expect-third file\n '\n \n test_expect_success 'same, but do not remove trailing spaces' '\n@@ -120,7 +120,7 @@ test_expect_success 'at beginning of file' '\n \tdone >> file &&\n \tgit commit -m more file\t&&\n \tgit rebase --whitespace=fix HEAD^^ &&\n-\ttest_cmp file expect-beginning\n+\ttest_cmp expect-beginning file\n '\n \n test_done\ndiff --git a/t/t3702-add-edit.sh b/t/t3702-add-edit.sh\nindex c6af7f82b..6c676645d 100755\n--- a/t/t3702-add-edit.sh\n+++ b/t/t3702-add-edit.sh\n@@ -110,10 +110,10 @@ test_expect_success 'add -e' '\n \tcp second-part file &&\n \tgit add -e &&\n \ttest_cmp second-part file &&\n-\ttest_cmp orig-patch expected-patch &&\n+\ttest_cmp expected-patch orig-patch &&\n \tgit diff --cached >actual &&\n \tgrep -v index actual >out &&\n-\ttest_cmp out expected\n+\ttest_cmp expected out\n \n '\n \ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 6450bc669..cd216655b 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -36,7 +36,7 @@ EOF\n test_expect_success 'parents of stash' '\n \ttest $(git rev-parse stash^) = $(git rev-parse HEAD) &&\n \tgit diff stash^2..stash > output &&\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n '\n \n test_expect_success 'applying bogus stash does nothing' '\n@@ -210,9 +210,9 @@ test_expect_success 'stash branch' '\n \ttest refs/heads/stashbranch = $(git symbolic-ref HEAD) &&\n \ttest $(git rev-parse HEAD) = $(git rev-parse master^) &&\n \tgit diff --cached > output &&\n-\ttest_cmp output expect &&\n+\ttest_cmp expect output &&\n \tgit diff > output &&\n-\ttest_cmp output expect1 &&\n+\ttest_cmp expect1 output &&\n \tgit add file &&\n \tgit commit -m alternate\\ second &&\n \tgit diff master..stashbranch > output &&\n@@ -710,7 +710,7 @@ test_expect_success 'stash where working directory contains \"HEAD\" file' '\n \tgit diff-index --cached --quiet HEAD &&\n \ttest \"$(git rev-parse stash^)\" = \"$(git rev-parse HEAD)\" &&\n \tgit diff stash^..stash > output &&\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n '\n \n test_expect_success 'store called with invalid commit' '\ndiff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh\nindex 597b0637d..cc1c8a7bb 100755\n--- a/t/t3905-stash-include-untracked.sh\n+++ b/t/t3905-stash-include-untracked.sh\n@@ -142,7 +142,7 @@ test_expect_success 'stash save --include-untracked removed files' '\n \trm -f file &&\n \tgit stash save --include-untracked &&\n \techo 1 > expect &&\n-\ttest_cmp file expect\n+\ttest_cmp expect file\n '\n \n rm -f expect\ndiff --git a/t/t4025-hunk-header.sh b/t/t4025-hunk-header.sh\nindex fa44e7886..35578f2bb 100755\n--- a/t/t4025-hunk-header.sh\n+++ b/t/t4025-hunk-header.sh\n@@ -37,7 +37,7 @@ test_expect_success 'hunk header truncation with an overly long line' '\n \t\techo \" A $N$N$N$N$N$N$N$N$N2\" &&\n \t\techo \" L  $N$N$N$N$N$N$N$N$N1\"\n \t) >expected &&\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n \n '\n \ndiff --git a/t/t4117-apply-reject.sh b/t/t4117-apply-reject.sh\nindex d80187de9..f7de6f077 100755\n--- a/t/t4117-apply-reject.sh\n+++ b/t/t4117-apply-reject.sh\n@@ -72,7 +72,7 @@ test_expect_success 'apply with --reject should fail but update the file' '\n \trm -f file1.rej file2.rej &&\n \n \ttest_must_fail git apply --reject patch.1 &&\n-\ttest_cmp file1 expected &&\n+\ttest_cmp expected file1 &&\n \n \tcat file1.rej &&\n \ttest_path_is_missing file2.rej\n@@ -85,7 +85,7 @@ test_expect_success 'apply with --reject should fail but update the file' '\n \n \ttest_must_fail git apply --reject patch.2 >rejects &&\n \ttest_path_is_missing file1 &&\n-\ttest_cmp file2 expected &&\n+\ttest_cmp expected file2 &&\n \n \tcat file2.rej &&\n \ttest_path_is_missing file1.rej\n@@ -99,7 +99,7 @@ test_expect_success 'the same test with --verbose' '\n \n \ttest_must_fail git apply --reject --verbose patch.2 >rejects &&\n \ttest_path_is_missing file1 &&\n-\ttest_cmp file2 expected &&\n+\ttest_cmp expected file2 &&\n \n \tcat file2.rej &&\n \ttest_path_is_missing file1.rej\ndiff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh\nindex 7e32237a2..ff51e9e78 100755\n--- a/t/t4124-apply-ws-rule.sh\n+++ b/t/t4124-apply-ws-rule.sh\n@@ -313,9 +313,9 @@ test_expect_success 'applying beyond EOF requires one non-blank context line' '\n \t{ echo a; echo; } >one &&\n \tcp one expect &&\n \ttest_must_fail git apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \ttest_must_fail git apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'tons of blanks at EOF should not apply' '\n@@ -342,10 +342,10 @@ test_expect_success 'missing blank line at end with --whitespace=fix' '\n \tcp one saved-one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv saved-one one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'two missing blank lines at end with --whitespace=fix' '\n@@ -360,11 +360,11 @@ test_expect_success 'two missing blank lines at end with --whitespace=fix' '\n \tcp no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'missing blank line at end, insert before end, --whitespace=fix' '\n@@ -376,7 +376,7 @@ test_expect_success 'missing blank line at end, insert before end, --whitespace=\n \techo a >one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'shrink file with tons of missing blanks at end of file' '\n@@ -392,10 +392,10 @@ test_expect_success 'shrink file with tons of missing blanks at end of file' '\n \tcp no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv no-blank-lines one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'missing blanks at EOF must only match blank lines' '\n@@ -427,7 +427,7 @@ test_expect_success 'missing blank line should match context line with spaces' '\n \tgit add one &&\n \n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n sed -e's/Z//' >one <<EOF\n@@ -447,7 +447,7 @@ test_expect_success 'same, but with the --ignore-space-option' '\n \n \tgit checkout-index -f one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '\n@@ -464,7 +464,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '\n \tmv save-one one &&\n \n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'CR-LF line endings && add line && text=auto' '\n@@ -478,7 +478,7 @@ test_expect_success 'CR-LF line endings && add line && text=auto' '\n \tmv save-one one &&\n \techo \"one text=auto\" >.gitattributes &&\n \tgit apply patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'CR-LF line endings && change line && text=auto' '\n@@ -491,7 +491,7 @@ test_expect_success 'CR-LF line endings && change line && text=auto' '\n \tmv save-one one &&\n \techo \"one text=auto\" >.gitattributes &&\n \tgit apply patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'LF in repo, CRLF in worktree && change line && text=auto' '\n@@ -503,7 +503,7 @@ test_expect_success 'LF in repo, CRLF in worktree && change line && text=auto' '\n \techo \"one text=auto\" >.gitattributes &&\n \tgit -c core.eol=CRLF apply patch &&\n \tprintf \"b\\r\\n\" >expect &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'whitespace=fix to expand' '\ndiff --git a/t/t4138-apply-ws-expansion.sh b/t/t4138-apply-ws-expansion.sh\nindex 0ffe33fbe..3b636a63a 100755\n--- a/t/t4138-apply-ws-expansion.sh\n+++ b/t/t4138-apply-ws-expansion.sh\n@@ -114,7 +114,7 @@ for t in 1 2 3 4\n do\n \ttest_expect_success 'apply with ws expansion (t=$t)' '\n \t\tgit apply patch$t.patch &&\n-\t\ttest_cmp test-$t expect-$t\n+\t\ttest_cmp expect-$t test-$t\n \t'\n done\n \ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex ce69148ec..c093eb891 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -34,7 +34,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:none packfile has no blobs' '\n@@ -63,7 +63,7 @@ test_expect_success 'verify normal and blob:none packfiles have same commits/tre\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test blob:limit=<n>[kmg] filter.\n@@ -96,7 +96,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=500 omits all blobs' '\n@@ -144,7 +144,7 @@ test_expect_success 'verify blob:limit=1001' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=10001' '\n@@ -162,7 +162,7 @@ test_expect_success 'verify blob:limit=10001' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1k' '\n@@ -180,7 +180,7 @@ test_expect_success 'verify blob:limit=1k' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify explicitly specifying oversized blob in input' '\n@@ -199,7 +199,7 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1m' '\n@@ -217,7 +217,7 @@ test_expect_success 'verify blob:limit=1m' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '\n@@ -231,7 +231,7 @@ test_expect_success 'verify normal and blob:limit packfiles have same commits/tr\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:path=<path> filter.\n@@ -269,7 +269,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern1' '\n@@ -287,7 +287,7 @@ test_expect_success 'verify sparse:path=pattern1' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '\n@@ -301,7 +301,7 @@ test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern2' '\n@@ -319,7 +319,7 @@ test_expect_success 'verify sparse:path=pattern2' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '\n@@ -333,7 +333,7 @@ test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:oid=<oid-ish> filter.\n@@ -370,7 +370,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=OID' '\n@@ -389,7 +389,7 @@ test_expect_success 'verify sparse:oid=OID' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=oid-ish' '\n@@ -407,7 +407,7 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Delete some loose objects and use pack-objects, but WITHOUT any filtering.\ndiff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh\nindex 0c500f7ca..d6da3ce4e 100755\n--- a/t/t5318-commit-graph.sh\n+++ b/t/t5318-commit-graph.sh\n@@ -35,7 +35,7 @@ test_expect_success 'create commits and repack' '\n graph_git_two_modes() {\n \tgit -c core.commitGraph=true $1 >output\n \tgit -c core.commitGraph=false $1 >expect\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n }\n \n graph_git_behavior() {\ndiff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh\nindex 75ec79e6c..bf139e245 100755\n--- a/t/t5701-git-serve.sh\n+++ b/t/t5701-git-serve.sh\n@@ -16,7 +16,7 @@ test_expect_success 'test capability advertisement' '\n \n \tgit serve --advertise-capabilities >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'stateless-rpc flag does not list capabilities' '\n@@ -89,7 +89,7 @@ test_expect_success 'basics of ls-refs' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'basic ref-prefixes' '\n@@ -109,7 +109,7 @@ test_expect_success 'basic ref-prefixes' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'refs/heads prefix' '\n@@ -129,7 +129,7 @@ test_expect_success 'refs/heads prefix' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'peel parameter' '\n@@ -150,7 +150,7 @@ test_expect_success 'peel parameter' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'symrefs parameter' '\n@@ -171,7 +171,7 @@ test_expect_success 'symrefs parameter' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'sending server-options' '\n@@ -191,7 +191,7 @@ test_expect_success 'sending server-options' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'unexpected lines are not allowed in fetch request' '\ndiff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh\nindex 3beeed454..54727450b 100755\n--- a/t/t5702-protocol-v2.sh\n+++ b/t/t5702-protocol-v2.sh\n@@ -29,7 +29,7 @@ test_expect_success 'list refs with git:// using protocol v2' '\n \tgrep \"git< version 2\" log &&\n \n \tgit ls-remote --symref \"$GIT_DAEMON_URL/parent\" >expect &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'ref advertisment is filtered with ls-remote using protocol v2' '\n@@ -42,7 +42,7 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol\n \t$(git -C \"$daemon_parent\" rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'clone with git:// using protocol v2' '\n@@ -138,7 +138,7 @@ test_expect_success 'list refs with file:// using protocol v2' '\n \tgrep \"git< version 2\" log &&\n \n \tgit ls-remote --symref \"file://$(pwd)/file_parent\" >expect &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'ref advertisment is filtered with ls-remote using protocol v2' '\n@@ -151,7 +151,7 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol\n \t$(git -C file_parent rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'server-options are sent when using ls-remote' '\n@@ -164,7 +164,7 @@ test_expect_success 'server-options are sent when using ls-remote' '\n \t$(git -C file_parent rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect &&\n+\ttest_cmp expect actual &&\n \tgrep \"server-option=hello\" log &&\n \tgrep \"server-option=world\" log\n '\ndiff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh\nindex 20aee43f9..51ee887a7 100755\n--- a/t/t6023-merge-file.sh\n+++ b/t/t6023-merge-file.sh\n@@ -99,7 +99,7 @@ EOF\n printf \"propter nomen suum.\" >> expect.txt\n \n test_expect_success \"merge does not add LF away of change\" \\\n-\t\"test_cmp test3.txt expect.txt\"\n+\t\"test_cmp expect.txt test3.txt\"\n \n cp test.txt backup.txt\n test_expect_success \"merge with conflicts\" \\\n@@ -122,7 +122,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n \n-test_expect_success \"expected conflict markers\" \"test_cmp test.txt expect.txt\"\n+test_expect_success \"expected conflict markers\" \"test_cmp expect.txt test.txt\"\n \n cp backup.txt test.txt\n \n@@ -138,7 +138,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --ours\" \\\n-\t\"git merge-file --ours test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --ours test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n cat > expect.txt << EOF\n@@ -154,7 +154,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --theirs\" \\\n-\t\"git merge-file --theirs test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --theirs test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n cat > expect.txt << EOF\n@@ -171,7 +171,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --union\" \\\n-\t\"git merge-file --union test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --union test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n test_expect_success \"merge with conflicts, using -L\" \\\n@@ -195,7 +195,7 @@ virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n \n test_expect_success \"expected conflict markers, with -L\" \\\n-\t\"test_cmp test.txt expect.txt\"\n+\t\"test_cmp expect.txt test.txt\"\n \n sed \"s/ tu / TU /\" < new1.txt > new5.txt\n test_expect_success \"conflict in removed tail\" \\\ndiff --git a/t/t6027-merge-binary.sh b/t/t6027-merge-binary.sh\nindex 07735410b..4e6c7cb77 100755\n--- a/t/t6027-merge-binary.sh\n+++ b/t/t6027-merge-binary.sh\n@@ -45,7 +45,7 @@ test_expect_success resolve '\n \t\tfalse\n \telse\n \t\tgit ls-files -s >current\n-\t\ttest_cmp current expect\n+\t\ttest_cmp expect current\n \tfi\n '\n \n@@ -60,7 +60,7 @@ test_expect_success recursive '\n \t\tfalse\n \telse\n \t\tgit ls-files -s >current\n-\t\ttest_cmp current expect\n+\t\ttest_cmp expect current\n \tfi\n '\n \ndiff --git a/t/t6031-merge-filemode.sh b/t/t6031-merge-filemode.sh\nindex 7d06461f1..87741efad 100755\n--- a/t/t6031-merge-filemode.sh\n+++ b/t/t6031-merge-filemode.sh\n@@ -61,7 +61,7 @@ do_both_modes () {\n \t\tgit checkout -f a2 &&\n \t\ttest_must_fail git merge -s $strategy b2 &&\n \t\tgit ls-files -u >actual &&\n-\t\ttest_cmp actual expect &&\n+\t\ttest_cmp expect actual &&\n \t\tgit ls-files -s file2 | grep ^100755\n \t'\n \ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex 0f6b569e1..ae4402226 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -29,7 +29,7 @@ test_expect_success 'verify blob:none omits all 5 blobs' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n@@ -42,7 +42,7 @@ test_expect_success 'verify emitted+omitted == all' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n \n@@ -71,7 +71,7 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n@@ -84,7 +84,7 @@ test_expect_success 'verify emitted+omitted == all' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1000' '\n@@ -97,7 +97,7 @@ test_expect_success 'verify blob:limit=1000' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1001' '\n@@ -110,7 +110,7 @@ test_expect_success 'verify blob:limit=1001' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1k' '\n@@ -123,7 +123,7 @@ test_expect_success 'verify blob:limit=1k' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1m' '\n@@ -165,7 +165,7 @@ test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n@@ -178,7 +178,7 @@ test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:oid=<oid-ish> filter.\n@@ -203,7 +203,7 @@ test_expect_success 'verify sparse:oid=OID omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n@@ -216,7 +216,7 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Delete some loose objects and use rev-list, but WITHOUT any filtering.\n@@ -237,7 +237,7 @@ test_expect_success 'rev-list W/ --missing=print' '\n \tsed \"s/?//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'rev-list W/O --missing fails' '\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 324933acf..826987ca8 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -160,7 +160,7 @@ test_expect_success 'checkout -m with merge conflict' '\n \tgit diff master:one :3:uno |\n \tsed -e \"1,/^@@/d\" -e \"/^ /d\" -e \"s/^-/d/\" -e \"s/^+/a/\" >current &&\n \tfill d2 aT d7 aS >expect &&\n-\ttest_cmp current expect &&\n+\ttest_cmp expect current &&\n \tgit diff --cached two >current &&\n \ttest_must_be_empty current\n '\n@@ -174,7 +174,7 @@ test_expect_success 'format of merge conflict from checkout -m' '\n \n \tgit ls-files >current &&\n \tfill same two two two >expect &&\n-\ttest_cmp current expect &&\n+\ttest_cmp expect current &&\n \n \tcat <<-EOF >expect &&\n \t<<<<<<< simple\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex 10dc91620..e87164aa8 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -789,7 +789,7 @@ test_expect_success 'submodule add places git-dir in superprojects git-dir' '\n \t (cd .git/modules/deeper/submodule &&\n \t  git log > ../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -807,7 +807,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir' '\n \t (cd .git/modules/deeper/submodule &&\n \t  git log > ../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -827,7 +827,7 @@ test_expect_success 'submodule add places git-dir in superprojects git-dir recur\n \t git add deeper/submodule &&\n \t git commit -m \"update submodule\" &&\n \t git push origin : &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -874,7 +874,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re\n \t (cd .git/modules/submodule/modules/subsubmodule &&\n \t  git log > ../../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \ndiff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\nindex 668bbee73..562bd215a 100755\n--- a/t/t7800-difftool.sh\n+++ b/t/t7800-difftool.sh\n@@ -557,7 +557,7 @@ test_expect_success SYMLINKS 'difftool --dir-diff --symlink without unstaged cha\n \tEOF\n \tgit difftool --dir-diff --symlink \\\n \t\t--extcmd \"./.git/CHECK_SYMLINKS\" branch HEAD &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n write_script modify-right-file <<\\EOF\ndiff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh\nindex 9af607884..2c309a57d 100755\n--- a/t/t9100-git-svn-basic.sh\n+++ b/t/t9100-git-svn-basic.sh\n@@ -221,7 +221,7 @@ tree d667270a1f7b109f5eb3aaea21ede14b56bfdd6e\n tree 8f51f74cf0163afc9ad68a4b1537288c4558b5a4\n EOF\n \n-test_expect_success POSIXPERM,SYMLINKS \"$name\" \"test_cmp a expected\"\n+test_expect_success POSIXPERM,SYMLINKS \"$name\" \"test_cmp expected a\"\n \n test_expect_success 'exit if remote refs are ambigious' '\n         git config --add svn-remote.svn.fetch \\\ndiff --git a/t/t9133-git-svn-nested-git-repo.sh b/t/t9133-git-svn-nested-git-repo.sh\nindex f3c30e63b..f89486086 100755\n--- a/t/t9133-git-svn-nested-git-repo.sh\n+++ b/t/t9133-git-svn-nested-git-repo.sh\n@@ -45,7 +45,7 @@ test_expect_success 'update git svn-cloned repo' '\n \t\tgit svn rebase &&\n \t\techo a > expect &&\n \t\techo b >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\n@@ -69,7 +69,7 @@ test_expect_success 'update git svn-cloned repo' '\n \t\tgit svn rebase &&\n \t\techo a > expect &&\n \t\techo b >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\n@@ -93,7 +93,7 @@ test_expect_success 'update git svn-cloned repo again' '\n \t\techo a > expect &&\n \t\techo b >> expect &&\n \t\techo c >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\ndiff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh\nindex 5dfee07d9..251fdd66c 100755\n--- a/t/t9600-cvsimport.sh\n+++ b/t/t9600-cvsimport.sh\n@@ -148,7 +148,7 @@ test_expect_success PERL 'import from a CVS working tree' '\n \t\tgit cvsimport -a -z0 &&\n \t\techo 1 >expect &&\n \t\tgit log -1 --pretty=format:%s%n >actual &&\n-\t\ttest_cmp actual expect\n+\t\ttest_cmp expect actual\n \t)\n \n '\ndiff --git a/t/t9603-cvsimport-patchsets.sh b/t/t9603-cvsimport-patchsets.sh\nindex c4c3c4954..3e64b11ea 100755\n--- a/t/t9603-cvsimport-patchsets.sh\n+++ b/t/t9603-cvsimport-patchsets.sh\n@@ -29,11 +29,11 @@ test_expect_failure PERL 'import with criss cross times on revisions' '\n Rev 3\n Rev 2\n Rev 1\" > expect-master &&\n-    test_cmp actual-master expect-master &&\n+    test_cmp expect-master actual-master &&\n \n     echo \"Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000\n Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000\" > expect-A &&\n-    test_cmp actual-A expect-A\n+    test_cmp expect-A actual-A\n '\n \n test_done\ndiff --git a/t/t9604-cvsimport-timestamps.sh b/t/t9604-cvsimport-timestamps.sh\nindex a4b3db24b..2ff4aa932 100755\n--- a/t/t9604-cvsimport-timestamps.sh\n+++ b/t/t9604-cvsimport-timestamps.sh\n@@ -31,7 +31,7 @@ test_expect_success PERL 'check timestamps are UTC (TZ=CST6CDT)' '\n \tRev  2 2005-02-01 00:00:00 +0000\n \tRev  1 2005-01-01 00:00:00 +0000\n \tEOF\n-\ttest_cmp actual-1 expect-1\n+\ttest_cmp expect-1 actual-1\n '\n \n test_expect_success PERL 'check timestamps with author-specific timezones' '\n@@ -65,7 +65,7 @@ test_expect_success PERL 'check timestamps with author-specific timezones' '\n \tRev  2 2005-01-31 18:00:00 -0600 User Two\n \tRev  1 2005-01-01 00:00:00 +0000 User One\n \tEOF\n-\ttest_cmp actual-2 expect-2\n+\ttest_cmp expect-2 actual-2\n '\n \n test_done\n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359546","messageId":"8c0821f68570551675901f4bfdd3149884286c48.1538581868.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1538581868.git.matvore@google.com","subject":"[PATCH v4 5/7] tests: don't swallow Git errors upstream of pipes","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-03T16:26:03Z","receivedAt":"2018-10-03T16:26:37Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Some pipes in tests lose the exit code of git processes, which can mask\nunexpected behavior like crashes. Split these pipes up so that git\ncommands are only at the end of pipes rather than the beginning or\nmiddle.\n\nThe violations fixed in this patch were found in the process of fixing\npipe placement in a prior patch.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/t5317-pack-objects-filter-objects.sh | 156 +++++++++++++------------\n t/t5616-partial-clone.sh               |  14 ++-\n t/t6112-rev-list-filters-objects.sh    | 103 ++++++++--------\n t/t9101-git-svn-props.sh               |   3 +-\n 4 files changed, 143 insertions(+), 133 deletions(-)\n\ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex c093eb891..2e718f0bd 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -20,8 +20,9 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r1 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -29,8 +30,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r1 index-pack ../all.pack &&\n \n-\tgit -C r1 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r1 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -43,8 +44,8 @@ test_expect_success 'verify blob:none packfile has no blobs' '\n \tEOF\n \tgit -C r1 index-pack ../filter.pack &&\n \n-\tgit -C r1 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r1 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -53,13 +54,13 @@ test_expect_success 'verify blob:none packfile has no blobs' '\n '\n \n test_expect_success 'verify normal and blob:none packfiles have same commits/trees' '\n-\tgit -C r1 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r1 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r1 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r1 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -82,8 +83,8 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -91,8 +92,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r2 index-pack ../all.pack &&\n \n-\tgit -C r2 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -105,8 +106,8 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -120,8 +121,8 @@ test_expect_success 'verify blob:limit=1000' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -130,8 +131,8 @@ test_expect_success 'verify blob:limit=1000' '\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.1000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1001 >filter.pack <<-EOF &&\n@@ -139,8 +140,8 @@ test_expect_success 'verify blob:limit=1001' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -148,8 +149,8 @@ test_expect_success 'verify blob:limit=1001' '\n '\n \n test_expect_success 'verify blob:limit=10001' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=10001 >filter.pack <<-EOF &&\n@@ -157,8 +158,8 @@ test_expect_success 'verify blob:limit=10001' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -166,8 +167,8 @@ test_expect_success 'verify blob:limit=10001' '\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.1000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n@@ -175,8 +176,8 @@ test_expect_success 'verify blob:limit=1k' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -184,8 +185,8 @@ test_expect_success 'verify blob:limit=1k' '\n '\n \n test_expect_success 'verify explicitly specifying oversized blob in input' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n@@ -194,8 +195,8 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -203,8 +204,8 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1m >filter.pack <<-EOF &&\n@@ -212,8 +213,8 @@ test_expect_success 'verify blob:limit=1m' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -221,13 +222,13 @@ test_expect_success 'verify blob:limit=1m' '\n '\n \n test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '\n-\tgit -C r2 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r2 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -255,8 +256,9 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r3 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -264,8 +266,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r3 index-pack ../all.pack &&\n \n-\tgit -C r3 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r3 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -273,8 +275,8 @@ test_expect_success 'verify blob count in normal packfile' '\n '\n \n test_expect_success 'verify sparse:path=pattern1' '\n-\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&\n@@ -282,8 +284,8 @@ test_expect_success 'verify sparse:path=pattern1' '\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -291,13 +293,13 @@ test_expect_success 'verify sparse:path=pattern1' '\n '\n \n test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -305,8 +307,8 @@ test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same\n '\n \n test_expect_success 'verify sparse:path=pattern2' '\n-\tgit -C r3 ls-files -s sparse1 dir1/sparse1 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse1 dir1/sparse1 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&\n@@ -314,8 +316,8 @@ test_expect_success 'verify sparse:path=pattern2' '\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -323,13 +325,13 @@ test_expect_success 'verify sparse:path=pattern2' '\n '\n \n test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -356,8 +358,9 @@ test_expect_success 'setup r4' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r4 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -365,8 +368,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r4 index-pack ../all.pack &&\n \n-\tgit -C r4 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r4 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -374,8 +377,8 @@ test_expect_success 'verify blob count in normal packfile' '\n '\n \n test_expect_success 'verify sparse:oid=OID' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \toid=$(git -C r4 ls-files -s pattern | awk -f print_2.awk) &&\n@@ -384,8 +387,8 @@ test_expect_success 'verify sparse:oid=OID' '\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n \n-\tgit -C r4 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r4 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -393,8 +396,8 @@ test_expect_success 'verify sparse:oid=OID' '\n '\n \n test_expect_success 'verify sparse:oid=oid-ish' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r4 pack-objects --rev --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&\n@@ -402,8 +405,8 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n \n-\tgit -C r4 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r4 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -414,8 +417,9 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'setup r1 - delete loose blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tfor id in `cat expected | sed \"s|..|&/|\"`\ndiff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\nindex e4d032c9d..fc7aeb1ab 100755\n--- a/t/t5616-partial-clone.sh\n+++ b/t/t5616-partial-clone.sh\n@@ -35,8 +35,8 @@ test_expect_success 'setup bare clone for server' '\n test_expect_success 'do partial clone 1' '\n \tgit clone --no-checkout --filter=blob:none \"file://$(pwd)/srv.bare\" pc1 &&\n \n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print |\n-\tawk -f print_1.awk |\n+\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n \n@@ -133,16 +133,18 @@ test_expect_success 'push new commits to server for file.3.txt' '\n test_expect_success 'manual prefetch of missing objects' '\n \tgit -C pc1 fetch --filter=blob:none origin &&\n \n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n-\tawk -f print_1.awk |\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n+\t\t>revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n \n \ttest_line_count = 6 observed.oids &&\n \tgit -C pc1 fetch-pack --stdin \"file://$(pwd)/srv.bare\" <observed.oids &&\n \n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n-\tawk -f print_1.awk |\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n+\t\t>revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n \ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex ae4402226..b00cf6fa8 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -20,12 +20,13 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob:none omits all 5 blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -33,12 +34,13 @@ test_expect_success 'verify blob:none omits all 5 blobs' '\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r1 rev-list HEAD --objects |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list HEAD --objects >revs &&\n+\tawk -f print_1.awk revs |\n \tsort >expected &&\n \n-\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none \\\n+\t\t>revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -62,12 +64,12 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob:limit=500 omits all blobs' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -75,12 +77,12 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r2 rev-list HEAD --objects |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --objects >revs &&\n+\tawk -f print_1.awk revs |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -88,12 +90,12 @@ test_expect_success 'verify emitted+omitted == all' '\n '\n \n test_expect_success 'verify blob:limit=1000' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -101,12 +103,12 @@ test_expect_success 'verify blob:limit=1000' '\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -114,12 +116,12 @@ test_expect_success 'verify blob:limit=1001' '\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -127,8 +129,8 @@ test_expect_success 'verify blob:limit=1k' '\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -156,12 +158,12 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse1 sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -169,12 +171,12 @@ test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n '\n \n test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n-\tgit -C r3 ls-files -s sparse2 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse2 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -192,14 +194,14 @@ test_expect_success 'setup r3 part 2' '\n '\n \n test_expect_success 'verify sparse:oid=OID omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \toid=$(git -C r3 ls-files -s pattern | awk -f print_2.awk) &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -207,12 +209,12 @@ test_expect_success 'verify sparse:oid=OID omits top-level files' '\n '\n \n test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -223,8 +225,9 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'rev-list W/ --missing=print' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tfor id in `cat expected | sed \"s|..|&/|\"`\n@@ -232,8 +235,8 @@ test_expect_success 'rev-list W/ --missing=print' '\n \t\trm r1/.git/objects/$id\n \tdone &&\n \n-\tgit -C r1 rev-list --quiet HEAD --missing=print --objects |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list --quiet HEAD --missing=print --objects >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed &&\n \ndiff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\nindex 8a5c8dc1a..8cba331fc 100755\n--- a/t/t9101-git-svn-props.sh\n+++ b/t/t9101-git-svn-props.sh\n@@ -174,7 +174,8 @@ test_expect_success 'test create-ignore' \"\n \tcmp ./deeply/.gitignore create-ignore.expect &&\n \tcmp ./deeply/nested/.gitignore create-ignore.expect &&\n \tcmp ./deeply/nested/directory/.gitignore create-ignore.expect &&\n-\tgit ls-files -s | grep gitignore | cmp - create-ignore-index.expect\n+\tgit ls-files -s >ls_files_result &&\n+\tgrep gitignore ls_files_result | cmp - create-ignore-index.expect\n \t\"\n \n cat >prop.expect <<\\EOF\n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359547","messageId":"5286adcc7184d00383fa24382692e294380ef885.1538581868.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1538581868.git.matvore@google.com","subject":"[PATCH v4 6/7] t9109: don't swallow Git errors upstream of pipes","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-03T16:26:04Z","receivedAt":"2018-10-03T16:26:45Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"'git ... | foo' will mask any errors or crashes in git, so split up such\npipes in this file.\n\nOne testcase uses several separate pipe sequences in a row which are\nawkward to split up. Wrap the split-up pipe in a function so the\nawkwardness is not repeated. Also change that testcase's surrounding\nquotes from double to single to avoid premature string interpolation.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/t9101-git-svn-props.sh | 31 +++++++++++++++++++------------\n 1 file changed, 19 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\nindex 8cba331fc..c26c4b092 100755\n--- a/t/t9101-git-svn-props.sh\n+++ b/t/t9101-git-svn-props.sh\n@@ -190,17 +190,21 @@ EOF\n # This test can be improved: since all the svn:ignore contain the same\n # pattern, it can pass even though the propget did not execute on the\n # right directory.\n-test_expect_success 'test propget' \"\n-\tgit svn propget svn:ignore . | cmp - prop.expect &&\n+test_expect_success 'test propget' '\n+\ttest_propget () {\n+\t\tgit svn propget $1 $2 >actual &&\n+\t\tcmp $3 actual\n+\t} &&\n+\ttest_propget svn:ignore . prop.expect &&\n \tcd deeply &&\n-\tgit svn propget svn:ignore . | cmp - ../prop.expect &&\n-\tgit svn propget svn:entry:committed-rev nested/directory/.keep \\\n-\t  | cmp - ../prop2.expect &&\n-\tgit svn propget svn:ignore .. | cmp - ../prop.expect &&\n-\tgit svn propget svn:ignore nested/ | cmp - ../prop.expect &&\n-\tgit svn propget svn:ignore ./nested | cmp - ../prop.expect &&\n-\tgit svn propget svn:ignore .././deeply/nested | cmp - ../prop.expect\n-\t\"\n+\ttest_propget svn:ignore . ../prop.expect &&\n+\ttest_propget svn:entry:committed-rev nested/directory/.keep \\\n+\t\t../prop2.expect &&\n+\ttest_propget svn:ignore .. ../prop.expect &&\n+\ttest_propget svn:ignore nested/ ../prop.expect &&\n+\ttest_propget svn:ignore ./nested ../prop.expect &&\n+\ttest_propget svn:ignore .././deeply/nested ../prop.expect\n+\t'\n \n cat >prop.expect <<\\EOF\n Properties on '.':\n@@ -219,8 +223,11 @@ Properties on 'nested/directory/.keep':\n EOF\n \n test_expect_success 'test proplist' \"\n-\tgit svn proplist . | cmp - prop.expect &&\n-\tgit svn proplist nested/directory/.keep | cmp - prop2.expect\n+\tgit svn proplist . >actual &&\n+\tcmp prop.expect actual &&\n+\n+\tgit svn proplist nested/directory/.keep >actual &&\n+\tcmp prop2.expect actual\n \t\"\n \n test_done\n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359548","messageId":"bc2b3ec030650c107bd07c63f48bd874bf5f1085.1538581868.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1538581868.git.matvore@google.com","subject":"[PATCH v4 7/7] tests: order arguments to git-rev-list properly","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-03T16:26:05Z","receivedAt":"2018-10-03T16:26:55Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"It is a common mistake to put positional arguments before flags when\ninvoking git-rev-list. Order the positional arguments last.\n\nThis patch skips git-rev-list invocations which include the --not flag,\nsince the ordering of flags and positional arguments affects the\nbehavior. This patch also skips invocations of git-rev-list that occur\nin command substitution in which the exit code is discarded, since\nfixing those properly will require a more involved cleanup.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/t5616-partial-clone.sh            | 26 +++++++++--------\n t/t5702-protocol-v2.sh              |  4 +--\n t/t6112-rev-list-filters-objects.sh | 43 ++++++++++++++++++-----------\n 3 files changed, 44 insertions(+), 29 deletions(-)\n\ndiff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\nindex fc7aeb1ab..eeedd1623 100755\n--- a/t/t5616-partial-clone.sh\n+++ b/t/t5616-partial-clone.sh\n@@ -35,7 +35,7 @@ test_expect_success 'setup bare clone for server' '\n test_expect_success 'do partial clone 1' '\n \tgit clone --no-checkout --filter=blob:none \"file://$(pwd)/srv.bare\" pc1 &&\n \n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print >revs &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print >revs HEAD &&\n \tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n@@ -48,10 +48,10 @@ test_expect_success 'do partial clone 1' '\n \n # checkout master to force dynamic object fetch of blobs at HEAD.\n test_expect_success 'verify checkout with dynamic object fetch' '\n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print >observed &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print HEAD >observed &&\n \ttest_line_count = 4 observed &&\n \tgit -C pc1 checkout master &&\n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print >observed &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print HEAD >observed &&\n \ttest_line_count = 0 observed\n '\n \n@@ -74,7 +74,8 @@ test_expect_success 'push new commits to server' '\n # have the new blobs.\n test_expect_success 'partial fetch inherits filter settings' '\n \tgit -C pc1 fetch origin &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print >observed &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print \\\n+\t\tmaster..origin/master >observed &&\n \ttest_line_count = 5 observed\n '\n \n@@ -82,7 +83,8 @@ test_expect_success 'partial fetch inherits filter settings' '\n # we should only get 1 new blob (for the file in origin/master).\n test_expect_success 'verify diff causes dynamic object fetch' '\n \tgit -C pc1 diff master..origin/master -- file.1.txt &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print >observed &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print \\\n+\t\t master..origin/master >observed &&\n \ttest_line_count = 4 observed\n '\n \n@@ -91,7 +93,8 @@ test_expect_success 'verify diff causes dynamic object fetch' '\n test_expect_success 'verify blame causes dynamic object fetch' '\n \tgit -C pc1 blame origin/master -- file.1.txt >observed.blame &&\n \ttest_cmp expect.blame observed.blame &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print >observed &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print >observed \\\n+\t\tmaster..origin/master &&\n \ttest_line_count = 0 observed\n '\n \n@@ -111,7 +114,8 @@ test_expect_success 'push new commits to server for file.2.txt' '\n # Verify we have all the new blobs.\n test_expect_success 'override inherited filter-spec using --no-filter' '\n \tgit -C pc1 fetch --no-filter origin &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print >observed &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print \\\n+\t\tmaster..origin/master >observed &&\n \ttest_line_count = 0 observed\n '\n \n@@ -133,8 +137,8 @@ test_expect_success 'push new commits to server for file.3.txt' '\n test_expect_success 'manual prefetch of missing objects' '\n \tgit -C pc1 fetch --filter=blob:none origin &&\n \n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n-\t\t>revs &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print \\\n+\t\t master..origin/master >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n@@ -142,8 +146,8 @@ test_expect_success 'manual prefetch of missing objects' '\n \ttest_line_count = 6 observed.oids &&\n \tgit -C pc1 fetch-pack --stdin \"file://$(pwd)/srv.bare\" <observed.oids &&\n \n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n-\t\t>revs &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print \\\n+\t\tmaster..origin/master >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\ndiff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh\nindex 54727450b..11a84efff 100755\n--- a/t/t5702-protocol-v2.sh\n+++ b/t/t5702-protocol-v2.sh\n@@ -271,7 +271,7 @@ test_expect_success 'partial clone' '\n \tgrep \"version 2\" trace &&\n \n \t# Ensure that the old version of the file is missing\n-\tgit -C client rev-list master --quiet --objects --missing=print \\\n+\tgit -C client rev-list --quiet --objects --missing=print master \\\n \t\t>observed.oids &&\n \tgrep \"$(git -C server rev-parse message1:a.txt)\" observed.oids &&\n \n@@ -297,7 +297,7 @@ test_expect_success 'partial fetch' '\n \tgrep \"version 2\" trace &&\n \n \t# Ensure that the old version of the file is missing\n-\tgit -C client rev-list other --quiet --objects --missing=print \\\n+\tgit -C client rev-list --quiet --objects --missing=print other \\\n \t\t>observed.oids &&\n \tgrep \"$(git -C server rev-parse message1:a.txt)\" observed.oids &&\n \ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex b00cf6fa8..53975c572 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -25,7 +25,8 @@ test_expect_success 'verify blob:none omits all 5 blobs' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none >revs &&\n+\tgit -C r1 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=blob:none HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -34,12 +35,12 @@ test_expect_success 'verify blob:none omits all 5 blobs' '\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r1 rev-list HEAD --objects >revs &&\n+\tgit -C r1 rev-list --objects HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsort >expected &&\n \n-\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none \\\n-\t\t>revs &&\n+\tgit -C r1 rev-list --objects --filter-print-omitted --filter=blob:none \\\n+\t\tHEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -68,7 +69,8 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 >revs &&\n+\tgit -C r2 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=blob:limit=500 HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -77,11 +79,12 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r2 rev-list HEAD --objects >revs &&\n+\tgit -C r2 rev-list --objects HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 >revs &&\n+\tgit -C r2 rev-list --objects --filter-print-omitted \\\n+\t\t--filter=blob:limit=500 HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -94,7 +97,8 @@ test_expect_success 'verify blob:limit=1000' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 >revs &&\n+\tgit -C r2 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=blob:limit=1000 HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -107,7 +111,8 @@ test_expect_success 'verify blob:limit=1001' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 >revs &&\n+\tgit -C r2 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=blob:limit=1001 HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -120,7 +125,8 @@ test_expect_success 'verify blob:limit=1k' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k >revs &&\n+\tgit -C r2 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=blob:limit=1k HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -129,7 +135,8 @@ test_expect_success 'verify blob:limit=1k' '\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m >revs &&\n+\tgit -C r2 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=blob:limit=1m HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -162,7 +169,8 @@ test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 >revs &&\n+\tgit -C r3 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=sparse:path=../pattern1 HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -175,7 +183,8 @@ test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 >revs &&\n+\tgit -C r3 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=sparse:path=../pattern2 HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -200,7 +209,8 @@ test_expect_success 'verify sparse:oid=OID omits top-level files' '\n \n \toid=$(git -C r3 ls-files -s pattern | awk -f print_2.awk) &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid >revs &&\n+\tgit -C r3 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=sparse:oid=$oid HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -213,7 +223,8 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern >revs &&\n+\tgit -C r3 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=sparse:oid=master:pattern HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -235,7 +246,7 @@ test_expect_success 'rev-list W/ --missing=print' '\n \t\trm r1/.git/objects/$id\n \tdone &&\n \n-\tgit -C r1 rev-list --quiet HEAD --missing=print --objects >revs &&\n+\tgit -C r1 rev-list --quiet --missing=print --objects HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed &&\n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359549","messageId":"CAMfpvhKyFrYVk53Z5-qkicj5eZWT6B_JBXijPDOazKqaCia9_Q@mail.gmail.com","threadId":"49352","inReplyTo":"bc2b3ec030650c107bd07c63f48bd874bf5f1085.1538581868.git.matvore@google.com","subject":"Re: [PATCH v4 7/7] tests: order arguments to git-rev-list properly","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-03T16:33:50Z","receivedAt":"2018-10-03T16:34:05Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Wed, Oct 3, 2018 at 9:26 AM Matthew DeVore <matvore@google.com> wrote:\n>\n> -       git -C pc1 rev-list HEAD --quiet --objects --missing=print >revs &&\n> +       git -C pc1 rev-list --quiet --objects --missing=print >revs HEAD &&\n>         awk -f print_1.awk revs |\n...\n>         git -C pc1 blame origin/master -- file.1.txt >observed.blame &&\n>         test_cmp expect.blame observed.blame &&\n> -       git -C pc1 rev-list master..origin/master --quiet --objects --missing=print >observed &&\n> +       git -C pc1 rev-list --quiet --objects --missing=print >observed \\\n> +               master..origin/master &&\n>         test_line_count = 0 observed\n\nI screwed up by putting the positional argument *after* the\nredirection. Sorry for the mix-up. This is interestingly syntactically\nvalid, though bad stylistically. Here is an inter-diff:\n\ndiff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\nindex eeedd1623..6ff614692 100755\n--- a/t/t5616-partial-clone.sh\n+++ b/t/t5616-partial-clone.sh\n@@ -35,7 +35,7 @@ test_expect_success 'setup bare clone for server' '\n test_expect_success 'do partial clone 1' '\n         git clone --no-checkout --filter=blob:none\n\"file://$(pwd)/srv.bare\" pc1 &&\n\n-        git -C pc1 rev-list --quiet --objects --missing=print >revs HEAD &&\n+        git -C pc1 rev-list --quiet --objects --missing=print HEAD >revs &&\n         awk -f print_1.awk revs |\n         sed \"s/?//\" |\n         sort >observed.oids &&\n@@ -93,8 +93,8 @@ test_expect_success 'verify diff causes dynamic\nobject fetch' '\n test_expect_success 'verify blame causes dynamic object fetch' '\n         git -C pc1 blame origin/master -- file.1.txt >observed.blame &&\n         test_cmp expect.blame observed.blame &&\n-        git -C pc1 rev-list --quiet --objects --missing=print >observed \\\n-                master..origin/master &&\n+        git -C pc1 rev-list --quiet --objects --missing=print \\\n+                master..origin/master >observed &&\n         test_line_count = 0 observed\n '\n"},{"id":"359654","messageId":"xmqq4le03ome.fsf@gitster-ct.c.googlers.com","threadId":"49352","inReplyTo":"32f6f14f8d3323468b4255927cca028a82f64b39.1538581868.git.matvore@google.com","subject":"Re: [PATCH v4 1/7] t/README: reformat Do, Don't, Keep in mind lists","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-10-05T06:15:53Z","receivedAt":"2018-10-05T06:15:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthew DeVore <matvore@google.com> writes:\n\n> diff --git a/t/README b/t/README\n> index 9028b47d9..85024aba6 100644\n> --- a/t/README\n> +++ b/t/README\n> @@ -393,13 +393,13 @@ This test harness library does the following things:\n>     consistently when command line arguments --verbose (or -v),\n>     --debug (or -d), and --immediate (or -i) is given.\n>  \n> -Do's, don'ts & things to keep in mind\n> +Do's & don'ts\n>  -------------------------------------\n\nWe may not format this with AsciiDoc, but please shorten the\nunderline so that it aligns with the line above that it applies to.\n\n>  Here are a few examples of things you probably should and shouldn't do\n>  when writing tests.\n"},{"id":"359658","messageId":"xmqqtvm0zu4a.fsf@gitster-ct.c.googlers.com","threadId":"49352","inReplyTo":"CAMfpvhKyFrYVk53Z5-qkicj5eZWT6B_JBXijPDOazKqaCia9_Q@mail.gmail.com","subject":"Re: [PATCH v4 7/7] tests: order arguments to git-rev-list properly","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-10-05T08:16:05Z","receivedAt":"2018-10-05T08:16:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthew DeVore <matvore@google.com> writes:\n\n> I screwed up by putting the positional argument *after* the\n> redirection. Sorry for the mix-up. This is interestingly syntactically\n> valid, though bad stylistically. Here is an inter-diff:\n\nThanks for being careful.  Except for a rather idiomatic \n\n\techo >&2 message ...\n\nwhich has redirection at the beginning to emphasize that the output\ngoes to the standard error stream, I do agree with your \"stylistic\"\nchoice of keeping the redirection at the end.\n\n> diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\n> index eeedd1623..6ff614692 100755\n> --- a/t/t5616-partial-clone.sh\n> +++ b/t/t5616-partial-clone.sh\n> @@ -35,7 +35,7 @@ test_expect_success 'setup bare clone for server' '\n>  test_expect_success 'do partial clone 1' '\n>          git clone --no-checkout --filter=blob:none\n> \"file://$(pwd)/srv.bare\" pc1 &&\n>\n> -        git -C pc1 rev-list --quiet --objects --missing=print >revs HEAD &&\n> +        git -C pc1 rev-list --quiet --objects --missing=print HEAD >revs &&\n>          awk -f print_1.awk revs |\n>          sed \"s/?//\" |\n>          sort >observed.oids &&\n> @@ -93,8 +93,8 @@ test_expect_success 'verify diff causes dynamic\n> object fetch' '\n>  test_expect_success 'verify blame causes dynamic object fetch' '\n>          git -C pc1 blame origin/master -- file.1.txt >observed.blame &&\n>          test_cmp expect.blame observed.blame &&\n> -        git -C pc1 rev-list --quiet --objects --missing=print >observed \\\n> -                master..origin/master &&\n> +        git -C pc1 rev-list --quiet --objects --missing=print \\\n> +                master..origin/master >observed &&\n>          test_line_count = 0 observed\n>  '\n"},{"id":"359690","messageId":"CAMfpvh+6JGpY8WBGYvh7z96mxw6qFnt2xV23oibRep=ON+7J9Q@mail.gmail.com","threadId":"49352","inReplyTo":"xmqq4le03ome.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v4 1/7] t/README: reformat Do, Don't, Keep in mind lists","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-05T14:57:46Z","receivedAt":"2018-10-05T14:58:03Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Thu, Oct 4, 2018 at 11:15 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Matthew DeVore <matvore@google.com> writes:\n>\n> > -Do's, don'ts & things to keep in mind\n> > +Do's & don'ts\n> >  -------------------------------------\n>\n> We may not format this with AsciiDoc, but please shorten the\n> underline so that it aligns with the line above that it applies to.\n>\nThanks - Done. I will send a re-roll within the next 8 hours assuming\nno further comments.\n"},{"id":"359701","messageId":"xmqqd0sowda4.fsf@gitster-ct.c.googlers.com","threadId":"49352","inReplyTo":"8c0821f68570551675901f4bfdd3149884286c48.1538581868.git.matvore@google.com","subject":"Re: [PATCH v4 5/7] tests: don't swallow Git errors upstream of pipes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-10-05T16:48:03Z","receivedAt":"2018-10-05T16:48:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthew DeVore <matvore@google.com> writes:\n\n> Some pipes in tests lose the exit code of git processes, which can mask\n> unexpected behavior like crashes. Split these pipes up so that git\n> commands are only at the end of pipes rather than the beginning or\n> middle.\n>\n> The violations fixed in this patch were found in the process of fixing\n> pipe placement in a prior patch.\n\nHopefully this is not a blind mechanical patch, as introduction of\nunexpected temporary files in the working tree could interfere with\nlater tests (e.g. they may expect exact set of untracked files, and\nthese new temporary files would b unexpected additions).\n\nThanks.\n"},{"id":"359702","messageId":"xmqq5zygwd9k.fsf@gitster-ct.c.googlers.com","threadId":"49352","inReplyTo":"a45b646fced228e5a7fab4db7a35c1c6084e58d0.1538581868.git.matvore@google.com","subject":"Re: [PATCH v4 2/7] Documentation: add shell guidelines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-10-05T16:48:23Z","receivedAt":"2018-10-05T16:48:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthew DeVore <matvore@google.com> writes:\n\n> Add the following guideline to Documentation/CodingGuidelines:\n>\n> \t&&, ||, and | should appear at the end of lines, not the\n> \tbeginning, and the \\ line continuation character should be\n> \tomitted\n\n\"should be omitted\" sounds as if it is the norm to have such a\ncharacter, but it is not.  The text in the actual patch body does a\nmuch better job than this.\n\nPerhaps\n\n\tBreak overlong lines after \"&&\", \"||\", and \"|\", not before\n\tthem; that way the command can continue to subsequent lines\n\twithout backslash at the end.\n\n> And the following to t/README (since it is specific to writing tests):\n>\n> \tpipes and $(git ...) should be avoided when they swallow exit\n> \tcodes of Git processes\n\nGood.\n\n> Signed-off-by: Matthew DeVore <matvore@google.com>\n> ---\n>  Documentation/CodingGuidelines | 18 ++++++++++++++++++\n>  t/README                       | 28 ++++++++++++++++++++++++++++\n>  2 files changed, 46 insertions(+)\n>\n> diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\n> index 48aa4edfb..72967deb7 100644\n> --- a/Documentation/CodingGuidelines\n> +++ b/Documentation/CodingGuidelines\n> @@ -118,6 +118,24 @@ For shell scripts specifically (not exhaustive):\n>  \t\tdo this\n>  \tfi\n>  \n> + - If a command sequence joined with && or || or | spans multiple\n> +   lines, put each command on a separate line and put && and || and |\n> +   operators at the end of each line, rather than the start. This\n> +   means you don't need to use \\ to join lines, since the above\n> +   operators imply the sequence isn't finished.\n\nCorrect.  Even though I wonder if we need to say the last sentence,\nwhich is rather obvious, patch is already written and I do not see\nmuch point editing this further.\n\n> +\t(incorrect)\n> +\tgrep blob verify_pack_result \\\n> +\t| awk -f print_1.awk \\\n> +\t| sort >actual &&\n> +\t...\n> +\n> +\t(correct)\n> +\tgrep blob verify_pack_result |\n> +\tawk -f print_1.awk |\n> +\tsort >actual &&\n> +\t...\n> +\n>   - We prefer \"test\" over \"[ ... ]\".\n>  \n>   - We do not write the noiseword \"function\" in front of shell\n> diff --git a/t/README b/t/README\n> index 85024aba6..9a71d5732 100644\n> --- a/t/README\n> +++ b/t/README\n> @@ -466,6 +466,34 @@ And here are the \"don'ts:\"\n>     platform commands; just use '! cmd'.  We are not in the business\n>     of verifying that the world given to us sanely works.\n>  \n> + - Don't use Git upstream in the non-final position in a piped chain, as\n> +   in:\n\n\"upstream in the non-final position\" is a bit redundant, isn't it?\n\n  - Don't feed the output of 'git' to a pipe, as in:\n\n> +\n> +     git -C repo ls-files |\n> +     xargs -n 1 basename |\n> +     grep foo\n> +\n> +   which will discard git's exit code and may mask a crash. In the\n> +   above example, all exit codes are ignored except grep's.\n\nGood.\n\n> +   Instead, write the output of that command to a temporary\n> +   file with \">\" or assign it to a variable with \"x=$(git ...)\" rather\n> +   than pipe it.\n> +\n> + - Don't use command substitution in a way that discards git's exit\n> +   code. When assigning to a variable, the exit code is not discarded,\n> +   e.g.:\n> +\n> +     x=$(git cat-file -p $sha) &&\n> +     ...\n> +\n> +   is OK because a crash in \"git cat-file\" will cause the \"&&\" chain\n> +   to fail, but:\n> +\n> +     test \"refs/heads/foo\" = \"$(git symbolic-ref HEAD)\"\n> +\n> +   is not OK and a crash in git could go undetected.\n\nGood.\n\n>   - Don't use perl without spelling it as \"$PERL_PATH\". This is to help\n>     our friends on Windows where the platform Perl often adds CR before\n>     the end of line, and they bundle Git with a version of Perl that\n"},{"id":"359710","messageId":"CAMfpvhJasrpDxgt+LATsSQf68LB97hCQnCCnRMJP51iXDc34SQ@mail.gmail.com","threadId":"49352","inReplyTo":"xmqqd0sowda4.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v4 5/7] tests: don't swallow Git errors upstream of pipes","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-05T17:54:16Z","receivedAt":"2018-10-05T17:54:31Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Fri, Oct 5, 2018 at 9:48 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Hopefully this is not a blind mechanical patch, as introduction of\n> unexpected temporary files in the working tree could interfere with\n> later tests (e.g. they may expect exact set of untracked files, and\n> these new temporary files would b unexpected additions).\n>\n> Thanks.\n\nI reviewed the files modified in this patch. For the svn one, there\nare other scratch files being created in the cwd before mine, so my\nadditions should be fine, I admit I don't fully understand the\ncommands being run in that test...after the temp files are created, I\nsee git svn proplist and git svn propget being executed... the public\ndocumentation for them does not seem to contradict my assumption.\n(http://svnbook.red-bean.com/en/1.6/svn.ref.svn.c.propget.html)\n\nAs for the other test files in this patch, all git invocations are\neither \"git clone\" or \"git init <dir>\" or \"git -C ...\" which means\nnone of them care about extra files in the cwd. After I searched for\nGit commands I read through the files somewhat briskly and looked for\nany globs or suspicious invocations of awk, grep, or other commands\n(we really do use a limited number of commands in the tests I saw :)\nand did not find anything that depended on existence or non-existence\nof unnamed files.\n"},{"id":"359711","messageId":"CAMfpvh+0kugh8g=5KzAao6tru0k0Gp2-OY8km+Xr7fBDk4PmyQ@mail.gmail.com","threadId":"49352","inReplyTo":"CAMfpvhJasrpDxgt+LATsSQf68LB97hCQnCCnRMJP51iXDc34SQ@mail.gmail.com","subject":"Re: [PATCH v4 5/7] tests: don't swallow Git errors upstream of pipes","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-05T18:12:39Z","receivedAt":"2018-10-05T18:12:54Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"I just realized that the changes to t9101 should actually be part of\nthe next patch (6/7), not this one. I've fixed that for the next\nre-roll.\n"},{"id":"359712","messageId":"CAMfpvhKgr8EFbc-hkEcC4ocjW2U2YCopeRuMyLTq9xk9cd8b=A@mail.gmail.com","threadId":"49352","inReplyTo":"xmqq5zygwd9k.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v4 2/7] Documentation: add shell guidelines","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-05T18:21:22Z","receivedAt":"2018-10-05T18:21:36Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"On Fri, Oct 5, 2018 at 9:48 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Matthew DeVore <matvore@google.com> writes:\n>\n> > Add the following guideline to Documentation/CodingGuidelines:\n> >\n> >       &&, ||, and | should appear at the end of lines, not the\n> >       beginning, and the \\ line continuation character should be\n> >       omitted\n>\n> \"should be omitted\" sounds as if it is the norm to have such a\n> character, but it is not.  The text in the actual patch body does a\n> much better job than this.\n>\n> Perhaps\n>\n>         Break overlong lines after \"&&\", \"||\", and \"|\", not before\n>         them; that way the command can continue to subsequent lines\n>         without backslash at the end.\nThat sounds good. Fixed.\n\n> > + - If a command sequence joined with && or || or | spans multiple\n> > +   lines, put each command on a separate line and put && and || and |\n> > +   operators at the end of each line, rather than the start. This\n> > +   means you don't need to use \\ to join lines, since the above\n> > +   operators imply the sequence isn't finished.\n>\n> Correct.  Even though I wonder if we need to say the last sentence,\n> which is rather obvious, patch is already written and I do not see\n> much point editing this further.\nack\n\n> > @@ -466,6 +466,34 @@ And here are the \"don'ts:\"\n> >     platform commands; just use '! cmd'.  We are not in the business\n> >     of verifying that the world given to us sanely works.\n> >\n> > + - Don't use Git upstream in the non-final position in a piped chain, as\n> > +   in:\n>\n> \"upstream in the non-final position\" is a bit redundant, isn't it?\n>\n>   - Don't feed the output of 'git' to a pipe, as in:\n\nDone, but I changed it to \"Don't feed the output of a git command to a\npipe, as in:\" since referring to it as \"git command\" without the\nquotes seems rather common in this file.\n\nThank you for the review!\n"},{"id":"359750","messageId":"cover.1538775186.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1536969438.git.matvore@google.com","subject":"[PATCH v5 0/7] subject: Clean up tests for test_cmp arg ordering and pipe placement","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-05T21:54:00Z","receivedAt":"2018-10-05T21:54:15Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"This version of the patchset fixes some wording and formatting issues\npointed out by Junio. The commit message in the first patch has also\nbeen reworded.\n\nThank you,\nMatt\n\ndiff --git a/t/README b/t/README\nindex 9a71d5732..ab9fa4230 100644\n--- a/t/README\n+++ b/t/README\n@@ -394,7 +394,7 @@ This test harness library does the following things:\n    --debug (or -d), and --immediate (or -i) is given.\n \n Do's & don'ts\n--------------------------------------\n+-------------\n \n Here are a few examples of things you probably should and shouldn't do\n when writing tests.\n@@ -466,8 +466,7 @@ And here are the \"don'ts:\"\n    platform commands; just use '! cmd'.  We are not in the business\n    of verifying that the world given to us sanely works.\n \n- - Don't use Git upstream in the non-final position in a piped chain, as\n-   in:\n+ - Don't feed the output of a git command to a pipe, as in:\n \n      git -C repo ls-files |\n      xargs -n 1 basename |\ndiff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\nindex eeedd1623..6ff614692 100755\n--- a/t/t5616-partial-clone.sh\n+++ b/t/t5616-partial-clone.sh\n@@ -35,7 +35,7 @@ test_expect_success 'setup bare clone for server' '\n test_expect_success 'do partial clone 1' '\n         git clone --no-checkout --filter=blob:none \"file://$(pwd)/srv.bare\" pc1 &&\n \n-        git -C pc1 rev-list --quiet --objects --missing=print >revs HEAD &&\n+        git -C pc1 rev-list --quiet --objects --missing=print HEAD >revs &&\n         awk -f print_1.awk revs |\n         sed \"s/?//\" |\n         sort >observed.oids &&\n@@ -93,8 +93,8 @@ test_expect_success 'verify diff causes dynamic object fetch' '\n test_expect_success 'verify blame causes dynamic object fetch' '\n         git -C pc1 blame origin/master -- file.1.txt >observed.blame &&\n         test_cmp expect.blame observed.blame &&\n-        git -C pc1 rev-list --quiet --objects --missing=print >observed \\\n-                master..origin/master &&\n+        git -C pc1 rev-list --quiet --objects --missing=print \\\n+                master..origin/master >observed &&\n         test_line_count = 0 observed\n '\n \n\nMatthew DeVore (7):\n  t/README: reformat Do, Don't, Keep in mind lists\n  Documentation: add shell guidelines\n  tests: standardize pipe placement\n  t/*: fix ordering of expected/observed arguments\n  tests: don't swallow Git errors upstream of pipes\n  t9109: don't swallow Git errors upstream of pipes\n  tests: order arguments to git-rev-list properly\n\n Documentation/CodingGuidelines         |  18 ++\n t/README                               |  69 +++--\n t/lib-gpg.sh                           |   9 +-\n t/t0000-basic.sh                       |   2 +-\n t/t0021-conversion.sh                  |   4 +-\n t/t1006-cat-file.sh                    |   8 +-\n t/t1300-config.sh                      |   9 +-\n t/t1303-wacky-config.sh                |   4 +-\n t/t2101-update-index-reupdate.sh       |   2 +-\n t/t3200-branch.sh                      |   2 +-\n t/t3320-notes-merge-worktrees.sh       |   4 +-\n t/t3400-rebase.sh                      |   8 +-\n t/t3417-rebase-whitespace-fix.sh       |   6 +-\n t/t3702-add-edit.sh                    |   4 +-\n t/t3903-stash.sh                       |   8 +-\n t/t3905-stash-include-untracked.sh     |   2 +-\n t/t4025-hunk-header.sh                 |   2 +-\n t/t4117-apply-reject.sh                |   6 +-\n t/t4124-apply-ws-rule.sh               |  30 +--\n t/t4138-apply-ws-expansion.sh          |   2 +-\n t/t5317-pack-objects-filter-objects.sh | 360 ++++++++++++++-----------\n t/t5318-commit-graph.sh                |   2 +-\n t/t5500-fetch-pack.sh                  |   7 +-\n t/t5616-partial-clone.sh               |  50 ++--\n t/t5701-git-serve.sh                   |  14 +-\n t/t5702-protocol-v2.sh                 |  14 +-\n t/t6023-merge-file.sh                  |  12 +-\n t/t6027-merge-binary.sh                |   4 +-\n t/t6031-merge-filemode.sh              |   2 +-\n t/t6112-rev-list-filters-objects.sh    | 237 +++++++++-------\n t/t7201-co.sh                          |   4 +-\n t/t7406-submodule-update.sh            |   8 +-\n t/t7800-difftool.sh                    |   2 +-\n t/t9100-git-svn-basic.sh               |   2 +-\n t/t9101-git-svn-props.sh               |  34 ++-\n t/t9133-git-svn-nested-git-repo.sh     |   6 +-\n t/t9600-cvsimport.sh                   |   2 +-\n t/t9603-cvsimport-patchsets.sh         |   4 +-\n t/t9604-cvsimport-timestamps.sh        |   4 +-\n 39 files changed, 568 insertions(+), 399 deletions(-)\n\n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359751","messageId":"8a71066fdf46c9d2297d0211c693f7287251f56b.1538775186.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1538775186.git.matvore@google.com","subject":"[PATCH v5 1/7] t/README: reformat Do, Don't, Keep in mind lists","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-05T21:54:01Z","receivedAt":"2018-10-05T21:54:17Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"The list of Don'ts for test writing has grown large such that it is hard\nto see at a glance which section an item is in. In other words, if I\nignore a little bit of surrounding context, the \"don'ts\" look like\n\"do's.\"\n\nTo make the list more readable, prefix \"Don't\" in front of every first\nsentence in the items.\n\nAlso, the \"Keep in mind\" list is out of place and awkward, because it\nwas a very short \"list\" beneath two very long ones, and it seemed easy\nto miss under the list of \"don'ts,\" and it only had one item. So move\nthis item to the list of \"do's\" and phrase as \"Remember...\"\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/README | 42 ++++++++++++++++++++----------------------\n 1 file changed, 20 insertions(+), 22 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex 9028b47d9..68012d673 100644\n--- a/t/README\n+++ b/t/README\n@@ -393,13 +393,13 @@ This test harness library does the following things:\n    consistently when command line arguments --verbose (or -v),\n    --debug (or -d), and --immediate (or -i) is given.\n \n-Do's, don'ts & things to keep in mind\n--------------------------------------\n+Do's & don'ts\n+-------------\n \n Here are a few examples of things you probably should and shouldn't do\n when writing tests.\n \n-Do:\n+Here are the \"do's:\"\n \n  - Put all code inside test_expect_success and other assertions.\n \n@@ -444,16 +444,21 @@ Do:\n    Windows, where the shell (MSYS bash) mangles absolute path names.\n    For details, see the commit message of 4114156ae9.\n \n-Don't:\n+ - Remember that inside the <script> part, the standard output and\n+   standard error streams are discarded, and the test harness only\n+   reports \"ok\" or \"not ok\" to the end user running the tests. Under\n+   --verbose, they are shown to help debug the tests.\n+\n+And here are the \"don'ts:\"\n \n- - exit() within a <script> part.\n+ - Don't exit() within a <script> part.\n \n    The harness will catch this as a programming error of the test.\n    Use test_done instead if you need to stop the tests early (see\n    \"Skipping tests\" below).\n \n- - use '! git cmd' when you want to make sure the git command exits\n-   with failure in a controlled way by calling \"die()\".  Instead,\n+ - Don't use '! git cmd' when you want to make sure the git command\n+   exits with failure in a controlled way by calling \"die()\".  Instead,\n    use 'test_must_fail git cmd'.  This will signal a failure if git\n    dies in an unexpected way (e.g. segfault).\n \n@@ -461,8 +466,8 @@ Don't:\n    platform commands; just use '! cmd'.  We are not in the business\n    of verifying that the world given to us sanely works.\n \n- - use perl without spelling it as \"$PERL_PATH\". This is to help our\n-   friends on Windows where the platform Perl often adds CR before\n+ - Don't use perl without spelling it as \"$PERL_PATH\". This is to help\n+   our friends on Windows where the platform Perl often adds CR before\n    the end of line, and they bundle Git with a version of Perl that\n    does not do so, whose path is specified with $PERL_PATH. Note that we\n    provide a \"perl\" function which uses $PERL_PATH under the hood, so\n@@ -470,17 +475,17 @@ Don't:\n    (but you do, for example, on a shebang line or in a sub script\n    created via \"write_script\").\n \n- - use sh without spelling it as \"$SHELL_PATH\", when the script can\n-   be misinterpreted by broken platform shell (e.g. Solaris).\n+ - Don't use sh without spelling it as \"$SHELL_PATH\", when the script\n+   can be misinterpreted by broken platform shell (e.g. Solaris).\n \n- - chdir around in tests.  It is not sufficient to chdir to\n+ - Don't chdir around in tests.  It is not sufficient to chdir to\n    somewhere and then chdir back to the original location later in\n    the test, as any intermediate step can fail and abort the test,\n    causing the next test to start in an unexpected directory.  Do so\n    inside a subshell if necessary.\n \n- - save and verify the standard error of compound commands, i.e. group\n-   commands, subshells, and shell functions (except test helper\n+ - Don't save and verify the standard error of compound commands, i.e.\n+   group commands, subshells, and shell functions (except test helper\n    functions like 'test_must_fail') like this:\n \n      ( cd dir && git cmd ) 2>error &&\n@@ -495,7 +500,7 @@ Don't:\n      ( cd dir && git cmd 2>../error ) &&\n      test_cmp expect error\n \n- - Break the TAP output\n+ - Don't break the TAP output\n \n    The raw output from your test may be interpreted by a TAP harness. TAP\n    harnesses will ignore everything they don't know about, but don't step\n@@ -515,13 +520,6 @@ Don't:\n    but the best indication is to just run the tests with prove(1),\n    it'll complain if anything is amiss.\n \n-Keep in mind:\n-\n- - Inside the <script> part, the standard output and standard error\n-   streams are discarded, and the test harness only reports \"ok\" or\n-   \"not ok\" to the end user running the tests. Under --verbose, they\n-   are shown to help debugging the tests.\n-\n \n Skipping tests\n --------------\n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359752","messageId":"038311316a85dd1ca3bbe068e94ae6e305fdb740.1538775186.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1538775186.git.matvore@google.com","subject":"[PATCH v5 2/7] Documentation: add shell guidelines","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-05T21:54:02Z","receivedAt":"2018-10-05T21:54:19Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Add the following guideline to Documentation/CodingGuidelines:\n\n\tBreak overlong lines after \"&&\", \"||\", and \"|\", not before\n\tthem; that way the command can continue to subsequent lines\n\twithout backslash at the end.\n\nAnd the following to t/README (since it is specific to writing tests):\n\n\tPipes and $(git ...) should be avoided when they swallow exit\n\tcodes of Git processes\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n Documentation/CodingGuidelines | 18 ++++++++++++++++++\n t/README                       | 27 +++++++++++++++++++++++++++\n 2 files changed, 45 insertions(+)\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex 48aa4edfb..72967deb7 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -118,6 +118,24 @@ For shell scripts specifically (not exhaustive):\n \t\tdo this\n \tfi\n \n+ - If a command sequence joined with && or || or | spans multiple\n+   lines, put each command on a separate line and put && and || and |\n+   operators at the end of each line, rather than the start. This\n+   means you don't need to use \\ to join lines, since the above\n+   operators imply the sequence isn't finished.\n+\n+\t(incorrect)\n+\tgrep blob verify_pack_result \\\n+\t| awk -f print_1.awk \\\n+\t| sort >actual &&\n+\t...\n+\n+\t(correct)\n+\tgrep blob verify_pack_result |\n+\tawk -f print_1.awk |\n+\tsort >actual &&\n+\t...\n+\n  - We prefer \"test\" over \"[ ... ]\".\n \n  - We do not write the noiseword \"function\" in front of shell\ndiff --git a/t/README b/t/README\nindex 68012d673..ab9fa4230 100644\n--- a/t/README\n+++ b/t/README\n@@ -466,6 +466,33 @@ And here are the \"don'ts:\"\n    platform commands; just use '! cmd'.  We are not in the business\n    of verifying that the world given to us sanely works.\n \n+ - Don't feed the output of a git command to a pipe, as in:\n+\n+     git -C repo ls-files |\n+     xargs -n 1 basename |\n+     grep foo\n+\n+   which will discard git's exit code and may mask a crash. In the\n+   above example, all exit codes are ignored except grep's.\n+\n+   Instead, write the output of that command to a temporary\n+   file with \">\" or assign it to a variable with \"x=$(git ...)\" rather\n+   than pipe it.\n+\n+ - Don't use command substitution in a way that discards git's exit\n+   code. When assigning to a variable, the exit code is not discarded,\n+   e.g.:\n+\n+     x=$(git cat-file -p $sha) &&\n+     ...\n+\n+   is OK because a crash in \"git cat-file\" will cause the \"&&\" chain\n+   to fail, but:\n+\n+     test \"refs/heads/foo\" = \"$(git symbolic-ref HEAD)\"\n+\n+   is not OK and a crash in git could go undetected.\n+\n  - Don't use perl without spelling it as \"$PERL_PATH\". This is to help\n    our friends on Windows where the platform Perl often adds CR before\n    the end of line, and they bundle Git with a version of Perl that\n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359753","messageId":"18801db0e77be16f13c3022d507d9ed6b570efbc.1538775186.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1538775186.git.matvore@google.com","subject":"[PATCH v5 3/7] tests: standardize pipe placement","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-05T21:54:03Z","receivedAt":"2018-10-05T21:54:23Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Instead of using a line-continuation and pipe on the second line, take\nadvantage of the shell's implicit line continuation after a pipe\ncharacter.  So for example, instead of\n\n\tsome long line \\\n\t\t| next line\n\nuse\n\n\tsome long line |\n\tnext line\n\nAnd add a blank line before and after the pipe where it aids readability\n(it usually does).\n\nThis better matches the coding style documented in\nDocumentation/CodingGuidelines and used in shell scripts elsewhere in\nthe tree.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/lib-gpg.sh                           |   9 +-\n t/t1006-cat-file.sh                    |   8 +-\n t/t1300-config.sh                      |   5 +-\n t/t5317-pack-objects-filter-objects.sh | 330 ++++++++++++++-----------\n t/t5500-fetch-pack.sh                  |   7 +-\n t/t5616-partial-clone.sh               |  32 ++-\n t/t6112-rev-list-filters-objects.sh    | 203 ++++++++-------\n 7 files changed, 344 insertions(+), 250 deletions(-)\n\ndiff --git a/t/lib-gpg.sh b/t/lib-gpg.sh\nindex 3fe02876c..f1277bef4 100755\n--- a/t/lib-gpg.sh\n+++ b/t/lib-gpg.sh\n@@ -57,9 +57,12 @@ then\n \t\techo | gpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null \\\n \t\t\t--passphrase-fd 0 --pinentry-mode loopback \\\n \t\t\t--import \"$TEST_DIRECTORY\"/lib-gpg/gpgsm_cert.p12 &&\n-\t\tgpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null -K \\\n-\t\t\t| grep fingerprint: | cut -d\" \" -f4 | tr -d '\\n' > \\\n-\t\t\t${GNUPGHOME}/trustlist.txt &&\n+\n+\t\tgpgsm --homedir \"${GNUPGHOME}\" 2>/dev/null -K |\n+\t\tgrep fingerprint: |\n+\t\tcut -d\" \" -f4 |\n+\t\ttr -d '\\n' >\"${GNUPGHOME}/trustlist.txt\" &&\n+\n \t\techo \" S relax\" >> ${GNUPGHOME}/trustlist.txt &&\n \t\t(gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) &&\n \t\techo hello | gpgsm --homedir \"${GNUPGHOME}\" >/dev/null \\\ndiff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh\nindex 7f19d591f..a0fa926d3 100755\n--- a/t/t1006-cat-file.sh\n+++ b/t/t1006-cat-file.sh\n@@ -218,8 +218,8 @@ test_expect_success \"--batch-check for a non-existent hash\" '\n     test \"0000000000000000000000000000000000000042 missing\n 0000000000000000000000000000000000000084 missing\" = \\\n     \"$( ( echo 0000000000000000000000000000000000000042;\n-         echo_without_newline 0000000000000000000000000000000000000084; ) \\\n-       | git cat-file --batch-check)\"\n+         echo_without_newline 0000000000000000000000000000000000000084; ) |\n+       git cat-file --batch-check)\"\n '\n \n test_expect_success \"--batch for an existent and a non-existent hash\" '\n@@ -227,8 +227,8 @@ test_expect_success \"--batch for an existent and a non-existent hash\" '\n $tag_content\n 0000000000000000000000000000000000000000 missing\" = \\\n     \"$( ( echo $tag_sha1;\n-         echo_without_newline 0000000000000000000000000000000000000000; ) \\\n-       | git cat-file --batch)\"\n+         echo_without_newline 0000000000000000000000000000000000000000; ) |\n+       git cat-file --batch)\"\n '\n \n test_expect_success \"--batch-check for an empty line\" '\ndiff --git a/t/t1300-config.sh b/t/t1300-config.sh\nindex cdf1fed5d..5869d6cb6 100755\n--- a/t/t1300-config.sh\n+++ b/t/t1300-config.sh\n@@ -1770,8 +1770,9 @@ test_expect_success '--show-origin stdin with file include' '\n \tcat >expect <<-EOF &&\n \t\tfile:$INCLUDE_DIR/stdin.include\tinclude\n \tEOF\n-\techo \"[include]path=\\\"$INCLUDE_DIR\\\"/stdin.include\" \\\n-\t\t| git config --show-origin --includes --file - user.stdin >output &&\n+\techo \"[include]path=\\\"$INCLUDE_DIR\\\"/stdin.include\" |\n+\tgit config --show-origin --includes --file - user.stdin >output &&\n+\n \ttest_cmp expect output\n '\n \ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex 6710c8bc8..ce69148ec 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -20,17 +20,20 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r1 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r1 index-pack ../all.pack &&\n-\tgit -C r1 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -39,23 +42,27 @@ test_expect_success 'verify blob:none packfile has no blobs' '\n \tHEAD\n \tEOF\n \tgit -C r1 index-pack ../filter.pack &&\n-\tgit -C r1 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n \n test_expect_success 'verify normal and blob:none packfiles have same commits/trees' '\n-\tgit -C r1 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r1 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -75,17 +82,20 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../all.pack &&\n-\tgit -C r2 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -94,10 +104,12 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n@@ -107,99 +119,118 @@ test_expect_success 'verify blob:limit=1000' '\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \tnr=$(wc -l <observed) &&\n \ttest 0 -eq $nr\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.1000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1001 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=10001' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=10001 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.1000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify explicitly specifying oversized blob in input' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n \tHEAD\n \t$(git -C r2 rev-parse HEAD:large.10000)\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1m >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '\n-\tgit -C r2 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r2 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -224,71 +255,84 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../all.pack &&\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern1' '\n-\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern2' '\n-\tgit -C r3 ls-files -s sparse1 dir1/sparse1 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s sparse1 dir1/sparse1 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 verify-pack -v ../filter.pack \\\n-\t\t| grep -E \"commit|tree\" \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\tgit -C r3 verify-pack -v ../all.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 verify-pack -v ../filter.pack |\n+\tgrep -E \"commit|tree\" |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -312,48 +356,57 @@ test_expect_success 'setup r4' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r4 pack-objects --rev --stdout >all.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../all.pack &&\n-\tgit -C r4 verify-pack -v ../all.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../all.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=OID' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \toid=$(git -C r4 ls-files -s pattern | awk -f print_2.awk) &&\n \tgit -C r4 pack-objects --rev --stdout --filter=sparse:oid=$oid >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n-\tgit -C r4 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=oid-ish' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tgit -C r4 pack-objects --rev --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&\n \tHEAD\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n-\tgit -C r4 verify-pack -v ../filter.pack \\\n-\t\t| grep blob \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r4 verify-pack -v ../filter.pack |\n+\tgrep blob |\n+\tawk -f print_1.awk |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -361,9 +414,10 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'setup r1 - delete loose blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tfor id in `cat expected | sed \"s|..|&/|\"`\n \tdo\n \t\trm r1/.git/objects/$id\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 1b5a4a6d3..086f2c40f 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -50,8 +50,11 @@ pull_to_client () {\n \t\t\tcase \"$heads\" in *B*)\n \t\t\t    git update-ref refs/heads/B \"$BTIP\";;\n \t\t\tesac &&\n-\t\t\tgit symbolic-ref HEAD refs/heads/$(echo $heads \\\n-\t\t\t\t| sed -e \"s/^\\(.\\).*$/\\1/\") &&\n+\n+\t\t\tgit symbolic-ref HEAD refs/heads/$(\n+\t\t\t\techo $heads |\n+\t\t\t\tsed -e \"s/^\\(.\\).*$/\\1/\"\n+\t\t\t) &&\n \n \t\t\tgit fsck --full &&\n \ndiff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\nindex bbbe7537d..e4d032c9d 100755\n--- a/t/t5616-partial-clone.sh\n+++ b/t/t5616-partial-clone.sh\n@@ -34,10 +34,12 @@ test_expect_success 'setup bare clone for server' '\n # confirm partial clone was registered in the local config.\n test_expect_success 'do partial clone 1' '\n \tgit clone --no-checkout --filter=blob:none \"file://$(pwd)/srv.bare\" pc1 &&\n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_cmp expect_1.oids observed.oids &&\n \ttest \"$(git -C pc1 config --local core.repositoryformatversion)\" = \"1\" &&\n \ttest \"$(git -C pc1 config --local extensions.partialclone)\" = \"origin\" &&\n@@ -130,16 +132,20 @@ test_expect_success 'push new commits to server for file.3.txt' '\n # perhaps combined with a command in dry-run mode.\n test_expect_success 'manual prefetch of missing objects' '\n \tgit -C pc1 fetch --filter=blob:none origin &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_line_count = 6 observed.oids &&\n \tgit -C pc1 fetch-pack --stdin \"file://$(pwd)/srv.bare\" <observed.oids &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed.oids &&\n+\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed.oids &&\n+\n \ttest_line_count = 0 observed.oids\n '\n \n@@ -194,7 +200,7 @@ test_expect_success 'upon cloning, check that all refs point to objects' '\n \n \t# Craft a packfile not including that blob.\n \tgit -C \"$SERVER\" rev-parse HEAD |\n-\t\tgit -C \"$SERVER\" pack-objects --stdout >incomplete.pack &&\n+\tgit -C \"$SERVER\" pack-objects --stdout >incomplete.pack &&\n \n \t# Replace the existing packfile with the crafted one. The protocol\n \t# requires that the packfile be sent in sideband 1, hence the extra\ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex d4ff0b3be..0f6b569e1 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -20,24 +20,28 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob:none omits all 5 blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r1 rev-list HEAD --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r1 rev-list HEAD --objects |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -58,65 +62,76 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob:limit=500 omits all blobs' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r2 rev-list HEAD --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 rev-list HEAD --objects |\n+\tawk -f print_1.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1000' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.1000 large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.10000 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 ls-files -s large.10000 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_must_be_empty observed\n '\n \n@@ -141,24 +156,28 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n-\tgit -C r3 ls-files -s sparse2 dir1/sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s sparse2 dir1/sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -173,25 +192,30 @@ test_expect_success 'setup r3 part 2' '\n '\n \n test_expect_success 'verify sparse:oid=OID omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \toid=$(git -C r3 ls-files -s pattern | awk -f print_2.awk) &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/~//\" \\\n-\t\t| sort >observed &&\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern |\n+\tawk -f print_1.awk |\n+\tsed \"s/~//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n@@ -199,17 +223,20 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'rev-list W/ --missing=print' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n-\t\t| awk -f print_2.awk \\\n-\t\t| sort >expected &&\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n+\tawk -f print_2.awk |\n+\tsort >expected &&\n+\n \tfor id in `cat expected | sed \"s|..|&/|\"`\n \tdo\n \t\trm r1/.git/objects/$id\n \tdone &&\n-\tgit -C r1 rev-list --quiet HEAD --missing=print --objects \\\n-\t\t| awk -f print_1.awk \\\n-\t\t| sed \"s/?//\" \\\n-\t\t| sort >observed &&\n+\n+\tgit -C r1 rev-list --quiet HEAD --missing=print --objects |\n+\tawk -f print_1.awk |\n+\tsed \"s/?//\" |\n+\tsort >observed &&\n+\n \ttest_cmp observed expected\n '\n \n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359754","messageId":"b22221ee652eaa52d9ed5e54a286d777bbf689ec.1538775186.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1538775186.git.matvore@google.com","subject":"[PATCH v5 4/7] t/*: fix ordering of expected/observed arguments","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-05T21:54:04Z","receivedAt":"2018-10-05T21:54:25Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Fix various places where the ordering was obviously wrong, meaning it\nwas easy to find with grep.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/t0000-basic.sh                       |  2 +-\n t/t0021-conversion.sh                  |  4 +--\n t/t1300-config.sh                      |  4 +--\n t/t1303-wacky-config.sh                |  4 +--\n t/t2101-update-index-reupdate.sh       |  2 +-\n t/t3200-branch.sh                      |  2 +-\n t/t3320-notes-merge-worktrees.sh       |  4 +--\n t/t3400-rebase.sh                      |  8 +++---\n t/t3417-rebase-whitespace-fix.sh       |  6 ++---\n t/t3702-add-edit.sh                    |  4 +--\n t/t3903-stash.sh                       |  8 +++---\n t/t3905-stash-include-untracked.sh     |  2 +-\n t/t4025-hunk-header.sh                 |  2 +-\n t/t4117-apply-reject.sh                |  6 ++---\n t/t4124-apply-ws-rule.sh               | 30 +++++++++++------------\n t/t4138-apply-ws-expansion.sh          |  2 +-\n t/t5317-pack-objects-filter-objects.sh | 34 +++++++++++++-------------\n t/t5318-commit-graph.sh                |  2 +-\n t/t5701-git-serve.sh                   | 14 +++++------\n t/t5702-protocol-v2.sh                 | 10 ++++----\n t/t6023-merge-file.sh                  | 12 ++++-----\n t/t6027-merge-binary.sh                |  4 +--\n t/t6031-merge-filemode.sh              |  2 +-\n t/t6112-rev-list-filters-objects.sh    | 24 +++++++++---------\n t/t7201-co.sh                          |  4 +--\n t/t7406-submodule-update.sh            |  8 +++---\n t/t7800-difftool.sh                    |  2 +-\n t/t9100-git-svn-basic.sh               |  2 +-\n t/t9133-git-svn-nested-git-repo.sh     |  6 ++---\n t/t9600-cvsimport.sh                   |  2 +-\n t/t9603-cvsimport-patchsets.sh         |  4 +--\n t/t9604-cvsimport-timestamps.sh        |  4 +--\n 32 files changed, 112 insertions(+), 112 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex 850f651e4..224c098a8 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -1018,7 +1018,7 @@ test_expect_success SHA1 'validate git diff-files output for a know cache/work t\n :120000 120000 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c 0000000000000000000000000000000000000000 M\tpath3/subp3/file3sym\n EOF\n \tgit diff-files >current &&\n-\ttest_cmp current expected\n+\ttest_cmp expected current\n '\n \n test_expect_success 'git update-index --refresh should succeed' '\ndiff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh\nindex 308cd28f3..fd5f1ac64 100755\n--- a/t/t0021-conversion.sh\n+++ b/t/t0021-conversion.sh\n@@ -166,10 +166,10 @@ test_expect_success expanded_in_repo '\n \trm -f expanded-keywords expanded-keywords-crlf &&\n \n \tgit checkout -- expanded-keywords &&\n-\ttest_cmp expanded-keywords expected-output &&\n+\ttest_cmp expected-output expanded-keywords &&\n \n \tgit checkout -- expanded-keywords-crlf &&\n-\ttest_cmp expanded-keywords-crlf expected-output-crlf\n+\ttest_cmp expected-output-crlf expanded-keywords-crlf\n '\n \n # The use of %f in a filter definition is expanded to the path to\ndiff --git a/t/t1300-config.sh b/t/t1300-config.sh\nindex 5869d6cb6..e2cd50ecf 100755\n--- a/t/t1300-config.sh\n+++ b/t/t1300-config.sh\n@@ -1001,7 +1001,7 @@ EOF\n \n test_expect_success 'value continued on next line' '\n \tgit config --list > result &&\n-\ttest_cmp result expect\n+\ttest_cmp expect result\n '\n \n cat > .git/config <<\\EOF\n@@ -1882,7 +1882,7 @@ test_expect_success '--replace-all does not invent newlines' '\n \tQkey = b\n \tEOF\n \tgit config --replace-all abc.key b &&\n-\ttest_cmp .git/config expect\n+\ttest_cmp expect .git/config\n '\n \n test_done\ndiff --git a/t/t1303-wacky-config.sh b/t/t1303-wacky-config.sh\nindex 3b92083e1..0000e664e 100755\n--- a/t/t1303-wacky-config.sh\n+++ b/t/t1303-wacky-config.sh\n@@ -14,7 +14,7 @@ setup() {\n check() {\n \techo \"$2\" >expected\n \tgit config --get \"$1\" >actual 2>&1\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n }\n \n # 'check section.key regex value' verifies that the entry for\n@@ -22,7 +22,7 @@ check() {\n check_regex() {\n \techo \"$3\" >expected\n \tgit config --get \"$1\" \"$2\" >actual 2>&1\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n }\n \n test_expect_success 'modify same key' '\ndiff --git a/t/t2101-update-index-reupdate.sh b/t/t2101-update-index-reupdate.sh\nindex 685ec4563..6c32d42c8 100755\n--- a/t/t2101-update-index-reupdate.sh\n+++ b/t/t2101-update-index-reupdate.sh\n@@ -73,7 +73,7 @@ test_expect_success 'update-index --update from subdir' '\n \t100644 $(git hash-object dir1/file3) 0\tdir1/file3\n \t100644 $file2 0\tfile2\n \tEOF\n-\ttest_cmp current expected\n+\ttest_cmp expected current\n '\n \n test_expect_success 'update-index --update with pathspec' '\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex 93f21ab07..478b82cf9 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -1221,7 +1221,7 @@ test_expect_success 'use --edit-description' '\n \tEOF\n \tEDITOR=./editor git branch --edit-description &&\n \techo \"New contents\" >expect &&\n-\ttest_cmp EDITOR_OUTPUT expect\n+\ttest_cmp expect EDITOR_OUTPUT\n '\n \n test_expect_success 'detect typo in branch name when using --edit-description' '\ndiff --git a/t/t3320-notes-merge-worktrees.sh b/t/t3320-notes-merge-worktrees.sh\nindex 10bfc8b94..823fdbda1 100755\n--- a/t/t3320-notes-merge-worktrees.sh\n+++ b/t/t3320-notes-merge-worktrees.sh\n@@ -44,7 +44,7 @@ test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '\n \tgit config core.notesRef refs/notes/y &&\n \ttest_must_fail git notes merge z &&\n \techo \"ref: refs/notes/y\" >expect &&\n-\ttest_cmp .git/NOTES_MERGE_REF expect\n+\ttest_cmp expect .git/NOTES_MERGE_REF\n '\n \n test_expect_success 'merge z into y while mid-merge in another workdir fails' '\n@@ -66,7 +66,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '\n \t\tgrep -v \"A notes merge into refs/notes/x is already in-progress in\" out\n \t) &&\n \techo \"ref: refs/notes/x\" >expect &&\n-\ttest_cmp .git/worktrees/worktree2/NOTES_MERGE_REF expect\n+\ttest_cmp expect .git/worktrees/worktree2/NOTES_MERGE_REF\n '\n \n test_done\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 3996ee013..3e73f7584 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -183,13 +183,13 @@ test_expect_success 'cherry-picked commits and fork-point work together' '\n \ttest_commit final_B B \"Final B\" &&\n \tgit rebase &&\n \techo Amended >expect &&\n-\ttest_cmp A expect &&\n+\ttest_cmp expect A &&\n \techo \"Final B\" >expect &&\n-\ttest_cmp B expect &&\n+\ttest_cmp expect B &&\n \techo C >expect &&\n-\ttest_cmp C expect &&\n+\ttest_cmp expect C &&\n \techo D >expect &&\n-\ttest_cmp D expect\n+\ttest_cmp expect D\n '\n \n test_expect_success 'rebase -q is quiet' '\ndiff --git a/t/t3417-rebase-whitespace-fix.sh b/t/t3417-rebase-whitespace-fix.sh\nindex 1fb3e499b..e85cdc703 100755\n--- a/t/t3417-rebase-whitespace-fix.sh\n+++ b/t/t3417-rebase-whitespace-fix.sh\n@@ -55,7 +55,7 @@ test_expect_success 'blank line at end of file; extend at end of file' '\n \tgit add file &&\tgit commit -m second &&\n \tgit rebase --whitespace=fix HEAD^^ &&\n \tgit diff --exit-code HEAD^:file expect-first &&\n-\ttest_cmp file expect-second\n+\ttest_cmp expect-second file\n '\n \n # prepare third revision of \"file\"\n@@ -82,7 +82,7 @@ test_expect_success 'two blanks line at end of file; extend at end of file' '\n \tcp third file && git add file && git commit -m third &&\n \tgit rebase --whitespace=fix HEAD^^ &&\n \tgit diff --exit-code HEAD^:file expect-second &&\n-\ttest_cmp file expect-third\n+\ttest_cmp expect-third file\n '\n \n test_expect_success 'same, but do not remove trailing spaces' '\n@@ -120,7 +120,7 @@ test_expect_success 'at beginning of file' '\n \tdone >> file &&\n \tgit commit -m more file\t&&\n \tgit rebase --whitespace=fix HEAD^^ &&\n-\ttest_cmp file expect-beginning\n+\ttest_cmp expect-beginning file\n '\n \n test_done\ndiff --git a/t/t3702-add-edit.sh b/t/t3702-add-edit.sh\nindex c6af7f82b..6c676645d 100755\n--- a/t/t3702-add-edit.sh\n+++ b/t/t3702-add-edit.sh\n@@ -110,10 +110,10 @@ test_expect_success 'add -e' '\n \tcp second-part file &&\n \tgit add -e &&\n \ttest_cmp second-part file &&\n-\ttest_cmp orig-patch expected-patch &&\n+\ttest_cmp expected-patch orig-patch &&\n \tgit diff --cached >actual &&\n \tgrep -v index actual >out &&\n-\ttest_cmp out expected\n+\ttest_cmp expected out\n \n '\n \ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 6450bc669..cd216655b 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -36,7 +36,7 @@ EOF\n test_expect_success 'parents of stash' '\n \ttest $(git rev-parse stash^) = $(git rev-parse HEAD) &&\n \tgit diff stash^2..stash > output &&\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n '\n \n test_expect_success 'applying bogus stash does nothing' '\n@@ -210,9 +210,9 @@ test_expect_success 'stash branch' '\n \ttest refs/heads/stashbranch = $(git symbolic-ref HEAD) &&\n \ttest $(git rev-parse HEAD) = $(git rev-parse master^) &&\n \tgit diff --cached > output &&\n-\ttest_cmp output expect &&\n+\ttest_cmp expect output &&\n \tgit diff > output &&\n-\ttest_cmp output expect1 &&\n+\ttest_cmp expect1 output &&\n \tgit add file &&\n \tgit commit -m alternate\\ second &&\n \tgit diff master..stashbranch > output &&\n@@ -710,7 +710,7 @@ test_expect_success 'stash where working directory contains \"HEAD\" file' '\n \tgit diff-index --cached --quiet HEAD &&\n \ttest \"$(git rev-parse stash^)\" = \"$(git rev-parse HEAD)\" &&\n \tgit diff stash^..stash > output &&\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n '\n \n test_expect_success 'store called with invalid commit' '\ndiff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh\nindex 597b0637d..cc1c8a7bb 100755\n--- a/t/t3905-stash-include-untracked.sh\n+++ b/t/t3905-stash-include-untracked.sh\n@@ -142,7 +142,7 @@ test_expect_success 'stash save --include-untracked removed files' '\n \trm -f file &&\n \tgit stash save --include-untracked &&\n \techo 1 > expect &&\n-\ttest_cmp file expect\n+\ttest_cmp expect file\n '\n \n rm -f expect\ndiff --git a/t/t4025-hunk-header.sh b/t/t4025-hunk-header.sh\nindex fa44e7886..35578f2bb 100755\n--- a/t/t4025-hunk-header.sh\n+++ b/t/t4025-hunk-header.sh\n@@ -37,7 +37,7 @@ test_expect_success 'hunk header truncation with an overly long line' '\n \t\techo \" A $N$N$N$N$N$N$N$N$N2\" &&\n \t\techo \" L  $N$N$N$N$N$N$N$N$N1\"\n \t) >expected &&\n-\ttest_cmp actual expected\n+\ttest_cmp expected actual\n \n '\n \ndiff --git a/t/t4117-apply-reject.sh b/t/t4117-apply-reject.sh\nindex d80187de9..f7de6f077 100755\n--- a/t/t4117-apply-reject.sh\n+++ b/t/t4117-apply-reject.sh\n@@ -72,7 +72,7 @@ test_expect_success 'apply with --reject should fail but update the file' '\n \trm -f file1.rej file2.rej &&\n \n \ttest_must_fail git apply --reject patch.1 &&\n-\ttest_cmp file1 expected &&\n+\ttest_cmp expected file1 &&\n \n \tcat file1.rej &&\n \ttest_path_is_missing file2.rej\n@@ -85,7 +85,7 @@ test_expect_success 'apply with --reject should fail but update the file' '\n \n \ttest_must_fail git apply --reject patch.2 >rejects &&\n \ttest_path_is_missing file1 &&\n-\ttest_cmp file2 expected &&\n+\ttest_cmp expected file2 &&\n \n \tcat file2.rej &&\n \ttest_path_is_missing file1.rej\n@@ -99,7 +99,7 @@ test_expect_success 'the same test with --verbose' '\n \n \ttest_must_fail git apply --reject --verbose patch.2 >rejects &&\n \ttest_path_is_missing file1 &&\n-\ttest_cmp file2 expected &&\n+\ttest_cmp expected file2 &&\n \n \tcat file2.rej &&\n \ttest_path_is_missing file1.rej\ndiff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh\nindex 7e32237a2..ff51e9e78 100755\n--- a/t/t4124-apply-ws-rule.sh\n+++ b/t/t4124-apply-ws-rule.sh\n@@ -313,9 +313,9 @@ test_expect_success 'applying beyond EOF requires one non-blank context line' '\n \t{ echo a; echo; } >one &&\n \tcp one expect &&\n \ttest_must_fail git apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \ttest_must_fail git apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'tons of blanks at EOF should not apply' '\n@@ -342,10 +342,10 @@ test_expect_success 'missing blank line at end with --whitespace=fix' '\n \tcp one saved-one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv saved-one one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'two missing blank lines at end with --whitespace=fix' '\n@@ -360,11 +360,11 @@ test_expect_success 'two missing blank lines at end with --whitespace=fix' '\n \tcp no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'missing blank line at end, insert before end, --whitespace=fix' '\n@@ -376,7 +376,7 @@ test_expect_success 'missing blank line at end, insert before end, --whitespace=\n \techo a >one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'shrink file with tons of missing blanks at end of file' '\n@@ -392,10 +392,10 @@ test_expect_success 'shrink file with tons of missing blanks at end of file' '\n \tcp no-blank-lines one &&\n \ttest_must_fail git apply patch &&\n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect &&\n+\ttest_cmp expect one &&\n \tmv no-blank-lines one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'missing blanks at EOF must only match blank lines' '\n@@ -427,7 +427,7 @@ test_expect_success 'missing blank line should match context line with spaces' '\n \tgit add one &&\n \n \tgit apply --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n sed -e's/Z//' >one <<EOF\n@@ -447,7 +447,7 @@ test_expect_success 'same, but with the --ignore-space-option' '\n \n \tgit checkout-index -f one &&\n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '\n@@ -464,7 +464,7 @@ test_expect_success 'same, but with CR-LF line endings && cr-at-eol set' '\n \tmv save-one one &&\n \n \tgit apply --ignore-space-change --whitespace=fix patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'CR-LF line endings && add line && text=auto' '\n@@ -478,7 +478,7 @@ test_expect_success 'CR-LF line endings && add line && text=auto' '\n \tmv save-one one &&\n \techo \"one text=auto\" >.gitattributes &&\n \tgit apply patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'CR-LF line endings && change line && text=auto' '\n@@ -491,7 +491,7 @@ test_expect_success 'CR-LF line endings && change line && text=auto' '\n \tmv save-one one &&\n \techo \"one text=auto\" >.gitattributes &&\n \tgit apply patch &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'LF in repo, CRLF in worktree && change line && text=auto' '\n@@ -503,7 +503,7 @@ test_expect_success 'LF in repo, CRLF in worktree && change line && text=auto' '\n \techo \"one text=auto\" >.gitattributes &&\n \tgit -c core.eol=CRLF apply patch &&\n \tprintf \"b\\r\\n\" >expect &&\n-\ttest_cmp one expect\n+\ttest_cmp expect one\n '\n \n test_expect_success 'whitespace=fix to expand' '\ndiff --git a/t/t4138-apply-ws-expansion.sh b/t/t4138-apply-ws-expansion.sh\nindex 0ffe33fbe..3b636a63a 100755\n--- a/t/t4138-apply-ws-expansion.sh\n+++ b/t/t4138-apply-ws-expansion.sh\n@@ -114,7 +114,7 @@ for t in 1 2 3 4\n do\n \ttest_expect_success 'apply with ws expansion (t=$t)' '\n \t\tgit apply patch$t.patch &&\n-\t\ttest_cmp test-$t expect-$t\n+\t\ttest_cmp expect-$t test-$t\n \t'\n done\n \ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex ce69148ec..c093eb891 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -34,7 +34,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:none packfile has no blobs' '\n@@ -63,7 +63,7 @@ test_expect_success 'verify normal and blob:none packfiles have same commits/tre\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test blob:limit=<n>[kmg] filter.\n@@ -96,7 +96,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=500 omits all blobs' '\n@@ -144,7 +144,7 @@ test_expect_success 'verify blob:limit=1001' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=10001' '\n@@ -162,7 +162,7 @@ test_expect_success 'verify blob:limit=10001' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1k' '\n@@ -180,7 +180,7 @@ test_expect_success 'verify blob:limit=1k' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify explicitly specifying oversized blob in input' '\n@@ -199,7 +199,7 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1m' '\n@@ -217,7 +217,7 @@ test_expect_success 'verify blob:limit=1m' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '\n@@ -231,7 +231,7 @@ test_expect_success 'verify normal and blob:limit packfiles have same commits/tr\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:path=<path> filter.\n@@ -269,7 +269,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern1' '\n@@ -287,7 +287,7 @@ test_expect_success 'verify sparse:path=pattern1' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '\n@@ -301,7 +301,7 @@ test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern2' '\n@@ -319,7 +319,7 @@ test_expect_success 'verify sparse:path=pattern2' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '\n@@ -333,7 +333,7 @@ test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:oid=<oid-ish> filter.\n@@ -370,7 +370,7 @@ test_expect_success 'verify blob count in normal packfile' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=OID' '\n@@ -389,7 +389,7 @@ test_expect_success 'verify sparse:oid=OID' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=oid-ish' '\n@@ -407,7 +407,7 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Delete some loose objects and use pack-objects, but WITHOUT any filtering.\ndiff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh\nindex 0c500f7ca..d6da3ce4e 100755\n--- a/t/t5318-commit-graph.sh\n+++ b/t/t5318-commit-graph.sh\n@@ -35,7 +35,7 @@ test_expect_success 'create commits and repack' '\n graph_git_two_modes() {\n \tgit -c core.commitGraph=true $1 >output\n \tgit -c core.commitGraph=false $1 >expect\n-\ttest_cmp output expect\n+\ttest_cmp expect output\n }\n \n graph_git_behavior() {\ndiff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh\nindex 75ec79e6c..bf139e245 100755\n--- a/t/t5701-git-serve.sh\n+++ b/t/t5701-git-serve.sh\n@@ -16,7 +16,7 @@ test_expect_success 'test capability advertisement' '\n \n \tgit serve --advertise-capabilities >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'stateless-rpc flag does not list capabilities' '\n@@ -89,7 +89,7 @@ test_expect_success 'basics of ls-refs' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'basic ref-prefixes' '\n@@ -109,7 +109,7 @@ test_expect_success 'basic ref-prefixes' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'refs/heads prefix' '\n@@ -129,7 +129,7 @@ test_expect_success 'refs/heads prefix' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'peel parameter' '\n@@ -150,7 +150,7 @@ test_expect_success 'peel parameter' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'symrefs parameter' '\n@@ -171,7 +171,7 @@ test_expect_success 'symrefs parameter' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'sending server-options' '\n@@ -191,7 +191,7 @@ test_expect_success 'sending server-options' '\n \n \tgit serve --stateless-rpc <in >out &&\n \ttest-pkt-line unpack <out >actual &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'unexpected lines are not allowed in fetch request' '\ndiff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh\nindex 3beeed454..54727450b 100755\n--- a/t/t5702-protocol-v2.sh\n+++ b/t/t5702-protocol-v2.sh\n@@ -29,7 +29,7 @@ test_expect_success 'list refs with git:// using protocol v2' '\n \tgrep \"git< version 2\" log &&\n \n \tgit ls-remote --symref \"$GIT_DAEMON_URL/parent\" >expect &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'ref advertisment is filtered with ls-remote using protocol v2' '\n@@ -42,7 +42,7 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol\n \t$(git -C \"$daemon_parent\" rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'clone with git:// using protocol v2' '\n@@ -138,7 +138,7 @@ test_expect_success 'list refs with file:// using protocol v2' '\n \tgrep \"git< version 2\" log &&\n \n \tgit ls-remote --symref \"file://$(pwd)/file_parent\" >expect &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'ref advertisment is filtered with ls-remote using protocol v2' '\n@@ -151,7 +151,7 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol\n \t$(git -C file_parent rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'server-options are sent when using ls-remote' '\n@@ -164,7 +164,7 @@ test_expect_success 'server-options are sent when using ls-remote' '\n \t$(git -C file_parent rev-parse refs/heads/master)$(printf \"\\t\")refs/heads/master\n \tEOF\n \n-\ttest_cmp actual expect &&\n+\ttest_cmp expect actual &&\n \tgrep \"server-option=hello\" log &&\n \tgrep \"server-option=world\" log\n '\ndiff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh\nindex 20aee43f9..51ee887a7 100755\n--- a/t/t6023-merge-file.sh\n+++ b/t/t6023-merge-file.sh\n@@ -99,7 +99,7 @@ EOF\n printf \"propter nomen suum.\" >> expect.txt\n \n test_expect_success \"merge does not add LF away of change\" \\\n-\t\"test_cmp test3.txt expect.txt\"\n+\t\"test_cmp expect.txt test3.txt\"\n \n cp test.txt backup.txt\n test_expect_success \"merge with conflicts\" \\\n@@ -122,7 +122,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n \n-test_expect_success \"expected conflict markers\" \"test_cmp test.txt expect.txt\"\n+test_expect_success \"expected conflict markers\" \"test_cmp expect.txt test.txt\"\n \n cp backup.txt test.txt\n \n@@ -138,7 +138,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --ours\" \\\n-\t\"git merge-file --ours test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --ours test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n cat > expect.txt << EOF\n@@ -154,7 +154,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --theirs\" \\\n-\t\"git merge-file --theirs test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --theirs test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n cat > expect.txt << EOF\n@@ -171,7 +171,7 @@ non timebo mala, quoniam tu mecum es:\n virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n test_expect_success \"merge conflicting with --union\" \\\n-\t\"git merge-file --union test.txt orig.txt new3.txt && test_cmp test.txt expect.txt\"\n+\t\"git merge-file --union test.txt orig.txt new3.txt && test_cmp expect.txt test.txt\"\n cp backup.txt test.txt\n \n test_expect_success \"merge with conflicts, using -L\" \\\n@@ -195,7 +195,7 @@ virga tua et baculus tuus ipsa me consolata sunt.\n EOF\n \n test_expect_success \"expected conflict markers, with -L\" \\\n-\t\"test_cmp test.txt expect.txt\"\n+\t\"test_cmp expect.txt test.txt\"\n \n sed \"s/ tu / TU /\" < new1.txt > new5.txt\n test_expect_success \"conflict in removed tail\" \\\ndiff --git a/t/t6027-merge-binary.sh b/t/t6027-merge-binary.sh\nindex 07735410b..4e6c7cb77 100755\n--- a/t/t6027-merge-binary.sh\n+++ b/t/t6027-merge-binary.sh\n@@ -45,7 +45,7 @@ test_expect_success resolve '\n \t\tfalse\n \telse\n \t\tgit ls-files -s >current\n-\t\ttest_cmp current expect\n+\t\ttest_cmp expect current\n \tfi\n '\n \n@@ -60,7 +60,7 @@ test_expect_success recursive '\n \t\tfalse\n \telse\n \t\tgit ls-files -s >current\n-\t\ttest_cmp current expect\n+\t\ttest_cmp expect current\n \tfi\n '\n \ndiff --git a/t/t6031-merge-filemode.sh b/t/t6031-merge-filemode.sh\nindex 7d06461f1..87741efad 100755\n--- a/t/t6031-merge-filemode.sh\n+++ b/t/t6031-merge-filemode.sh\n@@ -61,7 +61,7 @@ do_both_modes () {\n \t\tgit checkout -f a2 &&\n \t\ttest_must_fail git merge -s $strategy b2 &&\n \t\tgit ls-files -u >actual &&\n-\t\ttest_cmp actual expect &&\n+\t\ttest_cmp expect actual &&\n \t\tgit ls-files -s file2 | grep ^100755\n \t'\n \ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex 0f6b569e1..ae4402226 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -29,7 +29,7 @@ test_expect_success 'verify blob:none omits all 5 blobs' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n@@ -42,7 +42,7 @@ test_expect_success 'verify emitted+omitted == all' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n \n@@ -71,7 +71,7 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n@@ -84,7 +84,7 @@ test_expect_success 'verify emitted+omitted == all' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1000' '\n@@ -97,7 +97,7 @@ test_expect_success 'verify blob:limit=1000' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1001' '\n@@ -110,7 +110,7 @@ test_expect_success 'verify blob:limit=1001' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1k' '\n@@ -123,7 +123,7 @@ test_expect_success 'verify blob:limit=1k' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify blob:limit=1m' '\n@@ -165,7 +165,7 @@ test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n@@ -178,7 +178,7 @@ test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Test sparse:oid=<oid-ish> filter.\n@@ -203,7 +203,7 @@ test_expect_success 'verify sparse:oid=OID omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n@@ -216,7 +216,7 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n # Delete some loose objects and use rev-list, but WITHOUT any filtering.\n@@ -237,7 +237,7 @@ test_expect_success 'rev-list W/ --missing=print' '\n \tsed \"s/?//\" |\n \tsort >observed &&\n \n-\ttest_cmp observed expected\n+\ttest_cmp expected observed\n '\n \n test_expect_success 'rev-list W/O --missing fails' '\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 324933acf..826987ca8 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -160,7 +160,7 @@ test_expect_success 'checkout -m with merge conflict' '\n \tgit diff master:one :3:uno |\n \tsed -e \"1,/^@@/d\" -e \"/^ /d\" -e \"s/^-/d/\" -e \"s/^+/a/\" >current &&\n \tfill d2 aT d7 aS >expect &&\n-\ttest_cmp current expect &&\n+\ttest_cmp expect current &&\n \tgit diff --cached two >current &&\n \ttest_must_be_empty current\n '\n@@ -174,7 +174,7 @@ test_expect_success 'format of merge conflict from checkout -m' '\n \n \tgit ls-files >current &&\n \tfill same two two two >expect &&\n-\ttest_cmp current expect &&\n+\ttest_cmp expect current &&\n \n \tcat <<-EOF >expect &&\n \t<<<<<<< simple\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex 10dc91620..e87164aa8 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -789,7 +789,7 @@ test_expect_success 'submodule add places git-dir in superprojects git-dir' '\n \t (cd .git/modules/deeper/submodule &&\n \t  git log > ../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -807,7 +807,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir' '\n \t (cd .git/modules/deeper/submodule &&\n \t  git log > ../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -827,7 +827,7 @@ test_expect_success 'submodule add places git-dir in superprojects git-dir recur\n \t git add deeper/submodule &&\n \t git commit -m \"update submodule\" &&\n \t git push origin : &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \n@@ -874,7 +874,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re\n \t (cd .git/modules/submodule/modules/subsubmodule &&\n \t  git log > ../../../../../actual\n \t ) &&\n-\t test_cmp actual expected\n+\t test_cmp expected actual\n \t)\n '\n \ndiff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\nindex 668bbee73..562bd215a 100755\n--- a/t/t7800-difftool.sh\n+++ b/t/t7800-difftool.sh\n@@ -557,7 +557,7 @@ test_expect_success SYMLINKS 'difftool --dir-diff --symlink without unstaged cha\n \tEOF\n \tgit difftool --dir-diff --symlink \\\n \t\t--extcmd \"./.git/CHECK_SYMLINKS\" branch HEAD &&\n-\ttest_cmp actual expect\n+\ttest_cmp expect actual\n '\n \n write_script modify-right-file <<\\EOF\ndiff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh\nindex 9af607884..2c309a57d 100755\n--- a/t/t9100-git-svn-basic.sh\n+++ b/t/t9100-git-svn-basic.sh\n@@ -221,7 +221,7 @@ tree d667270a1f7b109f5eb3aaea21ede14b56bfdd6e\n tree 8f51f74cf0163afc9ad68a4b1537288c4558b5a4\n EOF\n \n-test_expect_success POSIXPERM,SYMLINKS \"$name\" \"test_cmp a expected\"\n+test_expect_success POSIXPERM,SYMLINKS \"$name\" \"test_cmp expected a\"\n \n test_expect_success 'exit if remote refs are ambigious' '\n         git config --add svn-remote.svn.fetch \\\ndiff --git a/t/t9133-git-svn-nested-git-repo.sh b/t/t9133-git-svn-nested-git-repo.sh\nindex f3c30e63b..f89486086 100755\n--- a/t/t9133-git-svn-nested-git-repo.sh\n+++ b/t/t9133-git-svn-nested-git-repo.sh\n@@ -45,7 +45,7 @@ test_expect_success 'update git svn-cloned repo' '\n \t\tgit svn rebase &&\n \t\techo a > expect &&\n \t\techo b >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\n@@ -69,7 +69,7 @@ test_expect_success 'update git svn-cloned repo' '\n \t\tgit svn rebase &&\n \t\techo a > expect &&\n \t\techo b >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\n@@ -93,7 +93,7 @@ test_expect_success 'update git svn-cloned repo again' '\n \t\techo a > expect &&\n \t\techo b >> expect &&\n \t\techo c >> expect &&\n-\t\ttest_cmp a expect &&\n+\t\ttest_cmp expect a &&\n \t\trm expect\n \t)\n '\ndiff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh\nindex 5dfee07d9..251fdd66c 100755\n--- a/t/t9600-cvsimport.sh\n+++ b/t/t9600-cvsimport.sh\n@@ -148,7 +148,7 @@ test_expect_success PERL 'import from a CVS working tree' '\n \t\tgit cvsimport -a -z0 &&\n \t\techo 1 >expect &&\n \t\tgit log -1 --pretty=format:%s%n >actual &&\n-\t\ttest_cmp actual expect\n+\t\ttest_cmp expect actual\n \t)\n \n '\ndiff --git a/t/t9603-cvsimport-patchsets.sh b/t/t9603-cvsimport-patchsets.sh\nindex c4c3c4954..3e64b11ea 100755\n--- a/t/t9603-cvsimport-patchsets.sh\n+++ b/t/t9603-cvsimport-patchsets.sh\n@@ -29,11 +29,11 @@ test_expect_failure PERL 'import with criss cross times on revisions' '\n Rev 3\n Rev 2\n Rev 1\" > expect-master &&\n-    test_cmp actual-master expect-master &&\n+    test_cmp expect-master actual-master &&\n \n     echo \"Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000\n Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000\" > expect-A &&\n-    test_cmp actual-A expect-A\n+    test_cmp expect-A actual-A\n '\n \n test_done\ndiff --git a/t/t9604-cvsimport-timestamps.sh b/t/t9604-cvsimport-timestamps.sh\nindex a4b3db24b..2ff4aa932 100755\n--- a/t/t9604-cvsimport-timestamps.sh\n+++ b/t/t9604-cvsimport-timestamps.sh\n@@ -31,7 +31,7 @@ test_expect_success PERL 'check timestamps are UTC (TZ=CST6CDT)' '\n \tRev  2 2005-02-01 00:00:00 +0000\n \tRev  1 2005-01-01 00:00:00 +0000\n \tEOF\n-\ttest_cmp actual-1 expect-1\n+\ttest_cmp expect-1 actual-1\n '\n \n test_expect_success PERL 'check timestamps with author-specific timezones' '\n@@ -65,7 +65,7 @@ test_expect_success PERL 'check timestamps with author-specific timezones' '\n \tRev  2 2005-01-31 18:00:00 -0600 User Two\n \tRev  1 2005-01-01 00:00:00 +0000 User One\n \tEOF\n-\ttest_cmp actual-2 expect-2\n+\ttest_cmp expect-2 actual-2\n '\n \n test_done\n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359755","messageId":"0b1feb5ab24d5da31cda5fe69661a05843edd660.1538775186.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1538775186.git.matvore@google.com","subject":"[PATCH v5 5/7] tests: don't swallow Git errors upstream of pipes","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-05T21:54:05Z","receivedAt":"2018-10-05T21:54:28Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"Some pipes in tests lose the exit code of git processes, which can mask\nunexpected behavior like crashes. Split these pipes up so that git\ncommands are only at the end of pipes rather than the beginning or\nmiddle.\n\nThe violations fixed in this patch were found in the process of fixing\npipe placement in a prior patch.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/t5317-pack-objects-filter-objects.sh | 156 +++++++++++++------------\n t/t5616-partial-clone.sh               |  14 ++-\n t/t6112-rev-list-filters-objects.sh    | 103 ++++++++--------\n 3 files changed, 141 insertions(+), 132 deletions(-)\n\ndiff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh\nindex c093eb891..2e718f0bd 100755\n--- a/t/t5317-pack-objects-filter-objects.sh\n+++ b/t/t5317-pack-objects-filter-objects.sh\n@@ -20,8 +20,9 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r1 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -29,8 +30,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r1 index-pack ../all.pack &&\n \n-\tgit -C r1 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r1 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -43,8 +44,8 @@ test_expect_success 'verify blob:none packfile has no blobs' '\n \tEOF\n \tgit -C r1 index-pack ../filter.pack &&\n \n-\tgit -C r1 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r1 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -53,13 +54,13 @@ test_expect_success 'verify blob:none packfile has no blobs' '\n '\n \n test_expect_success 'verify normal and blob:none packfiles have same commits/trees' '\n-\tgit -C r1 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r1 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r1 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r1 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -82,8 +83,8 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -91,8 +92,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r2 index-pack ../all.pack &&\n \n-\tgit -C r2 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -105,8 +106,8 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -120,8 +121,8 @@ test_expect_success 'verify blob:limit=1000' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -130,8 +131,8 @@ test_expect_success 'verify blob:limit=1000' '\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.1000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1001 >filter.pack <<-EOF &&\n@@ -139,8 +140,8 @@ test_expect_success 'verify blob:limit=1001' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -148,8 +149,8 @@ test_expect_success 'verify blob:limit=1001' '\n '\n \n test_expect_success 'verify blob:limit=10001' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=10001 >filter.pack <<-EOF &&\n@@ -157,8 +158,8 @@ test_expect_success 'verify blob:limit=10001' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -166,8 +167,8 @@ test_expect_success 'verify blob:limit=10001' '\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.1000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n@@ -175,8 +176,8 @@ test_expect_success 'verify blob:limit=1k' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -184,8 +185,8 @@ test_expect_success 'verify blob:limit=1k' '\n '\n \n test_expect_success 'verify explicitly specifying oversized blob in input' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1k >filter.pack <<-EOF &&\n@@ -194,8 +195,8 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -203,8 +204,8 @@ test_expect_success 'verify explicitly specifying oversized blob in input' '\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r2 pack-objects --rev --stdout --filter=blob:limit=1m >filter.pack <<-EOF &&\n@@ -212,8 +213,8 @@ test_expect_success 'verify blob:limit=1m' '\n \tEOF\n \tgit -C r2 index-pack ../filter.pack &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -221,13 +222,13 @@ test_expect_success 'verify blob:limit=1m' '\n '\n \n test_expect_success 'verify normal and blob:limit packfiles have same commits/trees' '\n-\tgit -C r2 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r2 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r2 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r2 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -255,8 +256,9 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r3 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -264,8 +266,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r3 index-pack ../all.pack &&\n \n-\tgit -C r3 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r3 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -273,8 +275,8 @@ test_expect_success 'verify blob count in normal packfile' '\n '\n \n test_expect_success 'verify sparse:path=pattern1' '\n-\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern1 >filter.pack <<-EOF &&\n@@ -282,8 +284,8 @@ test_expect_success 'verify sparse:path=pattern1' '\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -291,13 +293,13 @@ test_expect_success 'verify sparse:path=pattern1' '\n '\n \n test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -305,8 +307,8 @@ test_expect_success 'verify normal and sparse:path=pattern1 packfiles have same\n '\n \n test_expect_success 'verify sparse:path=pattern2' '\n-\tgit -C r3 ls-files -s sparse1 dir1/sparse1 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse1 dir1/sparse1 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r3 pack-objects --rev --stdout --filter=sparse:path=../pattern2 >filter.pack <<-EOF &&\n@@ -314,8 +316,8 @@ test_expect_success 'verify sparse:path=pattern2' '\n \tEOF\n \tgit -C r3 index-pack ../filter.pack &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -323,13 +325,13 @@ test_expect_success 'verify sparse:path=pattern2' '\n '\n \n test_expect_success 'verify normal and sparse:path=pattern2 packfiles have same commits/trees' '\n-\tgit -C r3 verify-pack -v ../all.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../all.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >expected &&\n \n-\tgit -C r3 verify-pack -v ../filter.pack |\n-\tgrep -E \"commit|tree\" |\n+\tgit -C r3 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep -E \"commit|tree\" verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -356,8 +358,9 @@ test_expect_success 'setup r4' '\n '\n \n test_expect_success 'verify blob count in normal packfile' '\n-\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r4 ls-files -s pattern sparse1 sparse2 dir1/sparse1 dir1/sparse2 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r4 pack-objects --rev --stdout >all.pack <<-EOF &&\n@@ -365,8 +368,8 @@ test_expect_success 'verify blob count in normal packfile' '\n \tEOF\n \tgit -C r4 index-pack ../all.pack &&\n \n-\tgit -C r4 verify-pack -v ../all.pack |\n-\tgrep blob |\n+\tgit -C r4 verify-pack -v ../all.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -374,8 +377,8 @@ test_expect_success 'verify blob count in normal packfile' '\n '\n \n test_expect_success 'verify sparse:oid=OID' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \toid=$(git -C r4 ls-files -s pattern | awk -f print_2.awk) &&\n@@ -384,8 +387,8 @@ test_expect_success 'verify sparse:oid=OID' '\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n \n-\tgit -C r4 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r4 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -393,8 +396,8 @@ test_expect_success 'verify sparse:oid=OID' '\n '\n \n test_expect_success 'verify sparse:oid=oid-ish' '\n-\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r4 ls-files -s dir1/sparse1 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tgit -C r4 pack-objects --rev --stdout --filter=sparse:oid=master:pattern >filter.pack <<-EOF &&\n@@ -402,8 +405,8 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n \tEOF\n \tgit -C r4 index-pack ../filter.pack &&\n \n-\tgit -C r4 verify-pack -v ../filter.pack |\n-\tgrep blob |\n+\tgit -C r4 verify-pack -v ../filter.pack >verify_result &&\n+\tgrep blob verify_result |\n \tawk -f print_1.awk |\n \tsort >observed &&\n \n@@ -414,8 +417,9 @@ test_expect_success 'verify sparse:oid=oid-ish' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'setup r1 - delete loose blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tfor id in `cat expected | sed \"s|..|&/|\"`\ndiff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\nindex e4d032c9d..fc7aeb1ab 100755\n--- a/t/t5616-partial-clone.sh\n+++ b/t/t5616-partial-clone.sh\n@@ -35,8 +35,8 @@ test_expect_success 'setup bare clone for server' '\n test_expect_success 'do partial clone 1' '\n \tgit clone --no-checkout --filter=blob:none \"file://$(pwd)/srv.bare\" pc1 &&\n \n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print |\n-\tawk -f print_1.awk |\n+\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n \n@@ -133,16 +133,18 @@ test_expect_success 'push new commits to server for file.3.txt' '\n test_expect_success 'manual prefetch of missing objects' '\n \tgit -C pc1 fetch --filter=blob:none origin &&\n \n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n-\tawk -f print_1.awk |\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n+\t\t>revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n \n \ttest_line_count = 6 observed.oids &&\n \tgit -C pc1 fetch-pack --stdin \"file://$(pwd)/srv.bare\" <observed.oids &&\n \n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print |\n-\tawk -f print_1.awk |\n+\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n+\t\t>revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n \ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex ae4402226..b00cf6fa8 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -20,12 +20,13 @@ test_expect_success 'setup r1' '\n '\n \n test_expect_success 'verify blob:none omits all 5 blobs' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -33,12 +34,13 @@ test_expect_success 'verify blob:none omits all 5 blobs' '\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r1 rev-list HEAD --objects |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list HEAD --objects >revs &&\n+\tawk -f print_1.awk revs |\n \tsort >expected &&\n \n-\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none \\\n+\t\t>revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -62,12 +64,12 @@ test_expect_success 'setup r2' '\n '\n \n test_expect_success 'verify blob:limit=500 omits all blobs' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -75,12 +77,12 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r2 rev-list HEAD --objects |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --objects >revs &&\n+\tawk -f print_1.awk revs |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -88,12 +90,12 @@ test_expect_success 'verify emitted+omitted == all' '\n '\n \n test_expect_success 'verify blob:limit=1000' '\n-\tgit -C r2 ls-files -s large.1000 large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.1000 large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -101,12 +103,12 @@ test_expect_success 'verify blob:limit=1000' '\n '\n \n test_expect_success 'verify blob:limit=1001' '\n-\tgit -C r2 ls-files -s large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -114,12 +116,12 @@ test_expect_success 'verify blob:limit=1001' '\n '\n \n test_expect_success 'verify blob:limit=1k' '\n-\tgit -C r2 ls-files -s large.10000 |\n-\tawk -f print_2.awk |\n+\tgit -C r2 ls-files -s large.10000 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -127,8 +129,8 @@ test_expect_success 'verify blob:limit=1k' '\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m |\n-\tawk -f print_1.awk |\n+\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -156,12 +158,12 @@ test_expect_success 'setup r3' '\n '\n \n test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n-\tgit -C r3 ls-files -s sparse1 sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse1 sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -169,12 +171,12 @@ test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n '\n \n test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n-\tgit -C r3 ls-files -s sparse2 dir1/sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s sparse2 dir1/sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -192,14 +194,14 @@ test_expect_success 'setup r3 part 2' '\n '\n \n test_expect_success 'verify sparse:oid=OID omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \toid=$(git -C r3 ls-files -s pattern | awk -f print_2.awk) &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -207,12 +209,12 @@ test_expect_success 'verify sparse:oid=OID omits top-level files' '\n '\n \n test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n-\tgit -C r3 ls-files -s pattern sparse1 sparse2 |\n-\tawk -f print_2.awk |\n+\tgit -C r3 ls-files -s pattern sparse1 sparse2 >ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern |\n-\tawk -f print_1.awk |\n+\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n \n@@ -223,8 +225,9 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n # This models previously omitted objects that we did not receive.\n \n test_expect_success 'rev-list W/ --missing=print' '\n-\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 |\n-\tawk -f print_2.awk |\n+\tgit -C r1 ls-files -s file.1 file.2 file.3 file.4 file.5 \\\n+\t\t>ls_files_result &&\n+\tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n \tfor id in `cat expected | sed \"s|..|&/|\"`\n@@ -232,8 +235,8 @@ test_expect_success 'rev-list W/ --missing=print' '\n \t\trm r1/.git/objects/$id\n \tdone &&\n \n-\tgit -C r1 rev-list --quiet HEAD --missing=print --objects |\n-\tawk -f print_1.awk |\n+\tgit -C r1 rev-list --quiet HEAD --missing=print --objects >revs &&\n+\tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed &&\n \n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359756","messageId":"a426aaa6c52aad3f28b4e20bb8dc81aaf898e18c.1538775186.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1538775186.git.matvore@google.com","subject":"[PATCH v5 6/7] t9109: don't swallow Git errors upstream of pipes","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-05T21:54:06Z","receivedAt":"2018-10-05T21:54:30Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"'git ... | foo' will mask any errors or crashes in git, so split up such\npipes in this file.\n\nOne testcase uses several separate pipe sequences in a row which are\nawkward to split up. Wrap the split-up pipe in a function so the\nawkwardness is not repeated. Also change that testcase's surrounding\nquotes from double to single to avoid premature string interpolation.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/t9101-git-svn-props.sh | 34 +++++++++++++++++++++-------------\n 1 file changed, 21 insertions(+), 13 deletions(-)\n\ndiff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\nindex 8a5c8dc1a..c26c4b092 100755\n--- a/t/t9101-git-svn-props.sh\n+++ b/t/t9101-git-svn-props.sh\n@@ -174,7 +174,8 @@ test_expect_success 'test create-ignore' \"\n \tcmp ./deeply/.gitignore create-ignore.expect &&\n \tcmp ./deeply/nested/.gitignore create-ignore.expect &&\n \tcmp ./deeply/nested/directory/.gitignore create-ignore.expect &&\n-\tgit ls-files -s | grep gitignore | cmp - create-ignore-index.expect\n+\tgit ls-files -s >ls_files_result &&\n+\tgrep gitignore ls_files_result | cmp - create-ignore-index.expect\n \t\"\n \n cat >prop.expect <<\\EOF\n@@ -189,17 +190,21 @@ EOF\n # This test can be improved: since all the svn:ignore contain the same\n # pattern, it can pass even though the propget did not execute on the\n # right directory.\n-test_expect_success 'test propget' \"\n-\tgit svn propget svn:ignore . | cmp - prop.expect &&\n+test_expect_success 'test propget' '\n+\ttest_propget () {\n+\t\tgit svn propget $1 $2 >actual &&\n+\t\tcmp $3 actual\n+\t} &&\n+\ttest_propget svn:ignore . prop.expect &&\n \tcd deeply &&\n-\tgit svn propget svn:ignore . | cmp - ../prop.expect &&\n-\tgit svn propget svn:entry:committed-rev nested/directory/.keep \\\n-\t  | cmp - ../prop2.expect &&\n-\tgit svn propget svn:ignore .. | cmp - ../prop.expect &&\n-\tgit svn propget svn:ignore nested/ | cmp - ../prop.expect &&\n-\tgit svn propget svn:ignore ./nested | cmp - ../prop.expect &&\n-\tgit svn propget svn:ignore .././deeply/nested | cmp - ../prop.expect\n-\t\"\n+\ttest_propget svn:ignore . ../prop.expect &&\n+\ttest_propget svn:entry:committed-rev nested/directory/.keep \\\n+\t\t../prop2.expect &&\n+\ttest_propget svn:ignore .. ../prop.expect &&\n+\ttest_propget svn:ignore nested/ ../prop.expect &&\n+\ttest_propget svn:ignore ./nested ../prop.expect &&\n+\ttest_propget svn:ignore .././deeply/nested ../prop.expect\n+\t'\n \n cat >prop.expect <<\\EOF\n Properties on '.':\n@@ -218,8 +223,11 @@ Properties on 'nested/directory/.keep':\n EOF\n \n test_expect_success 'test proplist' \"\n-\tgit svn proplist . | cmp - prop.expect &&\n-\tgit svn proplist nested/directory/.keep | cmp - prop2.expect\n+\tgit svn proplist . >actual &&\n+\tcmp prop.expect actual &&\n+\n+\tgit svn proplist nested/directory/.keep >actual &&\n+\tcmp prop2.expect actual\n \t\"\n \n test_done\n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359757","messageId":"6f639eec9ed57ecd17431b215430541da8ff250b.1538775186.git.matvore@google.com","threadId":"49352","inReplyTo":"cover.1538775186.git.matvore@google.com","subject":"[PATCH v5 7/7] tests: order arguments to git-rev-list properly","fromName":"Matthew DeVore","fromEmail":"matvore@google.com","sentAt":"2018-10-05T21:54:07Z","receivedAt":"2018-10-05T21:54:32Z","isPatch":true,"sender":{"key":"matvore@google.com","avatar":"https://avatars.githubusercontent.com/u/946637?v=4"},"body":"It is a common mistake to put positional arguments before flags when\ninvoking git-rev-list. Order the positional arguments last.\n\nThis patch skips git-rev-list invocations which include the --not flag,\nsince the ordering of flags and positional arguments affects the\nbehavior. This patch also skips invocations of git-rev-list that occur\nin command substitution in which the exit code is discarded, since\nfixing those properly will require a more involved cleanup.\n\nSigned-off-by: Matthew DeVore <matvore@google.com>\n---\n t/t5616-partial-clone.sh            | 26 +++++++++--------\n t/t5702-protocol-v2.sh              |  4 +--\n t/t6112-rev-list-filters-objects.sh | 43 ++++++++++++++++++-----------\n 3 files changed, 44 insertions(+), 29 deletions(-)\n\ndiff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\nindex fc7aeb1ab..6ff614692 100755\n--- a/t/t5616-partial-clone.sh\n+++ b/t/t5616-partial-clone.sh\n@@ -35,7 +35,7 @@ test_expect_success 'setup bare clone for server' '\n test_expect_success 'do partial clone 1' '\n \tgit clone --no-checkout --filter=blob:none \"file://$(pwd)/srv.bare\" pc1 &&\n \n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print >revs &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n@@ -48,10 +48,10 @@ test_expect_success 'do partial clone 1' '\n \n # checkout master to force dynamic object fetch of blobs at HEAD.\n test_expect_success 'verify checkout with dynamic object fetch' '\n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print >observed &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print HEAD >observed &&\n \ttest_line_count = 4 observed &&\n \tgit -C pc1 checkout master &&\n-\tgit -C pc1 rev-list HEAD --quiet --objects --missing=print >observed &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print HEAD >observed &&\n \ttest_line_count = 0 observed\n '\n \n@@ -74,7 +74,8 @@ test_expect_success 'push new commits to server' '\n # have the new blobs.\n test_expect_success 'partial fetch inherits filter settings' '\n \tgit -C pc1 fetch origin &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print >observed &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print \\\n+\t\tmaster..origin/master >observed &&\n \ttest_line_count = 5 observed\n '\n \n@@ -82,7 +83,8 @@ test_expect_success 'partial fetch inherits filter settings' '\n # we should only get 1 new blob (for the file in origin/master).\n test_expect_success 'verify diff causes dynamic object fetch' '\n \tgit -C pc1 diff master..origin/master -- file.1.txt &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print >observed &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print \\\n+\t\t master..origin/master >observed &&\n \ttest_line_count = 4 observed\n '\n \n@@ -91,7 +93,8 @@ test_expect_success 'verify diff causes dynamic object fetch' '\n test_expect_success 'verify blame causes dynamic object fetch' '\n \tgit -C pc1 blame origin/master -- file.1.txt >observed.blame &&\n \ttest_cmp expect.blame observed.blame &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print >observed &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print \\\n+\t\tmaster..origin/master >observed &&\n \ttest_line_count = 0 observed\n '\n \n@@ -111,7 +114,8 @@ test_expect_success 'push new commits to server for file.2.txt' '\n # Verify we have all the new blobs.\n test_expect_success 'override inherited filter-spec using --no-filter' '\n \tgit -C pc1 fetch --no-filter origin &&\n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print >observed &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print \\\n+\t\tmaster..origin/master >observed &&\n \ttest_line_count = 0 observed\n '\n \n@@ -133,8 +137,8 @@ test_expect_success 'push new commits to server for file.3.txt' '\n test_expect_success 'manual prefetch of missing objects' '\n \tgit -C pc1 fetch --filter=blob:none origin &&\n \n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n-\t\t>revs &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print \\\n+\t\t master..origin/master >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\n@@ -142,8 +146,8 @@ test_expect_success 'manual prefetch of missing objects' '\n \ttest_line_count = 6 observed.oids &&\n \tgit -C pc1 fetch-pack --stdin \"file://$(pwd)/srv.bare\" <observed.oids &&\n \n-\tgit -C pc1 rev-list master..origin/master --quiet --objects --missing=print \\\n-\t\t>revs &&\n+\tgit -C pc1 rev-list --quiet --objects --missing=print \\\n+\t\tmaster..origin/master >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed.oids &&\ndiff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh\nindex 54727450b..11a84efff 100755\n--- a/t/t5702-protocol-v2.sh\n+++ b/t/t5702-protocol-v2.sh\n@@ -271,7 +271,7 @@ test_expect_success 'partial clone' '\n \tgrep \"version 2\" trace &&\n \n \t# Ensure that the old version of the file is missing\n-\tgit -C client rev-list master --quiet --objects --missing=print \\\n+\tgit -C client rev-list --quiet --objects --missing=print master \\\n \t\t>observed.oids &&\n \tgrep \"$(git -C server rev-parse message1:a.txt)\" observed.oids &&\n \n@@ -297,7 +297,7 @@ test_expect_success 'partial fetch' '\n \tgrep \"version 2\" trace &&\n \n \t# Ensure that the old version of the file is missing\n-\tgit -C client rev-list other --quiet --objects --missing=print \\\n+\tgit -C client rev-list --quiet --objects --missing=print other \\\n \t\t>observed.oids &&\n \tgrep \"$(git -C server rev-parse message1:a.txt)\" observed.oids &&\n \ndiff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh\nindex b00cf6fa8..53975c572 100755\n--- a/t/t6112-rev-list-filters-objects.sh\n+++ b/t/t6112-rev-list-filters-objects.sh\n@@ -25,7 +25,8 @@ test_expect_success 'verify blob:none omits all 5 blobs' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r1 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:none >revs &&\n+\tgit -C r1 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=blob:none HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -34,12 +35,12 @@ test_expect_success 'verify blob:none omits all 5 blobs' '\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r1 rev-list HEAD --objects >revs &&\n+\tgit -C r1 rev-list --objects HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsort >expected &&\n \n-\tgit -C r1 rev-list HEAD --objects --filter-print-omitted --filter=blob:none \\\n-\t\t>revs &&\n+\tgit -C r1 rev-list --objects --filter-print-omitted --filter=blob:none \\\n+\t\tHEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -68,7 +69,8 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=500 >revs &&\n+\tgit -C r2 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=blob:limit=500 HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -77,11 +79,12 @@ test_expect_success 'verify blob:limit=500 omits all blobs' '\n '\n \n test_expect_success 'verify emitted+omitted == all' '\n-\tgit -C r2 rev-list HEAD --objects >revs &&\n+\tgit -C r2 rev-list --objects HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --objects --filter-print-omitted --filter=blob:limit=500 >revs &&\n+\tgit -C r2 rev-list --objects --filter-print-omitted \\\n+\t\t--filter=blob:limit=500 HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -94,7 +97,8 @@ test_expect_success 'verify blob:limit=1000' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1000 >revs &&\n+\tgit -C r2 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=blob:limit=1000 HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -107,7 +111,8 @@ test_expect_success 'verify blob:limit=1001' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1001 >revs &&\n+\tgit -C r2 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=blob:limit=1001 HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -120,7 +125,8 @@ test_expect_success 'verify blob:limit=1k' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1k >revs &&\n+\tgit -C r2 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=blob:limit=1k HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -129,7 +135,8 @@ test_expect_success 'verify blob:limit=1k' '\n '\n \n test_expect_success 'verify blob:limit=1m' '\n-\tgit -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m >revs &&\n+\tgit -C r2 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=blob:limit=1m HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -162,7 +169,8 @@ test_expect_success 'verify sparse:path=pattern1 omits top-level files' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern1 >revs &&\n+\tgit -C r3 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=sparse:path=../pattern1 HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -175,7 +183,8 @@ test_expect_success 'verify sparse:path=pattern2 omits both sparse2 files' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:path=../pattern2 >revs &&\n+\tgit -C r3 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=sparse:path=../pattern2 HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -200,7 +209,8 @@ test_expect_success 'verify sparse:oid=OID omits top-level files' '\n \n \toid=$(git -C r3 ls-files -s pattern | awk -f print_2.awk) &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=$oid >revs &&\n+\tgit -C r3 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=sparse:oid=$oid HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -213,7 +223,8 @@ test_expect_success 'verify sparse:oid=oid-ish omits top-level files' '\n \tawk -f print_2.awk ls_files_result |\n \tsort >expected &&\n \n-\tgit -C r3 rev-list HEAD --quiet --objects --filter-print-omitted --filter=sparse:oid=master:pattern >revs &&\n+\tgit -C r3 rev-list --quiet --objects --filter-print-omitted \\\n+\t\t--filter=sparse:oid=master:pattern HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/~//\" |\n \tsort >observed &&\n@@ -235,7 +246,7 @@ test_expect_success 'rev-list W/ --missing=print' '\n \t\trm r1/.git/objects/$id\n \tdone &&\n \n-\tgit -C r1 rev-list --quiet HEAD --missing=print --objects >revs &&\n+\tgit -C r1 rev-list --quiet --missing=print --objects HEAD >revs &&\n \tawk -f print_1.awk revs |\n \tsed \"s/?//\" |\n \tsort >observed &&\n-- \n2.19.0.605.g01d371f741-goog\n\n"},{"id":"359779","messageId":"xmqqtvlyvdh7.fsf@gitster-ct.c.googlers.com","threadId":"49352","inReplyTo":"cover.1538775186.git.matvore@google.com","subject":"Re: [PATCH v5 0/7] subject: Clean up tests for test_cmp arg ordering and pipe placement","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-10-06T23:53:40Z","receivedAt":"2018-10-06T23:53:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthew DeVore <matvore@google.com> writes:\n\n> This version of the patchset fixes some wording and formatting issues\n> pointed out by Junio. The commit message in the first patch has also\n> been reworded.\n\n\nThanks.\n\nIf no further major issues are raised, let's merge it to 'next'.\n\n\n"}]}