{"thread":{"id":"48036","subject":"[GSoC] [PATCH] test: avoid pipes in git related commands for test suite","startedAt":"2018-03-13T20:20:54Z","lastAt":"2018-03-30T22:08:53Z","messageCount":16,"participants":["Pratik Karki","Eric Sunshine","Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"341580","messageId":"20180313201945.8409-1-predatoramigo@gmail.com","threadId":"48036","inReplyTo":null,"subject":"[GSoC] [PATCH] test: avoid pipes in git related commands for test suite","fromName":"Pratik Karki","fromEmail":"predatoramigo@gmail.com","sentAt":"2018-03-13T20:19:45Z","receivedAt":"2018-03-13T20:20:54Z","isPatch":true,"sender":{"key":"predatoramigo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12194950?v=4"},"body":"This patch removes the necessity of pipes in git related commands for test suite.\n\nExit code of the upstream in a pipe is ignored so, it's use should be avoided. The fix for this is to write the output of the git command to a file and test the exit codes of both the commands being linked by pipe.\n\nSigned-off-by: Pratik Karki <predatoramigo@gmail.com>\n---\n t/t7001-mv.sh                        | 24 ++++++++++++------------\n t/t9104-git-svn-follow-parent.sh     |  4 ++--\n t/t9110-git-svn-use-svm-props.sh     | 36 ++++++++++++++++++------------------\n t/t9111-git-svn-use-svnsync-props.sh | 36 ++++++++++++++++++------------------\n t/t9114-git-svn-dcommit-merge.sh     |  8 ++++----\n t/t9130-git-svn-authors-file.sh      | 16 ++++++++--------\n t/t9138-git-svn-authors-prog.sh      | 28 ++++++++++++++--------------\n t/t9153-git-svn-rewrite-uuid.sh      |  8 ++++----\n 8 files changed, 80 insertions(+), 80 deletions(-)\n\ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex 6e5031f56..0dcf1fa3e 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -21,8 +21,8 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-    grep \"^R100..*path0/COPYING..*path1/COPYING\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+    grep \"^R100..*path0/COPYING..*path1/COPYING\" actual'\n \n test_expect_success \\\n     'moving the file back into subdirectory' \\\n@@ -35,8 +35,8 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-    grep \"^R100..*path1/COPYING..*path0/COPYING\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+    grep \"^R100..*path1/COPYING..*path0/COPYING\" actual'\n \n test_expect_success \\\n     'checking -k on non-existing file' \\\n@@ -116,10 +116,10 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path0/COPYING..*path2/COPYING\" &&\n-     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path0/README..*path2/README\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+     grep \"^R100..*path0/COPYING..*path2/COPYING\" actual &&\n+     git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+     grep \"^R100..*path0/README..*path2/README\" actual'\n \n test_expect_success \\\n     'succeed when source is a prefix of destination' \\\n@@ -135,10 +135,10 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path2/COPYING..*path1/path2/COPYING\" &&\n-     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path2/README..*path1/path2/README\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+     grep \"^R100..*path2/COPYING..*path1/path2/COPYING\" actual &&\n+     git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+     grep \"^R100..*path2/README..*path1/path2/README\" actual'\n \n test_expect_success \\\n     'do not move directory over existing directory' \\\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex cd480edf1..284d1224e 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -204,8 +204,8 @@ test_expect_success \"follow-parent is atomic\" '\n test_expect_success \"track multi-parent paths\" '\n \tsvn_cmd cp -m \"resurrect /glob\" \"$svnrepo\"/r9270 \"$svnrepo\"/glob &&\n \tgit svn multi-fetch &&\n-\ttest $(git cat-file commit refs/remotes/glob | \\\n-\t       grep \"^parent \" | wc -l) -eq 2\n+\ttest $(git cat-file commit refs/remotes/glob >actual &&\n+\t       grep \"^parent \" actual | wc -l) -eq 2\n \t'\n \n test_expect_success \"multi-fetch continues to work\" \"\ndiff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh\nindex dde0a3c22..a1a00c298 100755\n--- a/t/t9110-git-svn-use-svm-props.sh\n+++ b/t/t9110-git-svn-use-svm-props.sh\n@@ -21,32 +21,32 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89\n \n bar_url=http://mayonaise/svnrepo/bar\n test_expect_success 'verify metadata for /bar' \"\n-\tgit cat-file commit refs/remotes/bar | \\\n-\t   grep '^git-svn-id: $bar_url@12 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~1 | \\\n-\t   grep '^git-svn-id: $bar_url@11 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~2 | \\\n-\t   grep '^git-svn-id: $bar_url@10 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~3 | \\\n-\t   grep '^git-svn-id: $bar_url@9 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~4 | \\\n-\t   grep '^git-svn-id: $bar_url@6 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~5 | \\\n-\t   grep '^git-svn-id: $bar_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/bar >actual &&\n+\t   grep '^git-svn-id: $bar_url@12 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~1 >actual &&\n+\t   grep '^git-svn-id: $bar_url@11 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~2 >actual &&\n+\t   grep '^git-svn-id: $bar_url@10 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~3 >actual &&\n+\t   grep '^git-svn-id: $bar_url@9 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~4 >actual &&\n+\t   grep '^git-svn-id: $bar_url@6 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~5 >actual &&\n+\t   grep '^git-svn-id: $bar_url@1 $uuid$' actual\n \t\"\n \n e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e\n test_expect_success 'verify metadata for /dir/a/b/c/d/e' \"\n-\tgit cat-file commit refs/remotes/e | \\\n-\t   grep '^git-svn-id: $e_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/e >actual &&\n+\t   grep '^git-svn-id: $e_url@1 $uuid$' actual\n \t\"\n \n dir_url=http://mayonaise/svnrepo/dir\n test_expect_success 'verify metadata for /dir' \"\n-\tgit cat-file commit refs/remotes/dir | \\\n-\t   grep '^git-svn-id: $dir_url@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/dir~1 | \\\n-\t   grep '^git-svn-id: $dir_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/dir >actual &&\n+\t   grep '^git-svn-id: $dir_url@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/dir~1 >actual &&\n+\t   grep '^git-svn-id: $dir_url@1 $uuid$' actual\n \t\"\n \n test_expect_success 'find commit based on SVN revision number' \"\ndiff --git a/t/t9111-git-svn-use-svnsync-props.sh b/t/t9111-git-svn-use-svnsync-props.sh\nindex 22b6e5ee7..5306a87f3 100755\n--- a/t/t9111-git-svn-use-svnsync-props.sh\n+++ b/t/t9111-git-svn-use-svnsync-props.sh\n@@ -20,32 +20,32 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89\n \n bar_url=http://mayonaise/svnrepo/bar\n test_expect_success 'verify metadata for /bar' \"\n-\tgit cat-file commit refs/remotes/bar | \\\n-\t   grep '^git-svn-id: $bar_url@12 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~1 | \\\n-\t   grep '^git-svn-id: $bar_url@11 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~2 | \\\n-\t   grep '^git-svn-id: $bar_url@10 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~3 | \\\n-\t   grep '^git-svn-id: $bar_url@9 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~4 | \\\n-\t   grep '^git-svn-id: $bar_url@6 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~5 | \\\n-\t   grep '^git-svn-id: $bar_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/bar >actual &&\n+\t   grep '^git-svn-id: $bar_url@12 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~1 >actual &&\n+\t   grep '^git-svn-id: $bar_url@11 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~2 >actual &&\n+\t   grep '^git-svn-id: $bar_url@10 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~3 >actual &&\n+\t   grep '^git-svn-id: $bar_url@9 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~4 >actual &&\n+\t   grep '^git-svn-id: $bar_url@6 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~5 >actual &&\n+\t   grep '^git-svn-id: $bar_url@1 $uuid$' actual\n \t\"\n \n e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e\n test_expect_success 'verify metadata for /dir/a/b/c/d/e' \"\n-\tgit cat-file commit refs/remotes/e | \\\n-\t   grep '^git-svn-id: $e_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/e >actual &&\n+\t   grep '^git-svn-id: $e_url@1 $uuid$' actual\n \t\"\n \n dir_url=http://mayonaise/svnrepo/dir\n test_expect_success 'verify metadata for /dir' \"\n-\tgit cat-file commit refs/remotes/dir | \\\n-\t   grep '^git-svn-id: $dir_url@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/dir~1 | \\\n-\t   grep '^git-svn-id: $dir_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/dir >actual &&\n+\t   grep '^git-svn-id: $dir_url@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/dir~1 >actual &&\n+\t   grep '^git-svn-id: $dir_url@1 $uuid$' actual\n \t\"\n \n test_done\ndiff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh\nindex 50bca62de..c945c3758 100755\n--- a/t/t9114-git-svn-dcommit-merge.sh\n+++ b/t/t9114-git-svn-dcommit-merge.sh\n@@ -68,7 +68,7 @@ test_debug 'gitk --all & sleep 1'\n test_expect_success 'verify pre-merge ancestry' \"\n \ttest x\\$(git rev-parse --verify refs/heads/svn^2) = \\\n \t     x\\$(git rev-parse --verify refs/heads/merge) &&\n-\tgit cat-file commit refs/heads/svn^ | grep '^friend$'\n+\tgit cat-file commit refs/heads/svn^ >actual && grep '^friend$' actual\n \t\"\n \n test_expect_success 'git svn dcommit merges' \"\n@@ -82,12 +82,12 @@ test_expect_success 'verify post-merge ancestry' \"\n \t     x\\$(git rev-parse --verify refs/remotes/origin/trunk) &&\n \ttest x\\$(git rev-parse --verify refs/heads/svn^2) = \\\n \t     x\\$(git rev-parse --verify refs/heads/merge) &&\n-\tgit cat-file commit refs/heads/svn^ | grep '^friend$'\n+\tgit cat-file commit refs/heads/svn^ >actual && grep '^friend$' actual\n \t\"\n \n test_expect_success 'verify merge commit message' \"\n-\tgit rev-list --pretty=raw -1 refs/heads/svn | \\\n-\t  grep \\\"    Merge branch 'merge' into svn\\\"\n+\tgit rev-list --pretty=raw -1 refs/heads/svn >actual &&\n+\t  grep \\\"    Merge branch 'merge' into svn\\\" actual\n \t\"\n \n test_done\ndiff --git a/t/t9130-git-svn-authors-file.sh b/t/t9130-git-svn-authors-file.sh\nindex 41264818c..e12f8cf3b 100755\n--- a/t/t9130-git-svn-authors-file.sh\n+++ b/t/t9130-git-svn-authors-file.sh\n@@ -27,10 +27,10 @@ test_expect_success 'imported 2 revisions successfully' '\n \t(\n \t\tcd x\n \t\ttest \"$(git rev-list refs/remotes/git-svn | wc -l)\" -eq 2 &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author BBBBBBB BBBBBBB <bb@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author AAAAAAA AAAAAAA <aa@example\\.com> \"\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\t  grep \"^author BBBBBBB BBBBBBB <bb@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&\n+\t\t  grep \"^author AAAAAAA AAAAAAA <aa@example\\.com> \" actual\n \t)\n \t'\n \n@@ -44,10 +44,10 @@ test_expect_success 'continues to import once authors have been added' '\n \t\tcd x\n \t\tgit svn fetch --authors-file=../svn-authors &&\n \t\ttest \"$(git rev-list refs/remotes/git-svn | wc -l)\" -eq 4 &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author DDDDDDD DDDDDDD <dd@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author CCCCCCC CCCCCCC <cc@example\\.com> \"\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\t  grep \"^author DDDDDDD DDDDDDD <dd@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&\n+\t\t  grep \"^author CCCCCCC CCCCCCC <cc@example\\.com> \" actual\n \t)\n \t'\n \ndiff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh\nindex 7d7e9d46b..5b04c2b40 100755\n--- a/t/t9138-git-svn-authors-prog.sh\n+++ b/t/t9138-git-svn-authors-prog.sh\n@@ -44,24 +44,24 @@ test_expect_success 'imported 6 revisions successfully' '\n test_expect_success 'authors-prog ran correctly' '\n \t(\n \t\tcd x\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author ee-foo <ee-foo@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~2 | \\\n-\t\t  grep \"^author dd <dd@sub\\.example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~3 | \\\n-\t\t  grep \"^author cc <cc@sub\\.example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~4 | \\\n-\t\t  grep \"^author bb <bb@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~5 | \\\n-\t\t  grep \"^author aa <aa@example\\.com> \"\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&\n+\t\t  grep \"^author ee-foo <ee-foo@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~2 >actual &&\n+\t\t  grep \"^author dd <dd@sub\\.example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~3 >actual &&\n+\t\t  grep \"^author cc <cc@sub\\.example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~4 >actual &&\n+\t\t  grep \"^author bb <bb@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~5 >actual &&\n+\t\t  grep \"^author aa <aa@example\\.com> \" actual\n \t)\n '\n \n test_expect_success 'authors-file overrode authors-prog' '\n \t(\n \t\tcd x\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author FFFFFFF FFFFFFF <fFf@other\\.example\\.com> \"\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\t  grep \"^author FFFFFFF FFFFFFF <fFf@other\\.example\\.com> \" actual\n \t)\n '\n \n@@ -73,8 +73,8 @@ test_expect_success 'authors-prog handled special characters in username' '\n \t(\n \t\tcd x &&\n \t\tgit svn --authors-prog=../svn-authors-prog fetch &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn |\n-\t\tgrep \"^author xyz; touch evil <xyz; touch evil@example\\.com> \" &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author xyz; touch evil <xyz; touch evil@example\\.com> \" actual &&\n \t\t! test -f evil\n \t)\n '\ndiff --git a/t/t9153-git-svn-rewrite-uuid.sh b/t/t9153-git-svn-rewrite-uuid.sh\nindex 372ef1568..3b00a9135 100755\n--- a/t/t9153-git-svn-rewrite-uuid.sh\n+++ b/t/t9153-git-svn-rewrite-uuid.sh\n@@ -16,10 +16,10 @@ test_expect_success 'load svn repo' \"\n \t\"\n \n test_expect_success 'verify uuid' \"\n-\tgit cat-file commit refs/remotes/git-svn~0 | \\\n-\t   grep '^git-svn-id: .*@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/git-svn~1 | \\\n-\t   grep '^git-svn-id: .*@1 $uuid$'\n+\tgit cat-file commit refs/remotes/git-svn~0 >actual &&\n+\t   grep '^git-svn-id: .*@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/git-svn~1 >actual &&\n+\t   grep '^git-svn-id: .*@1 $uuid$' actual\n \t\"\n \n test_done\n-- \n2.16.2\n\n"},{"id":"341620","messageId":"CAPig+cRPzyw525ODC4=-E7w=zbpbhVN2eqxSYDSLij5wfW8S_A@mail.gmail.com","threadId":"48036","inReplyTo":"20180313201945.8409-1-predatoramigo@gmail.com","subject":"Re: [GSoC] [PATCH] test: avoid pipes in git related commands for test suite","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-03-14T07:30:11Z","receivedAt":"2018-03-14T07:30:21Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"Thanks for the patch. See comments below...\n\nOn Tue, Mar 13, 2018 at 4:19 PM, Pratik Karki <predatoramigo@gmail.com> wrote:\n> This patch removes the necessity of pipes in git related commands for test suite.\n>\n> Exit code of the upstream in a pipe is ignored so, it's use should be avoided. The fix for this is to write the output of the git command to a file and test the exit codes of both the commands being linked by pipe.\n\nPlease wrap commit messages to fit in about 72 columns; this one is\nfar too wide.\n\nOn the Git project, commit messages are written in imperative mood, as\nif telling the codebase to \"do something\". So, instead of writing\n\"This patch removes...\", you could word it \"Remove...\" or \"Avoid...\".\n\nIt's misleading to say that the patch \"removes the _necessity_ of\npipes\" since pipes were not used out of necessity; they were probably\njust a convenience and seemed reasonable at the time, but later\nexperience has shown that they can be problematic for the reason you\ngive in the second paragraph.\n\nTaking these observations into consideration, perhaps you could\nrewrite the commit message something like this:\n\n    Avoid using pipes downstream of Git commands since the exit codes\n    of commands upstream of pipes get swallowed, thus potentially\n    hiding failure of those commands. Instead, capture Git command\n    output to a file apply the downstream command(s) to that file.\n\nMore comments below...\n\n> Signed-off-by: Pratik Karki <predatoramigo@gmail.com>\n> ---\n> diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\n> @@ -116,10 +116,10 @@ test_expect_success \\\n>  test_expect_success \\\n>      'checking the commit' \\\n> -    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n> -     grep \"^R100..*path0/COPYING..*path2/COPYING\" &&\n> -     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n> -     grep \"^R100..*path0/README..*path2/README\"'\n> +    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n> +     grep \"^R100..*path0/COPYING..*path2/COPYING\" actual &&\n> +     git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n> +     grep \"^R100..*path0/README..*path2/README\" actual'\n\nAlthough this \"mechanical\" transformation is technically correct, it\nis nevertheless wasteful. The exact same \"git diff-tree ...\" command\nis run twice, and both times output is captured to file 'actual',\nwhich makes the second invocation superfluous. Instead, a better\ntransformation would be:\n\n    git diff-tree ... >actual &&\n    grep ... actual &&\n    grep ... actual\n\nThe same observation applies to other transformations in this patch.\n\n> diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\n> @@ -204,8 +204,8 @@ test_expect_success \"follow-parent is atomic\" '\n>  test_expect_success \"track multi-parent paths\" '\n>         svn_cmd cp -m \"resurrect /glob\" \"$svnrepo\"/r9270 \"$svnrepo\"/glob &&\n>         git svn multi-fetch &&\n> -       test $(git cat-file commit refs/remotes/glob | \\\n> -              grep \"^parent \" | wc -l) -eq 2\n> +       test $(git cat-file commit refs/remotes/glob >actual &&\n> +              grep \"^parent \" actual | wc -l) -eq 2\n>         '\n\nThis is not a great transformation. If \"git cat-file\" fails, then\nneither 'grep' nor 'wc' will run, and the result will be as if 'test'\nwas called without an argument before \"-eq\". For example:\n\n    % test $(false >actual && grep \"^parent \" actual | wc -l) -eq 2\n    test: -eq: unary operator expected\n\nIt would be better to run \"git cat-file\" outside of \"test $(...)\". For instance:\n\n    git cat-file ... >actual &&\n    test $(grep ... actual | wc -l) -eq 2\n\nAlternately, you could take advantage of the test_line_count() helper function:\n\n    git cat-file ... >actual &&\n    grep ... actual >actual2 &&\n    test_line_count = 2 actual2\n\n> diff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh\n> @@ -21,32 +21,32 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89\n>  test_expect_success 'verify metadata for /bar' \"\n> -       git cat-file commit refs/remotes/bar | \\\n> -          grep '^git-svn-id: $bar_url@12 $uuid$' &&\n> -       git cat-file commit refs/remotes/bar~1 | \\\n> -          grep '^git-svn-id: $bar_url@11 $uuid$' &&\n> -       git cat-file commit refs/remotes/bar~2 | \\\n> -          grep '^git-svn-id: $bar_url@10 $uuid$' &&\n> -       git cat-file commit refs/remotes/bar~3 | \\\n> -          grep '^git-svn-id: $bar_url@9 $uuid$' &&\n> -       git cat-file commit refs/remotes/bar~4 | \\\n> -          grep '^git-svn-id: $bar_url@6 $uuid$' &&\n> -       git cat-file commit refs/remotes/bar~5 | \\\n> -          grep '^git-svn-id: $bar_url@1 $uuid$'\n> +       git cat-file commit refs/remotes/bar >actual &&\n> +          grep '^git-svn-id: $bar_url@12 $uuid$' actual &&\n> +       git cat-file commit refs/remotes/bar~1 >actual &&\n> +          grep '^git-svn-id: $bar_url@11 $uuid$' actual &&\n> +       git cat-file commit refs/remotes/bar~2 >actual &&\n> +          grep '^git-svn-id: $bar_url@10 $uuid$' actual &&\n> +       git cat-file commit refs/remotes/bar~3 >actual &&\n> +          grep '^git-svn-id: $bar_url@9 $uuid$' actual &&\n> +       git cat-file commit refs/remotes/bar~4 >actual &&\n> +          grep '^git-svn-id: $bar_url@6 $uuid$' actual &&\n> +       git cat-file commit refs/remotes/bar~5 >actual &&\n> +          grep '^git-svn-id: $bar_url@1 $uuid$' actual\n>         \"\n\nAn indented line in the original shows that it is a continuation of\nthe preceding line. However, in the revised code, that is not so, thus\nit probably makes sense to drop the indentation.\n\nThe same comment applies to several additional cases snipped from this reply.\n\n> diff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh\n> index 50bca62de..c945c3758 100755\n> --- a/t/t9114-git-svn-dcommit-merge.sh\n> +++ b/t/t9114-git-svn-dcommit-merge.sh\n> @@ -68,7 +68,7 @@ test_debug 'gitk --all & sleep 1'\n>  test_expect_success 'verify pre-merge ancestry' \"\n>         test x\\$(git rev-parse --verify refs/heads/svn^2) = \\\n>              x\\$(git rev-parse --verify refs/heads/merge) &&\n> -       git cat-file commit refs/heads/svn^ | grep '^friend$'\n> +       git cat-file commit refs/heads/svn^ >actual && grep '^friend$' actual\n>         \"\n\nStyle: split the line at the '&&'...\n\n    git cat-file ... >actual &&\n    grep ... actual\n\nThe same comment applies to another test snipped from this reply.\n\nAside: The current patch wants to solve the problem of exit code being\nswallowed down pipes, however, this and other tests are afflicted by a\nsimilar problem with $(...) also swallowing the exit code. A failure\nof \"git rev-parse\" could potentially go unnoticed inside \"test\nx$(...)\". Fixing that is outside the scope of the current patch,\nhowever, a follow-on patch to fix that problem (if you feel so\ninclined) might transform it something like this:\n\n    git rev-parse ... >rev1 &&\n    git rev-parse ... >rev2 &&\n    test_cmp rev1 rev2 &&\n"},{"id":"341624","messageId":"87zi3bdlo2.fsf@evledraar.gmail.com","threadId":"48036","inReplyTo":"CAPig+cRPzyw525ODC4=-E7w=zbpbhVN2eqxSYDSLij5wfW8S_A@mail.gmail.com","subject":"Re: [GSoC] [PATCH] test: avoid pipes in git related commands for test suite","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-03-14T09:57:33Z","receivedAt":"2018-03-14T09:57:42Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, Mar 14 2018, Eric Sunshine jotted:\n\n> Thanks for the patch. See comments below...\n>\n> On Tue, Mar 13, 2018 at 4:19 PM, Pratik Karki <predatoramigo@gmail.com> wrote:\n>> This patch removes the necessity of pipes in git related commands for test suite.\n>>\n>> Exit code of the upstream in a pipe is ignored so, it's use should be avoided. The fix for this is to write the output of the git command to a file and test the exit codes of both the commands being linked by pipe.\n>\n> Please wrap commit messages to fit in about 72 columns; this one is\n> far too wide.\n>\n> On the Git project, commit messages are written in imperative mood, as\n> if telling the codebase to \"do something\". So, instead of writing\n> \"This patch removes...\", you could word it \"Remove...\" or \"Avoid...\".\n>\n> It's misleading to say that the patch \"removes the _necessity_ of\n> pipes\" since pipes were not used out of necessity; they were probably\n> just a convenience and seemed reasonable at the time, but later\n> experience has shown that they can be problematic for the reason you\n> give in the second paragraph.\n>\n> Taking these observations into consideration, perhaps you could\n> rewrite the commit message something like this:\n>\n>     Avoid using pipes downstream of Git commands since the exit codes\n>     of commands upstream of pipes get swallowed, thus potentially\n>     hiding failure of those commands. Instead, capture Git command\n>     output to a file apply the downstream command(s) to that file.\n>\n> More comments below...\n\nMakes sense.\n\n>> Signed-off-by: Pratik Karki <predatoramigo@gmail.com>\n>> ---\n>> diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\n>> @@ -116,10 +116,10 @@ test_expect_success \\\n>>  test_expect_success \\\n>>      'checking the commit' \\\n>> -    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n>> -     grep \"^R100..*path0/COPYING..*path2/COPYING\" &&\n>> -     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n>> -     grep \"^R100..*path0/README..*path2/README\"'\n>> +    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n>> +     grep \"^R100..*path0/COPYING..*path2/COPYING\" actual &&\n>> +     git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n>> +     grep \"^R100..*path0/README..*path2/README\" actual'\n>\n> Although this \"mechanical\" transformation is technically correct, it\n> is nevertheless wasteful. The exact same \"git diff-tree ...\" command\n> is run twice, and both times output is captured to file 'actual',\n> which makes the second invocation superfluous. Instead, a better\n> transformation would be:\n>\n>     git diff-tree ... >actual &&\n>     grep ... actual &&\n>     grep ... actual\n>\n> The same observation applies to other transformations in this patch.\n\nI think we have to be careful to not be overly picky with rejecting\nmechanical transformations that fix bugs on the basis that while we're\nat it the test could also be rewritten.\n\nI.e. this bug was there before, maybe we should purely focus on just\nreplacing the harmful pipe pattern that hides errors in this series and\nleave rewriting the actual test logic for a later patch.\n\n>> diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\n>> @@ -204,8 +204,8 @@ test_expect_success \"follow-parent is atomic\" '\n>>  test_expect_success \"track multi-parent paths\" '\n>>         svn_cmd cp -m \"resurrect /glob\" \"$svnrepo\"/r9270 \"$svnrepo\"/glob &&\n>>         git svn multi-fetch &&\n>> -       test $(git cat-file commit refs/remotes/glob | \\\n>> -              grep \"^parent \" | wc -l) -eq 2\n>> +       test $(git cat-file commit refs/remotes/glob >actual &&\n>> +              grep \"^parent \" actual | wc -l) -eq 2\n>>         '\n>\n> This is not a great transformation. If \"git cat-file\" fails, then\n> neither 'grep' nor 'wc' will run, and the result will be as if 'test'\n> was called without an argument before \"-eq\". For example:\n>\n>     % test $(false >actual && grep \"^parent \" actual | wc -l) -eq 2\n>     test: -eq: unary operator expected\n>\n> It would be better to run \"git cat-file\" outside of \"test $(...)\". For instance:\n>\n>     git cat-file ... >actual &&\n>     test $(grep ... actual | wc -l) -eq 2\n>\n> Alternately, you could take advantage of the test_line_count() helper function:\n>\n>     git cat-file ... >actual &&\n>     grep ... actual >actual2 &&\n>     test_line_count = 2 actual2\n\nIn this case though as you rightly point out the rewrite is introducing\na regression, which should definitely be fixed.\n"},{"id":"341647","messageId":"CAPig+cTLCswg_=q5ybnyN3As4Au05q5eAcA7Prr643KCgZ0OAw@mail.gmail.com","threadId":"48036","inReplyTo":"87zi3bdlo2.fsf@evledraar.gmail.com","subject":"Re: [GSoC] [PATCH] test: avoid pipes in git related commands for test suite","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-03-14T18:22:45Z","receivedAt":"2018-03-14T18:22:52Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Mar 14, 2018 at 5:57 AM, Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> On Wed, Mar 14 2018, Eric Sunshine jotted:\n>> On Tue, Mar 13, 2018 at 4:19 PM, Pratik Karki <predatoramigo@gmail.com> wrote:\n>>> -    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n>>> -     grep \"^R100..*path0/COPYING..*path2/COPYING\" &&\n>>> -     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n>>> -     grep \"^R100..*path0/README..*path2/README\"'\n>>> +    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n>>> +     grep \"^R100..*path0/COPYING..*path2/COPYING\" actual &&\n>>> +     git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n>>> +     grep \"^R100..*path0/README..*path2/README\" actual'\n>>\n>> Although this \"mechanical\" transformation is technically correct, it\n>> is nevertheless wasteful. The exact same \"git diff-tree ...\" command\n>> is run twice, and both times output is captured to file 'actual',\n>> which makes the second invocation superfluous. Instead, a better\n>> transformation would be:\n>>\n>>     git diff-tree ... >actual &&\n>>     grep ... actual &&\n>>     grep ... actual\n>>\n> I think we have to be careful to not be overly picky with rejecting\n> mechanical transformations that fix bugs on the basis that while we're\n> at it the test could also be rewritten.\n>\n> I.e. this bug was there before, maybe we should purely focus on just\n> replacing the harmful pipe pattern that hides errors in this series and\n> leave rewriting the actual test logic for a later patch.\n\nThanks for presenting an opposing opinion. While I understand your\nposition, the reason for my suggested transformation is that if the\npatch already transformed the code in the way suggested, it would\nincrease my confidence, as a reviewer, that the patch author had\n_studied_ and _understood_ the code. Increased confidence is\nespecially important for mechanical transformations since -- as seen\nin the unsnipped review comment below -- blindly-applied mechanical\ntransformations can be suboptimal or outright incorrect.\n\nIt's also the sort of review comment I would make even to very\nseasoned project participants[1].\n\n[1]: https://public-inbox.org/git/CAPig+cQLmYQeRhPxvZHmY7gApnbE25H_KoSWs-ZjuBo4BruimQ@mail.gmail.com/\n\n>>> -       test $(git cat-file commit refs/remotes/glob | \\\n>>> -              grep \"^parent \" | wc -l) -eq 2\n>>> +       test $(git cat-file commit refs/remotes/glob >actual &&\n>>> +              grep \"^parent \" actual | wc -l) -eq 2\n>>\n>> This is not a great transformation. If \"git cat-file\" fails, then\n>> neither 'grep' nor 'wc' will run, and the result will be as if 'test'\n>> was called without an argument before \"-eq\". For example:\n>>\n>>     % test $(false >actual && grep \"^parent \" actual | wc -l) -eq 2\n>>     test: -eq: unary operator expected\n>>\n>> It would be better to run \"git cat-file\" outside of \"test $(...)\". For instance:\n>>\n>>     git cat-file ... >actual &&\n>>     test $(grep ... actual | wc -l) -eq 2\n>>\n>> Alternately, you could take advantage of the test_line_count() helper function:\n>>\n>>     git cat-file ... >actual &&\n>>     grep ... actual >actual2 &&\n>>     test_line_count = 2 actual2\n>\n> In this case though as you rightly point out the rewrite is introducing\n> a regression, which should definitely be fixed.\n"},{"id":"341769","messageId":"xmqqsh915kzi.fsf@gitster-ct.c.googlers.com","threadId":"48036","inReplyTo":"CAPig+cTLCswg_=q5ybnyN3As4Au05q5eAcA7Prr643KCgZ0OAw@mail.gmail.com","subject":"Re: [GSoC] [PATCH] test: avoid pipes in git related commands for test suite","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-03-15T17:04:01Z","receivedAt":"2018-03-15T17:04:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> Thanks for presenting an opposing opinion. While I understand your\n> position, the reason for my suggested transformation is that if the\n> patch already transformed the code in the way suggested, it would\n> increase my confidence, as a reviewer, that the patch author had\n> _studied_ and _understood_ the code. Increased confidence is\n> especially important for mechanical transformations since -- as seen\n> in the unsnipped review comment below -- blindly-applied mechanical\n> transformations can be suboptimal or outright incorrect.\n>\n> It's also the sort of review comment I would make even to very\n> seasoned project participants[1].\n>\n> [1]: https://public-inbox.org/git/CAPig+cQLmYQeRhPxvZHmY7gApnbE25H_KoSWs-ZjuBo4BruimQ@mail.gmail.com/\n\nYes, it is a good example that mechanical conversions are often\nmind-numbing and make even seasoned participants miss trivially\nobvious improvement opportunities ;-)\n\nIt however is OK to be more lenient to newer participants and allow\ndeferring such \"while at it, make it right\" on top of \"minimally\nrequired for correctness\", in order to encourage them by getting\nsomething to the tree early ;-)\n"},{"id":"342214","messageId":"20180319173204.31952-1-predatoramigo@gmail.com","threadId":"48036","inReplyTo":"xmqqsh915kzi.fsf@gitster-ct.c.googlers.com","subject":"[GSoC][PATCH] test: avoid pipes in git related commands for test suite","fromName":"Pratik Karki","fromEmail":"predatoramigo@gmail.com","sentAt":"2018-03-19T17:32:04Z","receivedAt":"2018-03-19T17:32:51Z","isPatch":true,"sender":{"key":"predatoramigo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12194950?v=4"},"body":"Thank you Eric Sunshine,\n\nI have done as you had instructed me. I look forward to more\nunderstanding of the codebase and would love to fix\n\"git rev-parse\" problems in my follow-on patches.\nThank you for the professional review comment.\n\nSorry for late follow-on patch, I got tied up with my university stuffs.\n\nPlease do review this patch as before. I will correct it if needed.\n\nCheers,\nPratik Karki\n\nAvoid using pipes downstream of Git commands since the exit codes\nof commands upstream of pipes get swallowed, thus potentially\nhiding failure of those commands. Instead, capture Git command\noutput to a file apply the downstream command(s) to that file.\n\nSigned-off-by: Pratik Karki <predatoramigo@gmail.com>\n---\n t/t5300-pack-object.sh                     | 10 +++---\n t/t5510-fetch.sh                           |  8 ++---\n t/t7001-mv.sh                              | 22 ++++++-------\n t/t7003-filter-branch.sh                   |  9 ++++--\n t/t9104-git-svn-follow-parent.sh           | 16 +++++----\n t/t9108-git-svn-glob.sh                    | 14 ++++----\n t/t9109-git-svn-multi-glob.sh              | 28 +++++++++-------\n t/t9110-git-svn-use-svm-props.sh           | 42 ++++++++++++------------\n t/t9111-git-svn-use-svnsync-props.sh       | 36 ++++++++++-----------\n t/t9114-git-svn-dcommit-merge.sh           | 10 +++---\n t/t9130-git-svn-authors-file.sh            | 28 +++++++++-------\n t/t9138-git-svn-authors-prog.sh            | 31 +++++++++---------\n t/t9153-git-svn-rewrite-uuid.sh            |  8 ++---\n t/t9168-git-svn-partially-globbed-names.sh | 34 +++++++++++--------\n t/t9350-fast-export.sh                     | 52 ++++++++++++++++--------------\n 15 files changed, 187 insertions(+), 161 deletions(-)\n\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex 9c68b9925..91207ae0c 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -311,9 +311,9 @@ test_expect_success 'unpacking with --strict' '\n \trm -f .git/index &&\n \ttail -n 10 LIST | git update-index --index-info &&\n \tST=$(git write-tree) &&\n-\tPACK5=$( git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" | \\\n-\t\tgit pack-objects test-5 ) &&\n-\tPACK6=$( (\n+\tgit rev-list --objects \"$LIST\" \"$LI\" \"$ST\" >actual &&\n+\tPACK5=$(git pack-objects test-5 < actual) &&\n+\tPACK6=$((\n \t\t\techo \"$LIST\"\n \t\t\techo \"$LI\"\n \t\t\techo \"$ST\"\n@@ -358,8 +358,8 @@ test_expect_success 'index-pack with --strict' '\n \trm -f .git/index &&\n \ttail -n 10 LIST | git update-index --index-info &&\n \tST=$(git write-tree) &&\n-\tPACK5=$( git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" | \\\n-\t\tgit pack-objects test-5 ) &&\n+\tgit rev-list --objects \"$LIST\" \"$LI\" \"$ST\" >actual &&\n+\tPACK5=$(git pack-objects test-5 < actual) &&\n \tPACK6=$( (\n \t\t\techo \"$LIST\"\n \t\t\techo \"$LI\"\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex 668c54be4..c7b284138 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -693,8 +693,8 @@ test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '\n \ttest_commit looooooooooooong-tag &&\n \t(\n \t\tcd full-output &&\n-\t\tgit -c fetch.output=full fetch origin 2>&1 | \\\n-\t\t\tgrep -e \"->\" | cut -c 22- >../actual\n+\t\tgit -c fetch.output=full fetch origin >actual2 2>&1 &&\n+\t\tgrep -e \"->\" actual2 | cut -c 22- >../actual\n \t) &&\n \tcat >expect <<-\\EOF &&\n \tmaster               -> origin/master\n@@ -708,8 +708,8 @@ test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '\n \ttest_commit extraaa &&\n \t(\n \t\tcd compact &&\n-\t\tgit -c fetch.output=compact fetch origin 2>&1 | \\\n-\t\t\tgrep -e \"->\" | cut -c 22- >../actual\n+\t\tgit -c fetch.output=compact fetch origin >actual2 2>&1 &&\n+\t\tgrep -e \"->\" actual2 | cut -c 22- >../actual\n \t) &&\n \tcat >expect <<-\\EOF &&\n \tmaster     -> origin/*\ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex 6e5031f56..00aa9e45b 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -21,8 +21,8 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-    grep \"^R100..*path0/COPYING..*path1/COPYING\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+    grep \"^R100..*path0/COPYING..*path1/COPYING\" actual'\n \n test_expect_success \\\n     'moving the file back into subdirectory' \\\n@@ -35,8 +35,8 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-    grep \"^R100..*path1/COPYING..*path0/COPYING\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+    grep \"^R100..*path1/COPYING..*path0/COPYING\" actual'\n \n test_expect_success \\\n     'checking -k on non-existing file' \\\n@@ -116,10 +116,9 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path0/COPYING..*path2/COPYING\" &&\n-     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path0/README..*path2/README\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+     grep \"^R100..*path0/COPYING..*path2/COPYING\" actual &&\n+     grep \"^R100..*path0/README..*path2/README\" actual'\n \n test_expect_success \\\n     'succeed when source is a prefix of destination' \\\n@@ -135,10 +134,9 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path2/COPYING..*path1/path2/COPYING\" &&\n-     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path2/README..*path1/path2/README\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+     grep \"^R100..*path2/COPYING..*path1/path2/COPYING\" actual &&\n+     grep \"^R100..*path2/README..*path1/path2/README\" actual'\n \n test_expect_success \\\n     'do not move directory over existing directory' \\\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex 7cb60799b..82c9c2825 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -187,7 +187,8 @@ test_expect_success 'author information is preserved' '\n \t\t\ttest \\$GIT_COMMIT != $(git rev-parse master) || \\\n \t\t\techo Hallo\" \\\n \t\tpreserved-author) &&\n-\ttest 1 = $(git rev-list --author=\"B V Uips\" preserved-author | wc -l)\n+\tgit rev-list --author=\"B V Uips\" preserved-author > actual &&\n+\ttest 1 = $(wc -l < actual)\n '\n \n test_expect_success \"remove a certain author's commits\" '\n@@ -205,7 +206,8 @@ test_expect_success \"remove a certain author's commits\" '\n \tcnt1=$(git rev-list master | wc -l) &&\n \tcnt2=$(git rev-list removed-author | wc -l) &&\n \ttest $cnt1 -eq $(($cnt2 + 1)) &&\n-\ttest 0 = $(git rev-list --author=\"B V Uips\" removed-author | wc -l)\n+\tgit rev-list --author=\"B V Uips\" removed-author >actual &&\n+\ttest 0 = $(wc -l < actual)\n '\n \n test_expect_success 'barf on invalid name' '\n@@ -258,7 +260,8 @@ test_expect_success 'Subdirectory filter with disappearing trees' '\n \tgit commit -m \"Re-adding foo\" &&\n \n \tgit filter-branch -f --subdirectory-filter foo &&\n-\ttest $(git rev-list master | wc -l) = 3\n+\tgit rev-list master >actual &&\n+\ttest_line_count = 3 actual\n '\n \n test_expect_success 'Tag name filtering retains tag message' '\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex cd480edf1..a532c49af 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -33,8 +33,8 @@ test_expect_success 'init and fetch a moved directory' '\n \tgit svn fetch -i thunk &&\n \ttest \"$(git rev-parse --verify refs/remotes/thunk@2)\" \\\n \t   = \"$(git rev-parse --verify refs/remotes/thunk~1)\" &&\n-\ttest \"$(git cat-file blob refs/remotes/thunk:readme |\\\n-\t\t sed -n -e \"3p\")\" = goodbye &&\n+\tgit cat-file blob refs/remotes/thunk:readme >actual &&\n+\ttest \"$(sed -n -e \"3p\" actual)\" = goodbye &&\n \ttest -z \"$(git config --get svn-remote.svn.fetch \\\n \t\t \"^trunk:refs/remotes/thunk@2$\")\"\n \t'\n@@ -48,8 +48,8 @@ test_expect_success 'init and fetch from one svn-remote' '\n         git svn fetch -i svn/thunk &&\n \ttest \"$(git rev-parse --verify refs/remotes/svn/trunk)\" \\\n \t   = \"$(git rev-parse --verify refs/remotes/svn/thunk~1)\" &&\n-\ttest \"$(git cat-file blob refs/remotes/svn/thunk:readme |\\\n-\t\t sed -n -e \"3p\")\" = goodbye\n+\tgit cat-file blob refs/remotes/svn/thunk:readme >actual &&\n+\ttest \"$(sed -n -e \"3p\" actual)\" = goodbye\n         '\n \n test_expect_success 'follow deleted parent' '\n@@ -107,7 +107,8 @@ test_expect_success 'follow deleted directory' '\n \tgit svn init --minimize-url -i glob \"$svnrepo\"/glob &&\n \tgit svn fetch -i glob &&\n \ttest \"$(git cat-file blob refs/remotes/glob:blob/bye)\" = hi &&\n-\ttest \"$(git ls-tree refs/remotes/glob | wc -l )\" -eq 1\n+\tgit ls-tree refs/remotes/glob >actual &&\n+\ttest_line_count = 1 actual\n \t'\n \n # ref: r9270 of the Subversion repository: (http://svn.collab.net/repos/svn)\n@@ -204,8 +205,9 @@ test_expect_success \"follow-parent is atomic\" '\n test_expect_success \"track multi-parent paths\" '\n \tsvn_cmd cp -m \"resurrect /glob\" \"$svnrepo\"/r9270 \"$svnrepo\"/glob &&\n \tgit svn multi-fetch &&\n-\ttest $(git cat-file commit refs/remotes/glob | \\\n-\t       grep \"^parent \" | wc -l) -eq 2\n+\tgit cat-file commit refs/remotes/glob >actual &&\n+\tgrep \"^parent \" actual > actual2 &&\n+\ttest_line_count = 2 actual2\n \t'\n \n test_expect_success \"multi-fetch continues to work\" \"\ndiff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh\nindex a94286c8e..e01f3553f 100755\n--- a/t/t9108-git-svn-glob.sh\n+++ b/t/t9108-git-svn-glob.sh\n@@ -47,8 +47,8 @@ test_expect_success 'test refspec globbing' '\n \tgit config --add svn-remote.svn.tags\\\n \t                 \"tags/*/src/a:refs/remotes/tags/*\" &&\n \tgit svn multi-fetch &&\n-\tgit log --pretty=oneline refs/remotes/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.end &&\n+\tgit log --pretty=oneline refs/remotes/tags/end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual > output.end &&\n \ttest_cmp expect.end output.end &&\n \ttest \"$(git rev-parse refs/remotes/tags/end~1)\" = \\\n \t\t\"$(git rev-parse refs/remotes/branches/start)\" &&\n@@ -75,14 +75,16 @@ test_expect_success 'test left-hand-side only globbing' '\n \t\tsvn_cmd commit -m \"try to try\"\n \t) &&\n \tgit svn fetch two &&\n-\ttest $(git rev-list refs/remotes/two/tags/end | wc -l) -eq 6 &&\n-\ttest $(git rev-list refs/remotes/two/branches/start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/two/tags/end >actual &&\n+\ttest_line_count = 6 actual &&\n+\tgit rev-list refs/remotes/two/branches/start >actual2 &&\n+\ttest_line_count = 3 actual2 &&\n \ttest $(git rev-parse refs/remotes/two/branches/start~2) = \\\n \t     $(git rev-parse refs/remotes/two/trunk) &&\n \ttest $(git rev-parse refs/remotes/two/tags/end~3) = \\\n \t     $(git rev-parse refs/remotes/two/branches/start) &&\n-\tgit log --pretty=oneline refs/remotes/two/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.two &&\n+\tgit log --pretty=oneline refs/remotes/two/tags/end >actual3 &&\n+\tsed -e \"s/^.\\{41\\}//\" actual3 > output.two &&\n \ttest_cmp expect.two output.two\n \t'\n \ndiff --git a/t/t9109-git-svn-multi-glob.sh b/t/t9109-git-svn-multi-glob.sh\nindex 8d99e848d..a09fc3e14 100755\n--- a/t/t9109-git-svn-multi-glob.sh\n+++ b/t/t9109-git-svn-multi-glob.sh\n@@ -47,8 +47,8 @@ test_expect_success 'test refspec globbing' '\n \tgit config --add svn-remote.svn.tags\\\n \t                 \"tags/*/src/a:refs/remotes/tags/*\" &&\n \tgit svn multi-fetch &&\n-\tgit log --pretty=oneline refs/remotes/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.end &&\n+\tgit log --pretty=oneline refs/remotes/tags/end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual > output.end &&\n \ttest_cmp expect.end output.end &&\n \ttest \"$(git rev-parse refs/remotes/tags/end~1)\" = \\\n \t\t\"$(git rev-parse refs/remotes/branches/v1/start)\" &&\n@@ -75,14 +75,16 @@ test_expect_success 'test left-hand-side only globbing' '\n \t\tsvn_cmd commit -m \"try to try\"\n \t) &&\n \tgit svn fetch two &&\n-\ttest $(git rev-list refs/remotes/two/tags/end | wc -l) -eq 6 &&\n-\ttest $(git rev-list refs/remotes/two/branches/v1/start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/two/tags/end >actual2 &&\n+\ttest_line_count = 6 actual2 &&\n+\tgit rev-list refs/remotes/two/branches/v1/start >actual3 &&\n+\ttest_line_count = 3 actual3 &&\n \ttest $(git rev-parse refs/remotes/two/branches/v1/start~2) = \\\n \t     $(git rev-parse refs/remotes/two/trunk) &&\n \ttest $(git rev-parse refs/remotes/two/tags/end~3) = \\\n \t     $(git rev-parse refs/remotes/two/branches/v1/start) &&\n-\tgit log --pretty=oneline refs/remotes/two/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.two &&\n+\tgit log --pretty=oneline refs/remotes/two/tags/end >actual4 &&\n+\tsed -e \"s/^.\\{41\\}//\" actual4 > output.two &&\n \ttest_cmp expect.two output.two\n \t'\n cat > expect.four <<EOF\n@@ -120,18 +122,20 @@ test_expect_success 'test another branch' '\n \tgit config --add svn-remote.four.url \"$svnrepo\" &&\n \tgit config --add svn-remote.four.fetch trunk:refs/remotes/four/trunk &&\n \tgit config --add svn-remote.four.branches \\\n-\t                 \"branches/*/*:refs/remotes/four/branches/*/*\" &&\n+\t\t\t \"branches/*/*:refs/remotes/four/branches/*/*\" &&\n \tgit config --add svn-remote.four.tags \\\n-\t                 \"tags/*:refs/remotes/four/tags/*\" &&\n+\t\t\t \"tags/*:refs/remotes/four/tags/*\" &&\n \tgit svn fetch four &&\n-\ttest $(git rev-list refs/remotes/four/tags/next | wc -l) -eq 5 &&\n-\ttest $(git rev-list refs/remotes/four/branches/v2/start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/four/tags/next >actual &&\n+\ttest_line_count = 5 actual &&\n+\tgit rev-list refs/remotes/four/branches/v2/start >actual2 &&\n+\ttest_line_count = 3 actual2 &&\n \ttest $(git rev-parse refs/remotes/four/branches/v2/start~2) = \\\n \t     $(git rev-parse refs/remotes/four/trunk) &&\n \ttest $(git rev-parse refs/remotes/four/tags/next~2) = \\\n \t     $(git rev-parse refs/remotes/four/branches/v2/start) &&\n-\tgit log --pretty=oneline refs/remotes/four/tags/next | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.four &&\n+\tgit log --pretty=oneline refs/remotes/four/tags/next >actual3 &&\n+\tsed -e \"s/^.\\{41\\}//\" actual3 > output.four &&\n \ttest_cmp expect.four output.four\n \t'\n \ndiff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh\nindex dde0a3c22..4200b567f 100755\n--- a/t/t9110-git-svn-use-svm-props.sh\n+++ b/t/t9110-git-svn-use-svm-props.sh\n@@ -21,38 +21,38 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89\n \n bar_url=http://mayonaise/svnrepo/bar\n test_expect_success 'verify metadata for /bar' \"\n-\tgit cat-file commit refs/remotes/bar | \\\n-\t   grep '^git-svn-id: $bar_url@12 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~1 | \\\n-\t   grep '^git-svn-id: $bar_url@11 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~2 | \\\n-\t   grep '^git-svn-id: $bar_url@10 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~3 | \\\n-\t   grep '^git-svn-id: $bar_url@9 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~4 | \\\n-\t   grep '^git-svn-id: $bar_url@6 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~5 | \\\n-\t   grep '^git-svn-id: $bar_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/bar >actual &&\n+\tgrep '^git-svn-id: $bar_url@12 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~1 >actual1 &&\n+\tgrep '^git-svn-id: $bar_url@11 $uuid$' actual1 &&\n+\tgit cat-file commit refs/remotes/bar~2 >actual2 &&\n+\tgrep '^git-svn-id: $bar_url@10 $uuid$' actual2 &&\n+\tgit cat-file commit refs/remotes/bar~3 >actual3 &&\n+\tgrep '^git-svn-id: $bar_url@9 $uuid$' actual3 &&\n+\tgit cat-file commit refs/remotes/bar~4 >actual4 &&\n+\tgrep '^git-svn-id: $bar_url@6 $uuid$' actual4 &&\n+\tgit cat-file commit refs/remotes/bar~5 >actual5 &&\n+\tgrep '^git-svn-id: $bar_url@1 $uuid$' actual5\n \t\"\n \n e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e\n test_expect_success 'verify metadata for /dir/a/b/c/d/e' \"\n-\tgit cat-file commit refs/remotes/e | \\\n-\t   grep '^git-svn-id: $e_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/e >actual &&\n+\tgrep '^git-svn-id: $e_url@1 $uuid$' actual\n \t\"\n \n dir_url=http://mayonaise/svnrepo/dir\n test_expect_success 'verify metadata for /dir' \"\n-\tgit cat-file commit refs/remotes/dir | \\\n-\t   grep '^git-svn-id: $dir_url@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/dir~1 | \\\n-\t   grep '^git-svn-id: $dir_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/dir >actual &&\n+\tgrep '^git-svn-id: $dir_url@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/dir~1 >actual1 &&\n+\tgrep '^git-svn-id: $dir_url@1 $uuid$' actual1\n \t\"\n \n test_expect_success 'find commit based on SVN revision number' \"\n-        git svn find-rev r12 |\n-\t    grep $(git rev-parse HEAD)\n-        \"\n+\tgit svn find-rev r12 >actual &&\n+\tgrep $(git rev-parse HEAD) actual\n+\t\"\n \n test_expect_success 'empty rebase' \"\n \tgit svn rebase\ndiff --git a/t/t9111-git-svn-use-svnsync-props.sh b/t/t9111-git-svn-use-svnsync-props.sh\nindex 22b6e5ee7..a4225c9f6 100755\n--- a/t/t9111-git-svn-use-svnsync-props.sh\n+++ b/t/t9111-git-svn-use-svnsync-props.sh\n@@ -20,32 +20,32 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89\n \n bar_url=http://mayonaise/svnrepo/bar\n test_expect_success 'verify metadata for /bar' \"\n-\tgit cat-file commit refs/remotes/bar | \\\n-\t   grep '^git-svn-id: $bar_url@12 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~1 | \\\n-\t   grep '^git-svn-id: $bar_url@11 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~2 | \\\n-\t   grep '^git-svn-id: $bar_url@10 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~3 | \\\n-\t   grep '^git-svn-id: $bar_url@9 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~4 | \\\n-\t   grep '^git-svn-id: $bar_url@6 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~5 | \\\n-\t   grep '^git-svn-id: $bar_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/bar >actual &&\n+\tgrep '^git-svn-id: $bar_url@12 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~1 >actual1 &&\n+\tgrep '^git-svn-id: $bar_url@11 $uuid$' actual1 &&\n+\tgit cat-file commit refs/remotes/bar~2 >actual2 &&\n+\tgrep '^git-svn-id: $bar_url@10 $uuid$' actual2 &&\n+\tgit cat-file commit refs/remotes/bar~3 >actual3 &&\n+\tgrep '^git-svn-id: $bar_url@9 $uuid$' actual3 &&\n+\tgit cat-file commit refs/remotes/bar~4 >actual4 &&\n+\tgrep '^git-svn-id: $bar_url@6 $uuid$' actual4 &&\n+\tgit cat-file commit refs/remotes/bar~5 >actual5 &&\n+\tgrep '^git-svn-id: $bar_url@1 $uuid$' actual5\n \t\"\n \n e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e\n test_expect_success 'verify metadata for /dir/a/b/c/d/e' \"\n-\tgit cat-file commit refs/remotes/e | \\\n-\t   grep '^git-svn-id: $e_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/e >actual &&\n+\tgrep '^git-svn-id: $e_url@1 $uuid$' actual\n \t\"\n \n dir_url=http://mayonaise/svnrepo/dir\n test_expect_success 'verify metadata for /dir' \"\n-\tgit cat-file commit refs/remotes/dir | \\\n-\t   grep '^git-svn-id: $dir_url@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/dir~1 | \\\n-\t   grep '^git-svn-id: $dir_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/dir >actual &&\n+\tgrep '^git-svn-id: $dir_url@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/dir~1 >actual1 &&\n+\tgrep '^git-svn-id: $dir_url@1 $uuid$' actual1\n \t\"\n \n test_done\ndiff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh\nindex 50bca62de..32317d6bc 100755\n--- a/t/t9114-git-svn-dcommit-merge.sh\n+++ b/t/t9114-git-svn-dcommit-merge.sh\n@@ -68,7 +68,8 @@ test_debug 'gitk --all & sleep 1'\n test_expect_success 'verify pre-merge ancestry' \"\n \ttest x\\$(git rev-parse --verify refs/heads/svn^2) = \\\n \t     x\\$(git rev-parse --verify refs/heads/merge) &&\n-\tgit cat-file commit refs/heads/svn^ | grep '^friend$'\n+\tgit cat-file commit refs/heads/svn^ >actual &&\n+\tgrep '^friend$' actual\n \t\"\n \n test_expect_success 'git svn dcommit merges' \"\n@@ -82,12 +83,13 @@ test_expect_success 'verify post-merge ancestry' \"\n \t     x\\$(git rev-parse --verify refs/remotes/origin/trunk) &&\n \ttest x\\$(git rev-parse --verify refs/heads/svn^2) = \\\n \t     x\\$(git rev-parse --verify refs/heads/merge) &&\n-\tgit cat-file commit refs/heads/svn^ | grep '^friend$'\n+\tgit cat-file commit refs/heads/svn^ >actual &&\n+\tgrep '^friend$' actual\n \t\"\n \n test_expect_success 'verify merge commit message' \"\n-\tgit rev-list --pretty=raw -1 refs/heads/svn | \\\n-\t  grep \\\"    Merge branch 'merge' into svn\\\"\n+\tgit rev-list --pretty=raw -1 refs/heads/svn >actual &&\n+\tgrep \\\"    Merge branch 'merge' into svn\\\" actual\n \t\"\n \n test_done\ndiff --git a/t/t9130-git-svn-authors-file.sh b/t/t9130-git-svn-authors-file.sh\nindex 41264818c..a0f10b2d2 100755\n--- a/t/t9130-git-svn-authors-file.sh\n+++ b/t/t9130-git-svn-authors-file.sh\n@@ -26,11 +26,12 @@ test_expect_success 'start import with incomplete authors file' '\n test_expect_success 'imported 2 revisions successfully' '\n \t(\n \t\tcd x\n-\t\ttest \"$(git rev-list refs/remotes/git-svn | wc -l)\" -eq 2 &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author BBBBBBB BBBBBBB <bb@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author AAAAAAA AAAAAAA <aa@example\\.com> \"\n+\t\tgit rev-list refs/remotes/git-svn >actual &&\n+\t\ttest_line_count = 2 actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author BBBBBBB BBBBBBB <bb@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual1 &&\n+\t\tgrep \"^author AAAAAAA AAAAAAA <aa@example\\.com> \" actual1\n \t)\n \t'\n \n@@ -43,11 +44,12 @@ test_expect_success 'continues to import once authors have been added' '\n \t(\n \t\tcd x\n \t\tgit svn fetch --authors-file=../svn-authors &&\n-\t\ttest \"$(git rev-list refs/remotes/git-svn | wc -l)\" -eq 4 &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author DDDDDDD DDDDDDD <dd@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author CCCCCCC CCCCCCC <cc@example\\.com> \"\n+\t\tgit rev-list refs/remotes/git-svn >actual &&\n+\t\ttest_line_count = 4 actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author DDDDDDD DDDDDDD <dd@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual1 &&\n+\t\tgrep \"^author CCCCCCC CCCCCCC <cc@example\\.com> \" actual1\n \t)\n \t'\n \n@@ -102,8 +104,10 @@ test_expect_success !MINGW 'fresh clone with svn.authors-file in config' '\n \t\ttest x\"$HOME\"/svn-authors = x\"$(git config svn.authorsfile)\" &&\n \t\tgit svn clone \"$svnrepo\" gitconfig.clone &&\n \t\tcd gitconfig.clone &&\n-\t\tnr_ex=$(git log | grep \"^Author:.*example.com\" | wc -l) &&\n-\t\tnr_rev=$(git rev-list HEAD | wc -l) &&\n+\t\tnr_ex=$(git log >actual &&\n+\t\t\t    grep \"^Author:.*example.com\" actual | wc -l) &&\n+\t\tnr_rev=$(git rev-list HEAD >actual &&\n+\t\t\t     wc -l < actual) &&\n \t\ttest $nr_rev -eq $nr_ex\n \t)\n '\ndiff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh\nindex 7d7e9d46b..f684f5578 100755\n--- a/t/t9138-git-svn-authors-prog.sh\n+++ b/t/t9138-git-svn-authors-prog.sh\n@@ -37,31 +37,32 @@ test_expect_success 'import authors with prog and file' '\n test_expect_success 'imported 6 revisions successfully' '\n \t(\n \t\tcd x\n-\t\ttest \"$(git rev-list refs/remotes/git-svn | wc -l)\" -eq 6\n+\t\tgit rev-list refs/remotes/git-svn >actual &&\n+\t\ttest_line_count = 6 actual\n \t)\n '\n \n test_expect_success 'authors-prog ran correctly' '\n \t(\n \t\tcd x\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author ee-foo <ee-foo@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~2 | \\\n-\t\t  grep \"^author dd <dd@sub\\.example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~3 | \\\n-\t\t  grep \"^author cc <cc@sub\\.example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~4 | \\\n-\t\t  grep \"^author bb <bb@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~5 | \\\n-\t\t  grep \"^author aa <aa@example\\.com> \"\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&\n+\t\tgrep \"^author ee-foo <ee-foo@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~2 >actual2 &&\n+\t\tgrep \"^author dd <dd@sub\\.example\\.com> \" actual2 &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~3 >actual3 &&\n+\t\tgrep \"^author cc <cc@sub\\.example\\.com> \" actual3 &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~4 >actual4 &&\n+\t\tgrep \"^author bb <bb@example\\.com> \" actual4 &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~5 >actual5 &&\n+\t\tgrep \"^author aa <aa@example\\.com> \" actual5\n \t)\n '\n \n test_expect_success 'authors-file overrode authors-prog' '\n \t(\n \t\tcd x\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author FFFFFFF FFFFFFF <fFf@other\\.example\\.com> \"\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author FFFFFFF FFFFFFF <fFf@other\\.example\\.com> \" actual\n \t)\n '\n \n@@ -73,8 +74,8 @@ test_expect_success 'authors-prog handled special characters in username' '\n \t(\n \t\tcd x &&\n \t\tgit svn --authors-prog=../svn-authors-prog fetch &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn |\n-\t\tgrep \"^author xyz; touch evil <xyz; touch evil@example\\.com> \" &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author xyz; touch evil <xyz; touch evil@example\\.com> \" actual &&\n \t\t! test -f evil\n \t)\n '\ndiff --git a/t/t9153-git-svn-rewrite-uuid.sh b/t/t9153-git-svn-rewrite-uuid.sh\nindex 372ef1568..6cd28bb9a 100755\n--- a/t/t9153-git-svn-rewrite-uuid.sh\n+++ b/t/t9153-git-svn-rewrite-uuid.sh\n@@ -16,10 +16,10 @@ test_expect_success 'load svn repo' \"\n \t\"\n \n test_expect_success 'verify uuid' \"\n-\tgit cat-file commit refs/remotes/git-svn~0 | \\\n-\t   grep '^git-svn-id: .*@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/git-svn~1 | \\\n-\t   grep '^git-svn-id: .*@1 $uuid$'\n+\tgit cat-file commit refs/remotes/git-svn~0 >actual &&\n+\tgrep '^git-svn-id: .*@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/git-svn~1 >actual1 &&\n+\tgrep '^git-svn-id: .*@1 $uuid$' actual1\n \t\"\n \n test_done\ndiff --git a/t/t9168-git-svn-partially-globbed-names.sh b/t/t9168-git-svn-partially-globbed-names.sh\nindex 8b22f2272..df6f3a974 100755\n--- a/t/t9168-git-svn-partially-globbed-names.sh\n+++ b/t/t9168-git-svn-partially-globbed-names.sh\n@@ -48,8 +48,8 @@ test_expect_success 'test refspec prefixed globbing' '\n \tgit config --add svn-remote.svn.tags\\\n \t\t\t \"tags/t_*/src/a:refs/remotes/tags/t_*\" &&\n \tgit svn multi-fetch &&\n-\tgit log --pretty=oneline refs/remotes/tags/t_end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.end &&\n+\tgit log --pretty=oneline refs/remotes/tags/t_end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.end &&\n \ttest_cmp expect.end output.end &&\n \ttest \"$(git rev-parse refs/remotes/tags/t_end~1)\" = \\\n \t\t\"$(git rev-parse refs/remotes/branches/b_start)\" &&\n@@ -78,14 +78,16 @@ test_expect_success 'test left-hand-side only prefixed globbing' '\n \t\tsvn_cmd commit -m \"try to try\"\n \t) &&\n \tgit svn fetch two &&\n-\ttest $(git rev-list refs/remotes/two/tags/t_end | wc -l) -eq 6 &&\n-\ttest $(git rev-list refs/remotes/two/branches/b_start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/two/tags/t_end >actual &&\n+\ttest_line_count = 6 actual &&\n+\tgit rev-list refs/remotes/two/branches/b_start >actual2 &&\n+\ttest_line_count = 3 actual2 &&\n \ttest $(git rev-parse refs/remotes/two/branches/b_start~2) = \\\n \t     $(git rev-parse refs/remotes/two/trunk) &&\n \ttest $(git rev-parse refs/remotes/two/tags/t_end~3) = \\\n \t     $(git rev-parse refs/remotes/two/branches/b_start) &&\n-\tgit log --pretty=oneline refs/remotes/two/tags/t_end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.two &&\n+\tgit log --pretty=oneline refs/remotes/two/tags/t_end >actual3 &&\n+\tsed -e \"s/^.\\{41\\}//\" actual3 >output.two &&\n \ttest_cmp expect.two output.two\n \t'\n \n@@ -118,14 +120,16 @@ test_expect_success 'test prefixed globs match just prefix' '\n \t\tsvn_cmd up\n \t) &&\n \tgit svn fetch three &&\n-\ttest $(git rev-list refs/remotes/three/branches/b_ | wc -l) -eq 2 &&\n-\ttest $(git rev-list refs/remotes/three/tags/t_ | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/three/branches/b_ >actual &&\n+\ttest_line_count = 2 actual &&\n+\tgit rev-list refs/remotes/three/tags/t_ >actual2 &&\n+\ttest_line_count = 3 actual2 &&\n \ttest $(git rev-parse refs/remotes/three/branches/b_~1) = \\\n \t     $(git rev-parse refs/remotes/three/trunk) &&\n \ttest $(git rev-parse refs/remotes/three/tags/t_~1) = \\\n \t     $(git rev-parse refs/remotes/three/branches/b_) &&\n-\tgit log --pretty=oneline refs/remotes/three/tags/t_ | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.three &&\n+\tgit log --pretty=oneline refs/remotes/three/tags/t_ >actual3 &&\n+\tsed -e \"s/^.\\{41\\}//\" actual3 >output.three &&\n \ttest_cmp expect.three output.three\n \t'\n \n@@ -186,14 +190,16 @@ test_expect_success 'test globbing in the middle of the word' '\n \t\tsvn_cmd up\n \t) &&\n \tgit svn fetch five &&\n-\ttest $(git rev-list refs/remotes/five/branches/abcde | wc -l) -eq 2 &&\n-\ttest $(git rev-list refs/remotes/five/tags/fghij | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/five/branches/abcde >actual &&\n+\ttest_line_count = 2 actual &&\n+\tgit rev-list refs/remotes/five/tags/fghij >actual2 &&\n+\ttest_line_count = 3 actual2 &&\n \ttest $(git rev-parse refs/remotes/five/branches/abcde~1) = \\\n \t     $(git rev-parse refs/remotes/five/trunk) &&\n \ttest $(git rev-parse refs/remotes/five/tags/fghij~1) = \\\n \t     $(git rev-parse refs/remotes/five/branches/abcde) &&\n-\tgit log --pretty=oneline refs/remotes/five/tags/fghij | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.five &&\n+\tgit log --pretty=oneline refs/remotes/five/tags/fghij >actual3 &&\n+\tsed -e \"s/^.\\{41\\}//\" actual3 >output.five &&\n \ttest_cmp expect.five output.five\n \t'\n \ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex 866ddf605..45176742b 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -43,20 +43,20 @@ test_expect_success 'fast-export | fast-import' '\n \tMUSS=$(git rev-parse --verify muss) &&\n \tmkdir new &&\n \tgit --git-dir=new/.git init &&\n-\tgit fast-export --all |\n+\tgit fast-export --all >actual &&\n \t(cd new &&\n \t git fast-import &&\n \t test $MASTER = $(git rev-parse --verify refs/heads/master) &&\n \t test $REIN = $(git rev-parse --verify refs/tags/rein) &&\n \t test $WER = $(git rev-parse --verify refs/heads/wer) &&\n-\t test $MUSS = $(git rev-parse --verify refs/tags/muss))\n+\t test $MUSS = $(git rev-parse --verify refs/tags/muss)) < actual\n \n '\n \n test_expect_success 'fast-export master~2..master' '\n \n-\tgit fast-export master~2..master |\n-\t\tsed \"s/master/partial/\" |\n+\tgit fast-export master~2..master >actual2 &&\n+\tsed \"s/master/partial/\" actual2 |\n \t\t(cd new &&\n \t\t git fast-import &&\n \t\t test $MASTER != $(git rev-parse --verify refs/heads/partial) &&\n@@ -74,11 +74,12 @@ test_expect_success 'iso-8859-1' '\n \ttest_tick &&\n \techo rosten >file &&\n \tgit commit -s -m den file &&\n-\tgit fast-export wer^..wer |\n-\t\tsed \"s/wer/i18n/\" |\n-\t\t(cd new &&\n-\t\t git fast-import &&\n-\t\t git cat-file commit i18n | grep \"Áéí óú\")\n+\tgit fast-export wer^..wer >actual3 &&\n+\tsed \"s/wer/i18n/\" actual3 |\n+\t    (cd new &&\n+\t\tgit fast-import &&\n+\t\tgit cat-file commit i18n >actual4 &&\n+\t\tgrep \"Áéí óú\" actual4)\n \n '\n test_expect_success 'import/export-marks' '\n@@ -87,18 +88,18 @@ test_expect_success 'import/export-marks' '\n \tgit fast-export --export-marks=tmp-marks HEAD &&\n \ttest -s tmp-marks &&\n \ttest_line_count = 3 tmp-marks &&\n+\tgit fast-export --import-marks=tmp-marks\\\n+\t\t--export-marks=tmp-marks HEAD >actual &&\n \ttest $(\n-\t\tgit fast-export --import-marks=tmp-marks\\\n-\t\t--export-marks=tmp-marks HEAD |\n-\t\tgrep ^commit |\n+\t\tgrep ^commit actual |\n \t\twc -l) \\\n \t-eq 0 &&\n \techo change > file &&\n \tgit commit -m \"last commit\" file &&\n+\tgit fast-export --import-marks=tmp-marks \\\n+\t\t--export-marks=tmp-marks HEAD >actual2 &&\n \ttest $(\n-\t\tgit fast-export --import-marks=tmp-marks \\\n-\t\t--export-marks=tmp-marks HEAD |\n-\t\tgrep ^commit\\  |\n+\t\tgrep ^commit\\  actual2 |\n \t\twc -l) \\\n \t-eq 1 &&\n \ttest_line_count = 4 tmp-marks\n@@ -184,7 +185,7 @@ test_expect_success 'submodule fast-export | fast-import' '\n \trm -rf new &&\n \tmkdir new &&\n \tgit --git-dir=new/.git init &&\n-\tgit fast-export --signed-tags=strip --all |\n+\tgit fast-export --signed-tags=strip --all >actual &&\n \t(cd new &&\n \t git fast-import &&\n \t test \"$SUBENT1\" = \"$(git ls-tree refs/heads/master^ sub)\" &&\n@@ -192,7 +193,7 @@ test_expect_success 'submodule fast-export | fast-import' '\n \t git checkout master &&\n \t git submodule init &&\n \t git submodule update &&\n-\t cmp sub/file ../sub/file)\n+\t cmp sub/file ../sub/file) < actual\n \n '\n \n@@ -361,18 +362,20 @@ test_expect_failure 'no exact-ref revisions included' '\n \t)\n '\n \n-test_expect_success 'path limiting with import-marks does not lose unmodified files'        '\n+test_expect_success 'path limiting with import-marks does not lose unmodified files'\t    '\n \tgit checkout -b simple marks~2 &&\n \tgit fast-export --export-marks=marks simple -- file > /dev/null &&\n \techo more content >> file &&\n \ttest_tick &&\n \tgit commit -mnext file &&\n-\tgit fast-export --import-marks=marks simple -- file file0 | grep file0\n+\tgit fast-export --import-marks=marks simple -- file file0 >actual &&\n+\tgrep file0 actual\n '\n \n-test_expect_success 'full-tree re-shows unmodified files'        '\n+test_expect_success 'full-tree re-shows unmodified files'\t '\n \tgit checkout -f simple &&\n-\ttest $(git fast-export --full-tree simple | grep -c file0) -eq 3\n+\tgit fast-export --full-tree simple >actual &&\n+\ttest $(grep -c file0 actual) -eq 3\n '\n \n test_expect_success 'set-up a few more tags for tag export tests' '\n@@ -505,8 +508,8 @@ test_expect_success 'refs are updated even if no commits need to be exported' '\n '\n \n test_expect_success 'use refspec' '\n-\tgit fast-export --refspec refs/heads/master:refs/heads/foobar master | \\\n-\t\tgrep \"^commit \" | sort | uniq > actual &&\n+\tgit fast-export --refspec refs/heads/master:refs/heads/foobar master >actual2 &&\n+\tgrep \"^commit \" actual2 | sort | uniq > actual &&\n \techo \"commit refs/heads/foobar\" > expected &&\n \ttest_cmp expected actual\n '\n@@ -534,7 +537,8 @@ test_expect_success 'when using -C, do not declare copy when source of copy is a\n \tgit -C src commit -m 2nd_commit &&\n \n \ttest_create_repo dst &&\n-\tgit -C src fast-export --all -C | git -C dst fast-import &&\n+\tgit -C src fast-export --all -C > actual &&\n+\tgit -C dst fast-import < actual &&\n \tgit -C src show >expected &&\n \tgit -C dst show >actual &&\n \ttest_cmp expected actual\n-- \n2.16.2\n\n"},{"id":"342398","messageId":"CAPig+cTKkp6kpFcJfVV8W1ejCrCWQH33mHtgFUn+MpMgw5i1pA@mail.gmail.com","threadId":"48036","inReplyTo":"20180319173204.31952-1-predatoramigo@gmail.com","subject":"Re: [GSoC][PATCH] test: avoid pipes in git related commands for test suite","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-03-21T11:02:43Z","receivedAt":"2018-03-21T11:02:56Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Mar 19, 2018 at 1:32 PM, Pratik Karki <predatoramigo@gmail.com> wrote:\n> Thank you Eric Sunshine,\n> I have done as you had instructed me. I look forward to more\n> understanding of the codebase and would love to fix\n> \"git rev-parse\" problems in my follow-on patches.\n> Thank you for the professional review comment.\n>\n> Sorry for late follow-on patch, I got tied up with my university stuffs.\n\nNo need to apologize; this is not a race. It's better to take time\npreparing submissions carefully, than trying to rush them out.\n\n> Please do review this patch as before. I will correct it if needed.\n\nBelow comments are meant to be instructive and constructive.\n\n> Cheers,\n> Pratik Karki\n\nPlace a \"-- >8--\" scissor line right here so that git-am knows where\nthe commit message begins; otherwise, all of the above commentary will\nundesirably be included in the commit message.\n\n> [PATCH] test: avoid pipes in git related commands for test suite\n\nAs this is the second attempt at this patch, the subject should be\n\"[PATCH v2]\". Also, as an aid to reviewers -- who see a lot of patches\neach day and are likely to forget details of each submission -- please\ninclude a link in the commentary (not in the actual commit message)\npointing at the previous iteration, like this[1].\n\n[1]: https://public-inbox.org/git/20180313201945.8409-1-predatoramigo@gmail.com/\n\n> Avoid using pipes downstream of Git commands since the exit codes\n> of commands upstream of pipes get swallowed, thus potentially\n> hiding failure of those commands. Instead, capture Git command\n> output to a file apply the downstream command(s) to that file.\n\nThis rewrite of the commit message which I suggested in [2] has a\ngrammatical error (which I noticed immediately after hitting \"Send\").\nUnfortunately, you copied it verbatim, so the error is reproduced\nhere. Specifically, you want to insert \"and\" between \"file\" and\n\"apply\":\n\n    ... capture Git command output to a file _and_ apply...\n\n[2]: https://public-inbox.org/git/CAPig+cRPzyw525ODC4=-E7w=zbpbhVN2eqxSYDSLij5wfW8S_A@mail.gmail.com/\n\n> Signed-off-by: Pratik Karki <predatoramigo@gmail.com>\n> ---\n>  t/t5300-pack-object.sh                     | 10 +++---\n>  t/t5510-fetch.sh                           |  8 ++---\n>  t/t7001-mv.sh                              | 22 ++++++-------\n>  t/t7003-filter-branch.sh                   |  9 ++++--\n>  t/t9104-git-svn-follow-parent.sh           | 16 +++++----\n>  t/t9108-git-svn-glob.sh                    | 14 ++++----\n>  t/t9109-git-svn-multi-glob.sh              | 28 +++++++++-------\n>  t/t9110-git-svn-use-svm-props.sh           | 42 ++++++++++++------------\n>  t/t9111-git-svn-use-svnsync-props.sh       | 36 ++++++++++-----------\n>  t/t9114-git-svn-dcommit-merge.sh           | 10 +++---\n>  t/t9130-git-svn-authors-file.sh            | 28 +++++++++-------\n>  t/t9138-git-svn-authors-prog.sh            | 31 +++++++++---------\n>  t/t9153-git-svn-rewrite-uuid.sh            |  8 ++---\n>  t/t9168-git-svn-partially-globbed-names.sh | 34 +++++++++++--------\n>  t/t9350-fast-export.sh                     | 52 ++++++++++++++++--------------\n>  15 files changed, 187 insertions(+), 161 deletions(-)\n\nThe goal of iterating a patch or patch series is to converge to a\npoint at which the submission is in good enough shape to be accepted.\nIdeally, each iteration should involve fewer changes than the previous\nattempt.\n\nVersion 1 of this patch touched only 8 files, however, this version\ntouches 15, and is now uncomfortably large and difficult to review in\na single sitting (it took over 1.5 hours). Rather than converging, it\nhas instead diverged, and is thus potentially further from being in an\nacceptable state than it would have been if v2 had merely addressed\nthe problems identified by the v1 review.\n\nWhile the desire to address these additional cases is admirable, it is\nbetter to focus on \"landing\" the current patch (getting it accepted)\nbefore expanding your efforts; it's also more reviewer-friendly to\nstay focused, especially with patches, such as this, which involve\nprimarily mechanical changes (which tend to be mind-numbing to\nreview).\n\n> diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\n> @@ -311,9 +311,9 @@ test_expect_success 'unpacking with --strict' '\n>         rm -f .git/index &&\n>         tail -n 10 LIST | git update-index --index-info &&\n>         ST=$(git write-tree) &&\n> -       PACK5=$( git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" | \\\n> -               git pack-objects test-5 ) &&\n> -       PACK6=$( (\n> +       git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" >actual &&\n> +       PACK5=$(git pack-objects test-5 < actual) &&\n> +       PACK6=$((\n\nLosing the space between the two left parentheses is wrong. $( ( foo )\n), which captures the output of subshell running 'foo', has very\ndifferent meaning than $((foo)), which performs arithmetic. This\nchange turns it into $(( foo) ), which, at best, is undefined.\nAlthough bash seems to tolerate this change, other more strict shells\nbarf on it.\n\n>                         echo \"$LIST\"\n>                         echo \"$LI\"\n>                         echo \"$ST\"\n> @@ -358,8 +358,8 @@ test_expect_success 'index-pack with --strict' '\n>         rm -f .git/index &&\n>         tail -n 10 LIST | git update-index --index-info &&\n>         ST=$(git write-tree) &&\n> -       PACK5=$( git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" | \\\n> -               git pack-objects test-5 ) &&\n> +       git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" >actual &&\n> +       PACK5=$(git pack-objects test-5 < actual) &&\n>         PACK6=$( (\n>                         echo \"$LIST\"\n>                         echo \"$LI\"\n> diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\n> @@ -187,7 +187,8 @@ test_expect_success 'author information is preserved' '\n>                         test \\$GIT_COMMIT != $(git rev-parse master) || \\\n>                         echo Hallo\" \\\n>                 preserved-author) &&\n> -       test 1 = $(git rev-list --author=\"B V Uips\" preserved-author | wc -l)\n> +       git rev-list --author=\"B V Uips\" preserved-author > actual &&\n\nStyle: drop space after '>'\n\n> +       test 1 = $(wc -l < actual)\n\nStyle: drop space after '<'\n\nYou could also take advantage of test_line_count() rather than using 'wc':\n\n    test_line_count = 1 actual\n\nIt's a judgment call whether or not to convert this to use\ntest_line_count(), however, since you made such a conversion later in\nthis file, you should do it here too. Or, don't use test_line_count()\nin this file. It's not so important whether you do or not, but it is\nimportant that you be consistent about it (which is not currently the\ncase).\n\n> @@ -205,7 +206,8 @@ test_expect_success \"remove a certain author's commits\" '\n>         cnt1=$(git rev-list master | wc -l) &&\n>         cnt2=$(git rev-list removed-author | wc -l) &&\n>         test $cnt1 -eq $(($cnt2 + 1)) &&\n> -       test 0 = $(git rev-list --author=\"B V Uips\" removed-author | wc -l)\n> +       git rev-list --author=\"B V Uips\" removed-author >actual &&\n> +       test 0 = $(wc -l < actual)\n\nDitto: drop space before '<'\nDitto: test_line_count = 0 actual\n\n> @@ -258,7 +260,8 @@ test_expect_success 'Subdirectory filter with disappearing trees' '\n>         git filter-branch -f --subdirectory-filter foo &&\n> -       test $(git rev-list master | wc -l) = 3\n> +       git rev-list master >actual &&\n> +       test_line_count = 3 actual\n>  '\n\nHere you used test_line_count().\n\n> diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\n> @@ -204,8 +205,9 @@ test_expect_success \"follow-parent is atomic\" '\n>  test_expect_success \"track multi-parent paths\" '\n>         svn_cmd cp -m \"resurrect /glob\" \"$svnrepo\"/r9270 \"$svnrepo\"/glob &&\n>         git svn multi-fetch &&\n> -       test $(git cat-file commit refs/remotes/glob | \\\n> -              grep \"^parent \" | wc -l) -eq 2\n> +       git cat-file commit refs/remotes/glob >actual &&\n> +       grep \"^parent \" actual > actual2 &&\n\nStyle: drop space after '>'\n\n> +       test_line_count = 2 actual2\n> diff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh\n> @@ -47,8 +47,8 @@ test_expect_success 'test refspec globbing' '\n>         git config --add svn-remote.svn.tags\\\n>                          \"tags/*/src/a:refs/remotes/tags/*\" &&\n>         git svn multi-fetch &&\n> -       git log --pretty=oneline refs/remotes/tags/end | \\\n> -           sed -e \"s/^.\\{41\\}//\" > output.end &&\n> +       git log --pretty=oneline refs/remotes/tags/end >actual &&\n> +       sed -e \"s/^.\\{41\\}//\" actual > output.end &&\n\nThis is not a new problem, but since you're touching it, drop space after '>'.\n\n>         test_cmp expect.end output.end &&\n> @@ -75,14 +75,16 @@ test_expect_success 'test left-hand-side only globbing' '\n>         git svn fetch two &&\n> -       test $(git rev-list refs/remotes/two/tags/end | wc -l) -eq 6 &&\n> -       test $(git rev-list refs/remotes/two/branches/start | wc -l) -eq 3 &&\n> +       git rev-list refs/remotes/two/tags/end >actual &&\n> +       test_line_count = 6 actual &&\n> +       git rev-list refs/remotes/two/branches/start >actual2 &&\n> +       test_line_count = 3 actual2 &&\n\nIt's better to name all these files \"actual\", rather than inventing\nnames \"actual2\", \"actual3\", etc. Those invented names mislead readers\ninto thinking that there might be some interrelation between the files\nwhich requires them all to exist at once. But, this is not the case.\nThose files serve no purpose after their associated test_line_count(),\nand you can clearly indicate such by overwriting each time by reusing\nthe name \"actual\".\n\n>         test $(git rev-parse refs/remotes/two/branches/start~2) = \\\n>              $(git rev-parse refs/remotes/two/trunk) &&\n>         test $(git rev-parse refs/remotes/two/tags/end~3) = \\\n>              $(git rev-parse refs/remotes/two/branches/start) &&\n> -       git log --pretty=oneline refs/remotes/two/tags/end | \\\n> -           sed -e \"s/^.\\{41\\}//\" > output.two &&\n> +       git log --pretty=oneline refs/remotes/two/tags/end >actual3 &&\n> +       sed -e \"s/^.\\{41\\}//\" actual3 > output.two &&\n\nStyle: drop space after '>'\n\n>         test_cmp expect.two output.two\n> diff --git a/t/t9109-git-svn-multi-glob.sh b/t/t9109-git-svn-multi-glob.sh\n> @@ -47,8 +47,8 @@ test_expect_success 'test refspec globbing' '\n>         git config --add svn-remote.svn.tags\\\n>                          \"tags/*/src/a:refs/remotes/tags/*\" &&\n>         git svn multi-fetch &&\n> -       git log --pretty=oneline refs/remotes/tags/end | \\\n> -           sed -e \"s/^.\\{41\\}//\" > output.end &&\n> +       git log --pretty=oneline refs/remotes/tags/end >actual &&\n> +       sed -e \"s/^.\\{41\\}//\" actual > output.end &&\n\nStyle: drop space after '>'\n\n>         test_cmp expect.end output.end &&\n> @@ -75,14 +75,16 @@ test_expect_success 'test left-hand-side only globbing' '\n>         git svn fetch two &&\n> -       test $(git rev-list refs/remotes/two/tags/end | wc -l) -eq 6 &&\n> -       test $(git rev-list refs/remotes/two/branches/v1/start | wc -l) -eq 3 &&\n> +       git rev-list refs/remotes/two/tags/end >actual2 &&\n> +       test_line_count = 6 actual2 &&\n> +       git rev-list refs/remotes/two/branches/v1/start >actual3 &&\n> +       test_line_count = 3 actual3 &&\n\nDitto: name all these files \"actual\" rather than unnecessarily\ninventing unique names\n\n>         test $(git rev-parse refs/remotes/two/branches/v1/start~2) = \\\n>              $(git rev-parse refs/remotes/two/trunk) &&\n>         test $(git rev-parse refs/remotes/two/tags/end~3) = \\\n>              $(git rev-parse refs/remotes/two/branches/v1/start) &&\n> -       git log --pretty=oneline refs/remotes/two/tags/end | \\\n> -           sed -e \"s/^.\\{41\\}//\" > output.two &&\n> +       git log --pretty=oneline refs/remotes/two/tags/end >actual4 &&\n> +       sed -e \"s/^.\\{41\\}//\" actual4 > output.two &&\n\nStyle: drop space after '>'\n\n>         test_cmp expect.two output.two\n> @@ -120,18 +122,20 @@ test_expect_success 'test another branch' '\n>         git config --add svn-remote.four.url \"$svnrepo\" &&\n>         git config --add svn-remote.four.fetch trunk:refs/remotes/four/trunk &&\n>         git config --add svn-remote.four.branches \\\n> -                        \"branches/*/*:refs/remotes/four/branches/*/*\" &&\n> +                        \"branches/*/*:refs/remotes/four/branches/*/*\" &&\n>         git config --add svn-remote.four.tags \\\n> -                        \"tags/*:refs/remotes/four/tags/*\" &&\n> +                        \"tags/*:refs/remotes/four/tags/*\" &&\n\nI guess you sneaked in a whitespace change here which is unrelated to\nthe stated purpose of this patch, thus acted as a speed bump during\nreview. If this was the only instance in this test script of\nwhitespace needing correction, then it _might_ be okay to include it\nin this patch, however, that's not the case. There are many other such\ninstance in this test script which could be corrected, so it doesn't\nmake sense to single out these two and ignore all the others.\nTherefore, you should omit this change.\n\n>         git svn fetch four &&\n> -       test $(git rev-list refs/remotes/four/tags/next | wc -l) -eq 5 &&\n> -       test $(git rev-list refs/remotes/four/branches/v2/start | wc -l) -eq 3 &&\n> +       git rev-list refs/remotes/four/tags/next >actual &&\n> +       test_line_count = 5 actual &&\n> +       git rev-list refs/remotes/four/branches/v2/start >actual2 &&\n> +       test_line_count = 3 actual2 &&\n\nDitto: name all these files \"actual\" rather than unnecessarily\ninventing unique names\n\n>         test $(git rev-parse refs/remotes/four/branches/v2/start~2) = \\\n>              $(git rev-parse refs/remotes/four/trunk) &&\n>         test $(git rev-parse refs/remotes/four/tags/next~2) = \\\n>              $(git rev-parse refs/remotes/four/branches/v2/start) &&\n> -       git log --pretty=oneline refs/remotes/four/tags/next | \\\n> -           sed -e \"s/^.\\{41\\}//\" > output.four &&\n> +       git log --pretty=oneline refs/remotes/four/tags/next >actual3 &&\n> +       sed -e \"s/^.\\{41\\}//\" actual3 > output.four &&\n\nStyle: drop space after '>'\n\n>         test_cmp expect.four output.four\n> diff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh\n> @@ -21,38 +21,38 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89\n>  test_expect_success 'verify metadata for /bar' \"\n> -       git cat-file commit refs/remotes/bar | \\\n> -          grep '^git-svn-id: $bar_url@12 $uuid$' &&\n> -       git cat-file commit refs/remotes/bar~1 | \\\n> -          grep '^git-svn-id: $bar_url@11 $uuid$' &&\n> -       git cat-file commit refs/remotes/bar~2 | \\\n> -          grep '^git-svn-id: $bar_url@10 $uuid$' &&\n> -       git cat-file commit refs/remotes/bar~3 | \\\n> -          grep '^git-svn-id: $bar_url@9 $uuid$' &&\n> -       git cat-file commit refs/remotes/bar~4 | \\\n> -          grep '^git-svn-id: $bar_url@6 $uuid$' &&\n> -       git cat-file commit refs/remotes/bar~5 | \\\n> -          grep '^git-svn-id: $bar_url@1 $uuid$'\n> +       git cat-file commit refs/remotes/bar >actual &&\n> +       grep '^git-svn-id: $bar_url@12 $uuid$' actual &&\n> +       git cat-file commit refs/remotes/bar~1 >actual1 &&\n> +       grep '^git-svn-id: $bar_url@11 $uuid$' actual1 &&\n> +       git cat-file commit refs/remotes/bar~2 >actual2 &&\n> +       grep '^git-svn-id: $bar_url@10 $uuid$' actual2 &&\n> +       git cat-file commit refs/remotes/bar~3 >actual3 &&\n> +       grep '^git-svn-id: $bar_url@9 $uuid$' actual3 &&\n> +       git cat-file commit refs/remotes/bar~4 >actual4 &&\n> +       grep '^git-svn-id: $bar_url@6 $uuid$' actual4 &&\n> +       git cat-file commit refs/remotes/bar~5 >actual5 &&\n> +       grep '^git-svn-id: $bar_url@1 $uuid$' actual5\n>         \"\n\nDitto: name all these files \"actual\" rather than unnecessarily\ninventing unique names\n\nSame comment applies to many more tests below; I won't be repeating it\nbeyond this point.\n\n> diff --git a/t/t9130-git-svn-authors-file.sh b/t/t9130-git-svn-authors-file.sh\n> @@ -102,8 +104,10 @@ test_expect_success !MINGW 'fresh clone with svn.authors-file in config' '\n>                 test x\"$HOME\"/svn-authors = x\"$(git config svn.authorsfile)\" &&\n>                 git svn clone \"$svnrepo\" gitconfig.clone &&\n>                 cd gitconfig.clone &&\n> -               nr_ex=$(git log | grep \"^Author:.*example.com\" | wc -l) &&\n> -               nr_rev=$(git rev-list HEAD | wc -l) &&\n> +               nr_ex=$(git log >actual &&\n> +                           grep \"^Author:.*example.com\" actual | wc -l) &&\n> +               nr_rev=$(git rev-list HEAD >actual &&\n> +                            wc -l < actual) &&\n>                 test $nr_rev -eq $nr_ex\n\nThis transformation is effectively bogus, as explained already in my\nreview[3] of v1. If git-log or git-rev-list fails, variable nr_ex or\nnr_rev will have an empty value, thus 'test' will error out. Move the\ngit-log and git-rev-list invocations out of the $(...):\n\n    git log >actual &&\n    nr_ex=$(grep \"...\" actual | wc -l) &&\n    git rev-list HEAD >actual &&\n    nr_rev=$(wc -l <actual) &&\n    test $nr_rev -eq $nr_ex\n\nAlso, style: drop space after '<'\n\n[3]: https://public-inbox.org/git/CAPig+cRPzyw525ODC4=-E7w=zbpbhVN2eqxSYDSLij5wfW8S_A@mail.gmail.com/\n\n> diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\n> @@ -43,20 +43,20 @@ test_expect_success 'fast-export | fast-import' '\n>         MUSS=$(git rev-parse --verify muss) &&\n>         mkdir new &&\n>         git --git-dir=new/.git init &&\n> -       git fast-export --all |\n> +       git fast-export --all >actual &&\n>         (cd new &&\n>          git fast-import &&\n>          test $MASTER = $(git rev-parse --verify refs/heads/master) &&\n>          test $REIN = $(git rev-parse --verify refs/tags/rein) &&\n>          test $WER = $(git rev-parse --verify refs/heads/wer) &&\n> -        test $MUSS = $(git rev-parse --verify refs/tags/muss))\n> +        test $MUSS = $(git rev-parse --verify refs/tags/muss)) < actual\n\nStyle: drop space after '<'\n\n>  '\n>\n>  test_expect_success 'fast-export master~2..master' '\n>\n> -       git fast-export master~2..master |\n> -               sed \"s/master/partial/\" |\n> +       git fast-export master~2..master >actual2 &&\n> +       sed \"s/master/partial/\" actual2 |\n\nNot sure why you named this \"actual2\" rather than just \"actual\".\n\n>                 (cd new &&\n>                  git fast-import &&\n>                  test $MASTER != $(git rev-parse --verify refs/heads/partial) &&\n> @@ -74,11 +74,12 @@ test_expect_success 'iso-8859-1' '\n>         git commit -s -m den file &&\n> -       git fast-export wer^..wer |\n> -               sed \"s/wer/i18n/\" |\n> -               (cd new &&\n> -                git fast-import &&\n> -                git cat-file commit i18n | grep \"Áéí óú\")\n> +       git fast-export wer^..wer >actual3 &&\n> +       sed \"s/wer/i18n/\" actual3 |\n\nDitto: Why \"actual3\" rather than \"actual\"?\n\n> +           (cd new &&\n> +               git fast-import &&\n> +               git cat-file commit i18n >actual4 &&\n> +               grep \"Áéí óú\" actual4)\n> @@ -87,18 +88,18 @@ test_expect_success 'import/export-marks' '\n>         git fast-export --export-marks=tmp-marks HEAD &&\n>         test -s tmp-marks &&\n>         test_line_count = 3 tmp-marks &&\n> +       git fast-export --import-marks=tmp-marks\\\n> +               --export-marks=tmp-marks HEAD >actual &&\n\nStyle: not a new problem, but add space before \\ since you're touching it\n\n>         test $(\n> -               git fast-export --import-marks=tmp-marks\\\n> -               --export-marks=tmp-marks HEAD |\n> -               grep ^commit |\n> +               grep ^commit actual |\n>                 wc -l) \\\n>         -eq 0 &&\n> @@ -192,7 +193,7 @@ test_expect_success 'submodule fast-export | fast-import' '\n>          git checkout master &&\n>          git submodule init &&\n>          git submodule update &&\n> -        cmp sub/file ../sub/file)\n> +        cmp sub/file ../sub/file) < actual\n\nStyle: drop space after '<'\n\n> @@ -361,18 +362,20 @@ test_expect_failure 'no exact-ref revisions included' '\n> -test_expect_success 'path limiting with import-marks does not lose unmodified files'        '\n> +test_expect_success 'path limiting with import-marks does not lose unmodified files'       '\n\nIt's probably better not to sneak in whitespace changes, especially if\nyou're not fixing all of them in this script (and this isn't even the\ncorrect fix). Same comment applies below.\n\n> -test_expect_success 'full-tree re-shows unmodified files'        '\n> +test_expect_success 'full-tree re-shows unmodified files'       '\n> @@ -505,8 +508,8 @@ test_expect_success 'refs are updated even if no commits need to be exported' '\n>  test_expect_success 'use refspec' '\n> -       git fast-export --refspec refs/heads/master:refs/heads/foobar master | \\\n> -               grep \"^commit \" | sort | uniq > actual &&\n> +       git fast-export --refspec refs/heads/master:refs/heads/foobar master >actual2 &&\n> +       grep \"^commit \" actual2 | sort | uniq > actual &&\n\nStyle: drop space before '>' (and probably the next line too)\n\n>         echo \"commit refs/heads/foobar\" > expected &&\n> @@ -534,7 +537,8 @@ test_expect_success 'when using -C, do not declare copy when source of copy is a\n>         test_create_repo dst &&\n> -       git -C src fast-export --all -C | git -C dst fast-import &&\n> +       git -C src fast-export --all -C > actual &&\n> +       git -C dst fast-import < actual &&\n\nStyle: drop space before '>' and '<'\n\n>         git -C src show >expected &&\n>         git -C dst show >actual &&\n>         test_cmp expected actual\n"},{"id":"342409","messageId":"20180321152356.10754-1-predatoramigo@gmail.com","threadId":"48036","inReplyTo":"CAPig+cTKkp6kpFcJfVV8W1ejCrCWQH33mHtgFUn+MpMgw5i1pA@mail.gmail.com","subject":"[GSoC][PATCH v3] test: avoid pipes in git related commands for test","fromName":"Pratik Karki","fromEmail":"predatoramigo@gmail.com","sentAt":"2018-03-21T15:23:56Z","receivedAt":"2018-03-21T15:24:28Z","isPatch":true,"sender":{"key":"predatoramigo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12194950?v=4"},"body":"Thank you Eric, for the review. This is follow on patch[1].\n\nThe changes in patch increased from v1 to v2 because I\ngot excited to work in Git codebase and I tried to\nfix the exisiting problems as much as possible.\nHence, the large number of changes.\n\n\n>>         test_cmp expect.two output.two\n>> @@ -120,18 +122,20 @@ test_expect_success 'test another branch' '\n>>         git config --add svn-remote.four.url \"$svnrepo\" &&\n>>         git config --add svn-remote.four.fetch trunk:refs/remotes/four/trunk &&\n>>         git config --add svn-remote.four.branches \\\n>> -                        \"branches/*/*:refs/remotes/four/branches/*/*\" &&\n>> +                        \"branches/*/*:refs/remotes/four/branches/*/*\" &&\n>>         git config --add svn-remote.four.tags \\\n>> -                        \"tags/*:refs/remotes/four/tags/*\" &&\n>> +                        \"tags/*:refs/remotes/four/tags/*\" &&\n\n>I guess you sneaked in a whitespace change here which is unrelated to\n>the stated purpose of this patch, thus acted as a speed bump during\n>review. If this was the only instance in this test script of\n>whitespace needing correction, then it _might_ be okay to include it\n>in this patch, however, that's not the case. There are many other such\n>instance in this test script which could be corrected, so it doesn't\n>make sense to single out these two and ignore all the others.\n>Therefore, you should omit this change.\n\nI used tabify in Emacs and it must have messed up the whitespace\nchange. I read SubmittingPatches guideline[2] for git where it\nis said that whitespace check must be done and git community is\npicky about it and 'git diff --check' must be done before commit.\nIf I change this change back to original the 'git diff --check'\nreports whitespace identation with space. So, isn't this\nsupposedly a fix?\n\n[1]: https://public-inbox.org/git/20180319173204.31952-1-predatoramigo@gmail.com/\n[2]: https://github.com/git/git/blob/master/Documentation/SubmittingPatches\n\n------------------------------------- >8----------------------------------------\n\n Avoid using pipes downstream of Git commands since the exit\n codes of commands upstream of pipes get swallowed, thus potentially hiding\n failure of those commands. Instead, capture Git command output to a file and\n apply the downstream command(s) to that file.\n\nSigned-off-by: Pratik Karki <predatoramigo@gmail.com>\n---\n t/t5300-pack-object.sh                     | 10 +++---\n t/t5510-fetch.sh                           |  8 ++---\n t/t7001-mv.sh                              | 22 ++++++------\n t/t7003-filter-branch.sh                   |  9 +++--\n t/t9104-git-svn-follow-parent.sh           | 16 +++++----\n t/t9108-git-svn-glob.sh                    | 14 ++++----\n t/t9109-git-svn-multi-glob.sh              | 38 +++++++++++----------\n t/t9110-git-svn-use-svm-props.sh           | 42 +++++++++++------------\n t/t9111-git-svn-use-svnsync-props.sh       | 36 ++++++++++----------\n t/t9114-git-svn-dcommit-merge.sh           | 10 +++---\n t/t9130-git-svn-authors-file.sh            | 28 +++++++++-------\n t/t9138-git-svn-authors-prog.sh            | 31 ++++++++---------\n t/t9153-git-svn-rewrite-uuid.sh            |  8 ++---\n t/t9168-git-svn-partially-globbed-names.sh | 34 +++++++++++--------\n t/t9350-fast-export.sh                     | 54 ++++++++++++++++--------------\n 15 files changed, 193 insertions(+), 167 deletions(-)\n\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex 9c68b9925..707208284 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -311,9 +311,9 @@ test_expect_success 'unpacking with --strict' '\n \trm -f .git/index &&\n \ttail -n 10 LIST | git update-index --index-info &&\n \tST=$(git write-tree) &&\n-\tPACK5=$( git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" | \\\n-\t\tgit pack-objects test-5 ) &&\n-\tPACK6=$( (\n+\tgit rev-list --objects \"$LIST\" \"$LI\" \"$ST\" >actual &&\n+\tPACK5=$( git pack-objects test-5 <actual ) &&\n+\tPACK6=$((\n \t\t\techo \"$LIST\"\n \t\t\techo \"$LI\"\n \t\t\techo \"$ST\"\n@@ -358,8 +358,8 @@ test_expect_success 'index-pack with --strict' '\n \trm -f .git/index &&\n \ttail -n 10 LIST | git update-index --index-info &&\n \tST=$(git write-tree) &&\n-\tPACK5=$( git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" | \\\n-\t\tgit pack-objects test-5 ) &&\n+\tgit rev-list --objects \"$LIST\" \"$LI\" \"$ST\" >actual &&\n+\tPACK5=$( git pack-objects test-5 <actual ) &&\n \tPACK6=$( (\n \t\t\techo \"$LIST\"\n \t\t\techo \"$LI\"\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex 668c54be4..c7b284138 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -693,8 +693,8 @@ test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '\n \ttest_commit looooooooooooong-tag &&\n \t(\n \t\tcd full-output &&\n-\t\tgit -c fetch.output=full fetch origin 2>&1 | \\\n-\t\t\tgrep -e \"->\" | cut -c 22- >../actual\n+\t\tgit -c fetch.output=full fetch origin >actual2 2>&1 &&\n+\t\tgrep -e \"->\" actual2 | cut -c 22- >../actual\n \t) &&\n \tcat >expect <<-\\EOF &&\n \tmaster               -> origin/master\n@@ -708,8 +708,8 @@ test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '\n \ttest_commit extraaa &&\n \t(\n \t\tcd compact &&\n-\t\tgit -c fetch.output=compact fetch origin 2>&1 | \\\n-\t\t\tgrep -e \"->\" | cut -c 22- >../actual\n+\t\tgit -c fetch.output=compact fetch origin >actual2 2>&1 &&\n+\t\tgrep -e \"->\" actual2 | cut -c 22- >../actual\n \t) &&\n \tcat >expect <<-\\EOF &&\n \tmaster     -> origin/*\ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex 6e5031f56..00aa9e45b 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -21,8 +21,8 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-    grep \"^R100..*path0/COPYING..*path1/COPYING\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+    grep \"^R100..*path0/COPYING..*path1/COPYING\" actual'\n \n test_expect_success \\\n     'moving the file back into subdirectory' \\\n@@ -35,8 +35,8 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-    grep \"^R100..*path1/COPYING..*path0/COPYING\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+    grep \"^R100..*path1/COPYING..*path0/COPYING\" actual'\n \n test_expect_success \\\n     'checking -k on non-existing file' \\\n@@ -116,10 +116,9 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path0/COPYING..*path2/COPYING\" &&\n-     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path0/README..*path2/README\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+     grep \"^R100..*path0/COPYING..*path2/COPYING\" actual &&\n+     grep \"^R100..*path0/README..*path2/README\" actual'\n \n test_expect_success \\\n     'succeed when source is a prefix of destination' \\\n@@ -135,10 +134,9 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path2/COPYING..*path1/path2/COPYING\" &&\n-     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path2/README..*path1/path2/README\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+     grep \"^R100..*path2/COPYING..*path1/path2/COPYING\" actual &&\n+     grep \"^R100..*path2/README..*path1/path2/README\" actual'\n \n test_expect_success \\\n     'do not move directory over existing directory' \\\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex 7cb60799b..6a28b6cce 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -187,7 +187,8 @@ test_expect_success 'author information is preserved' '\n \t\t\ttest \\$GIT_COMMIT != $(git rev-parse master) || \\\n \t\t\techo Hallo\" \\\n \t\tpreserved-author) &&\n-\ttest 1 = $(git rev-list --author=\"B V Uips\" preserved-author | wc -l)\n+\tgit rev-list --author=\"B V Uips\" preserved-author >actual &&\n+\ttest_line_count = 1 actual\n '\n \n test_expect_success \"remove a certain author's commits\" '\n@@ -205,7 +206,8 @@ test_expect_success \"remove a certain author's commits\" '\n \tcnt1=$(git rev-list master | wc -l) &&\n \tcnt2=$(git rev-list removed-author | wc -l) &&\n \ttest $cnt1 -eq $(($cnt2 + 1)) &&\n-\ttest 0 = $(git rev-list --author=\"B V Uips\" removed-author | wc -l)\n+\tgit rev-list --author=\"B V Uips\" removed-author >actual &&\n+\ttest_line_count = 0 actual\n '\n \n test_expect_success 'barf on invalid name' '\n@@ -258,7 +260,8 @@ test_expect_success 'Subdirectory filter with disappearing trees' '\n \tgit commit -m \"Re-adding foo\" &&\n \n \tgit filter-branch -f --subdirectory-filter foo &&\n-\ttest $(git rev-list master | wc -l) = 3\n+\tgit rev-list master >actual &&\n+\ttest_line_count = 3 actual\n '\n \n test_expect_success 'Tag name filtering retains tag message' '\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex cd480edf1..a735fa371 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -33,8 +33,8 @@ test_expect_success 'init and fetch a moved directory' '\n \tgit svn fetch -i thunk &&\n \ttest \"$(git rev-parse --verify refs/remotes/thunk@2)\" \\\n \t   = \"$(git rev-parse --verify refs/remotes/thunk~1)\" &&\n-\ttest \"$(git cat-file blob refs/remotes/thunk:readme |\\\n-\t\t sed -n -e \"3p\")\" = goodbye &&\n+\tgit cat-file blob refs/remotes/thunk:readme >actual &&\n+\ttest \"$(sed -n -e \"3p\" actual)\" = goodbye &&\n \ttest -z \"$(git config --get svn-remote.svn.fetch \\\n \t\t \"^trunk:refs/remotes/thunk@2$\")\"\n \t'\n@@ -48,8 +48,8 @@ test_expect_success 'init and fetch from one svn-remote' '\n         git svn fetch -i svn/thunk &&\n \ttest \"$(git rev-parse --verify refs/remotes/svn/trunk)\" \\\n \t   = \"$(git rev-parse --verify refs/remotes/svn/thunk~1)\" &&\n-\ttest \"$(git cat-file blob refs/remotes/svn/thunk:readme |\\\n-\t\t sed -n -e \"3p\")\" = goodbye\n+\tgit cat-file blob refs/remotes/svn/thunk:readme >actual &&\n+\ttest \"$(sed -n -e \"3p\" actual)\" = goodbye\n         '\n \n test_expect_success 'follow deleted parent' '\n@@ -107,7 +107,8 @@ test_expect_success 'follow deleted directory' '\n \tgit svn init --minimize-url -i glob \"$svnrepo\"/glob &&\n \tgit svn fetch -i glob &&\n \ttest \"$(git cat-file blob refs/remotes/glob:blob/bye)\" = hi &&\n-\ttest \"$(git ls-tree refs/remotes/glob | wc -l )\" -eq 1\n+\tgit ls-tree refs/remotes/glob >actual &&\n+\ttest_line_count = 1 actual\n \t'\n \n # ref: r9270 of the Subversion repository: (http://svn.collab.net/repos/svn)\n@@ -204,8 +205,9 @@ test_expect_success \"follow-parent is atomic\" '\n test_expect_success \"track multi-parent paths\" '\n \tsvn_cmd cp -m \"resurrect /glob\" \"$svnrepo\"/r9270 \"$svnrepo\"/glob &&\n \tgit svn multi-fetch &&\n-\ttest $(git cat-file commit refs/remotes/glob | \\\n-\t       grep \"^parent \" | wc -l) -eq 2\n+\tgit cat-file commit refs/remotes/glob >actual &&\n+\tgrep \"^parent \" actual >actual2 &&\n+\ttest_line_count = 2 actual2\n \t'\n \n test_expect_success \"multi-fetch continues to work\" \"\ndiff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh\nindex a94286c8e..6990f6436 100755\n--- a/t/t9108-git-svn-glob.sh\n+++ b/t/t9108-git-svn-glob.sh\n@@ -47,8 +47,8 @@ test_expect_success 'test refspec globbing' '\n \tgit config --add svn-remote.svn.tags\\\n \t                 \"tags/*/src/a:refs/remotes/tags/*\" &&\n \tgit svn multi-fetch &&\n-\tgit log --pretty=oneline refs/remotes/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.end &&\n+\tgit log --pretty=oneline refs/remotes/tags/end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.end &&\n \ttest_cmp expect.end output.end &&\n \ttest \"$(git rev-parse refs/remotes/tags/end~1)\" = \\\n \t\t\"$(git rev-parse refs/remotes/branches/start)\" &&\n@@ -75,14 +75,16 @@ test_expect_success 'test left-hand-side only globbing' '\n \t\tsvn_cmd commit -m \"try to try\"\n \t) &&\n \tgit svn fetch two &&\n-\ttest $(git rev-list refs/remotes/two/tags/end | wc -l) -eq 6 &&\n-\ttest $(git rev-list refs/remotes/two/branches/start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/two/tags/end >actual &&\n+\ttest_line_count = 6 actual &&\n+\tgit rev-list refs/remotes/two/branches/start >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/two/branches/start~2) = \\\n \t     $(git rev-parse refs/remotes/two/trunk) &&\n \ttest $(git rev-parse refs/remotes/two/tags/end~3) = \\\n \t     $(git rev-parse refs/remotes/two/branches/start) &&\n-\tgit log --pretty=oneline refs/remotes/two/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.two &&\n+\tgit log --pretty=oneline refs/remotes/two/tags/end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.two &&\n \ttest_cmp expect.two output.two\n \t'\n \ndiff --git a/t/t9109-git-svn-multi-glob.sh b/t/t9109-git-svn-multi-glob.sh\nindex 8d99e848d..5abffe1a4 100755\n--- a/t/t9109-git-svn-multi-glob.sh\n+++ b/t/t9109-git-svn-multi-glob.sh\n@@ -41,14 +41,14 @@ test_expect_success 'test refspec globbing' '\n \t) &&\n \tgit config --add svn-remote.svn.url \"$svnrepo\" &&\n \tgit config --add svn-remote.svn.fetch \\\n-\t                 \"trunk/src/a:refs/remotes/trunk\" &&\n+\t\t\t \"trunk/src/a:refs/remotes/trunk\" &&\n \tgit config --add svn-remote.svn.branches \\\n-\t                 \"branches/*/*/src/a:refs/remotes/branches/*/*\" &&\n+\t\t\t \"branches/*/*/src/a:refs/remotes/branches/*/*\" &&\n \tgit config --add svn-remote.svn.tags\\\n-\t                 \"tags/*/src/a:refs/remotes/tags/*\" &&\n+\t\t\t \"tags/*/src/a:refs/remotes/tags/*\" &&\n \tgit svn multi-fetch &&\n-\tgit log --pretty=oneline refs/remotes/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.end &&\n+\tgit log --pretty=oneline refs/remotes/tags/end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.end &&\n \ttest_cmp expect.end output.end &&\n \ttest \"$(git rev-parse refs/remotes/tags/end~1)\" = \\\n \t\t\"$(git rev-parse refs/remotes/branches/v1/start)\" &&\n@@ -65,9 +65,9 @@ test_expect_success 'test left-hand-side only globbing' '\n \tgit config --add svn-remote.two.url \"$svnrepo\" &&\n \tgit config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk &&\n \tgit config --add svn-remote.two.branches \\\n-\t                 \"branches/*/*:refs/remotes/two/branches/*/*\" &&\n+\t\t\t \"branches/*/*:refs/remotes/two/branches/*/*\" &&\n \tgit config --add svn-remote.two.tags \\\n-\t                 \"tags/*:refs/remotes/two/tags/*\" &&\n+\t\t\t \"tags/*:refs/remotes/two/tags/*\" &&\n \t(\n \t\tcd tmp &&\n \t\techo \"try try\" >> tags/end/src/b/readme &&\n@@ -75,14 +75,16 @@ test_expect_success 'test left-hand-side only globbing' '\n \t\tsvn_cmd commit -m \"try to try\"\n \t) &&\n \tgit svn fetch two &&\n-\ttest $(git rev-list refs/remotes/two/tags/end | wc -l) -eq 6 &&\n-\ttest $(git rev-list refs/remotes/two/branches/v1/start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/two/tags/end >actual &&\n+\ttest_line_count = 6 actual &&\n+\tgit rev-list refs/remotes/two/branches/v1/start >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/two/branches/v1/start~2) = \\\n \t     $(git rev-parse refs/remotes/two/trunk) &&\n \ttest $(git rev-parse refs/remotes/two/tags/end~3) = \\\n \t     $(git rev-parse refs/remotes/two/branches/v1/start) &&\n-\tgit log --pretty=oneline refs/remotes/two/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.two &&\n+\tgit log --pretty=oneline refs/remotes/two/tags/end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.two &&\n \ttest_cmp expect.two output.two\n \t'\n cat > expect.four <<EOF\n@@ -120,18 +122,20 @@ test_expect_success 'test another branch' '\n \tgit config --add svn-remote.four.url \"$svnrepo\" &&\n \tgit config --add svn-remote.four.fetch trunk:refs/remotes/four/trunk &&\n \tgit config --add svn-remote.four.branches \\\n-\t                 \"branches/*/*:refs/remotes/four/branches/*/*\" &&\n+\t\t\t \"branches/*/*:refs/remotes/four/branches/*/*\" &&\n \tgit config --add svn-remote.four.tags \\\n-\t                 \"tags/*:refs/remotes/four/tags/*\" &&\n+\t\t\t \"tags/*:refs/remotes/four/tags/*\" &&\n \tgit svn fetch four &&\n-\ttest $(git rev-list refs/remotes/four/tags/next | wc -l) -eq 5 &&\n-\ttest $(git rev-list refs/remotes/four/branches/v2/start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/four/tags/next >actual &&\n+\ttest_line_count = 5 actual &&\n+\tgit rev-list refs/remotes/four/branches/v2/start >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/four/branches/v2/start~2) = \\\n \t     $(git rev-parse refs/remotes/four/trunk) &&\n \ttest $(git rev-parse refs/remotes/four/tags/next~2) = \\\n \t     $(git rev-parse refs/remotes/four/branches/v2/start) &&\n-\tgit log --pretty=oneline refs/remotes/four/tags/next | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.four &&\n+\tgit log --pretty=oneline refs/remotes/four/tags/next >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.four &&\n \ttest_cmp expect.four output.four\n \t'\n \ndiff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh\nindex dde0a3c22..dbd9590a7 100755\n--- a/t/t9110-git-svn-use-svm-props.sh\n+++ b/t/t9110-git-svn-use-svm-props.sh\n@@ -21,38 +21,38 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89\n \n bar_url=http://mayonaise/svnrepo/bar\n test_expect_success 'verify metadata for /bar' \"\n-\tgit cat-file commit refs/remotes/bar | \\\n-\t   grep '^git-svn-id: $bar_url@12 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~1 | \\\n-\t   grep '^git-svn-id: $bar_url@11 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~2 | \\\n-\t   grep '^git-svn-id: $bar_url@10 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~3 | \\\n-\t   grep '^git-svn-id: $bar_url@9 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~4 | \\\n-\t   grep '^git-svn-id: $bar_url@6 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~5 | \\\n-\t   grep '^git-svn-id: $bar_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/bar >actual &&\n+\tgrep '^git-svn-id: $bar_url@12 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~1 >actual &&\n+\tgrep '^git-svn-id: $bar_url@11 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~2 >actual &&\n+\tgrep '^git-svn-id: $bar_url@10 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~3 >actual &&\n+\tgrep '^git-svn-id: $bar_url@9 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~4 >actual &&\n+\tgrep '^git-svn-id: $bar_url@6 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~5 >actual &&\n+\tgrep '^git-svn-id: $bar_url@1 $uuid$' actual\n \t\"\n \n e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e\n test_expect_success 'verify metadata for /dir/a/b/c/d/e' \"\n-\tgit cat-file commit refs/remotes/e | \\\n-\t   grep '^git-svn-id: $e_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/e >actual &&\n+\tgrep '^git-svn-id: $e_url@1 $uuid$' actual\n \t\"\n \n dir_url=http://mayonaise/svnrepo/dir\n test_expect_success 'verify metadata for /dir' \"\n-\tgit cat-file commit refs/remotes/dir | \\\n-\t   grep '^git-svn-id: $dir_url@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/dir~1 | \\\n-\t   grep '^git-svn-id: $dir_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/dir >actual &&\n+\tgrep '^git-svn-id: $dir_url@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/dir~1 >actual &&\n+\tgrep '^git-svn-id: $dir_url@1 $uuid$' actual\n \t\"\n \n test_expect_success 'find commit based on SVN revision number' \"\n-        git svn find-rev r12 |\n-\t    grep $(git rev-parse HEAD)\n-        \"\n+\tgit svn find-rev r12 >actual &&\n+\tgrep $(git rev-parse HEAD) actual\n+\t\"\n \n test_expect_success 'empty rebase' \"\n \tgit svn rebase\ndiff --git a/t/t9111-git-svn-use-svnsync-props.sh b/t/t9111-git-svn-use-svnsync-props.sh\nindex 22b6e5ee7..a4225c9f6 100755\n--- a/t/t9111-git-svn-use-svnsync-props.sh\n+++ b/t/t9111-git-svn-use-svnsync-props.sh\n@@ -20,32 +20,32 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89\n \n bar_url=http://mayonaise/svnrepo/bar\n test_expect_success 'verify metadata for /bar' \"\n-\tgit cat-file commit refs/remotes/bar | \\\n-\t   grep '^git-svn-id: $bar_url@12 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~1 | \\\n-\t   grep '^git-svn-id: $bar_url@11 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~2 | \\\n-\t   grep '^git-svn-id: $bar_url@10 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~3 | \\\n-\t   grep '^git-svn-id: $bar_url@9 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~4 | \\\n-\t   grep '^git-svn-id: $bar_url@6 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~5 | \\\n-\t   grep '^git-svn-id: $bar_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/bar >actual &&\n+\tgrep '^git-svn-id: $bar_url@12 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~1 >actual1 &&\n+\tgrep '^git-svn-id: $bar_url@11 $uuid$' actual1 &&\n+\tgit cat-file commit refs/remotes/bar~2 >actual2 &&\n+\tgrep '^git-svn-id: $bar_url@10 $uuid$' actual2 &&\n+\tgit cat-file commit refs/remotes/bar~3 >actual3 &&\n+\tgrep '^git-svn-id: $bar_url@9 $uuid$' actual3 &&\n+\tgit cat-file commit refs/remotes/bar~4 >actual4 &&\n+\tgrep '^git-svn-id: $bar_url@6 $uuid$' actual4 &&\n+\tgit cat-file commit refs/remotes/bar~5 >actual5 &&\n+\tgrep '^git-svn-id: $bar_url@1 $uuid$' actual5\n \t\"\n \n e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e\n test_expect_success 'verify metadata for /dir/a/b/c/d/e' \"\n-\tgit cat-file commit refs/remotes/e | \\\n-\t   grep '^git-svn-id: $e_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/e >actual &&\n+\tgrep '^git-svn-id: $e_url@1 $uuid$' actual\n \t\"\n \n dir_url=http://mayonaise/svnrepo/dir\n test_expect_success 'verify metadata for /dir' \"\n-\tgit cat-file commit refs/remotes/dir | \\\n-\t   grep '^git-svn-id: $dir_url@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/dir~1 | \\\n-\t   grep '^git-svn-id: $dir_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/dir >actual &&\n+\tgrep '^git-svn-id: $dir_url@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/dir~1 >actual1 &&\n+\tgrep '^git-svn-id: $dir_url@1 $uuid$' actual1\n \t\"\n \n test_done\ndiff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh\nindex 50bca62de..32317d6bc 100755\n--- a/t/t9114-git-svn-dcommit-merge.sh\n+++ b/t/t9114-git-svn-dcommit-merge.sh\n@@ -68,7 +68,8 @@ test_debug 'gitk --all & sleep 1'\n test_expect_success 'verify pre-merge ancestry' \"\n \ttest x\\$(git rev-parse --verify refs/heads/svn^2) = \\\n \t     x\\$(git rev-parse --verify refs/heads/merge) &&\n-\tgit cat-file commit refs/heads/svn^ | grep '^friend$'\n+\tgit cat-file commit refs/heads/svn^ >actual &&\n+\tgrep '^friend$' actual\n \t\"\n \n test_expect_success 'git svn dcommit merges' \"\n@@ -82,12 +83,13 @@ test_expect_success 'verify post-merge ancestry' \"\n \t     x\\$(git rev-parse --verify refs/remotes/origin/trunk) &&\n \ttest x\\$(git rev-parse --verify refs/heads/svn^2) = \\\n \t     x\\$(git rev-parse --verify refs/heads/merge) &&\n-\tgit cat-file commit refs/heads/svn^ | grep '^friend$'\n+\tgit cat-file commit refs/heads/svn^ >actual &&\n+\tgrep '^friend$' actual\n \t\"\n \n test_expect_success 'verify merge commit message' \"\n-\tgit rev-list --pretty=raw -1 refs/heads/svn | \\\n-\t  grep \\\"    Merge branch 'merge' into svn\\\"\n+\tgit rev-list --pretty=raw -1 refs/heads/svn >actual &&\n+\tgrep \\\"    Merge branch 'merge' into svn\\\" actual\n \t\"\n \n test_done\ndiff --git a/t/t9130-git-svn-authors-file.sh b/t/t9130-git-svn-authors-file.sh\nindex 41264818c..7752a1fae 100755\n--- a/t/t9130-git-svn-authors-file.sh\n+++ b/t/t9130-git-svn-authors-file.sh\n@@ -26,11 +26,12 @@ test_expect_success 'start import with incomplete authors file' '\n test_expect_success 'imported 2 revisions successfully' '\n \t(\n \t\tcd x\n-\t\ttest \"$(git rev-list refs/remotes/git-svn | wc -l)\" -eq 2 &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author BBBBBBB BBBBBBB <bb@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author AAAAAAA AAAAAAA <aa@example\\.com> \"\n+\t\tgit rev-list refs/remotes/git-svn >actual &&\n+\t\ttest_line_count = 2 actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author BBBBBBB BBBBBBB <bb@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&\n+\t\tgrep \"^author AAAAAAA AAAAAAA <aa@example\\.com> \" actual\n \t)\n \t'\n \n@@ -43,11 +44,12 @@ test_expect_success 'continues to import once authors have been added' '\n \t(\n \t\tcd x\n \t\tgit svn fetch --authors-file=../svn-authors &&\n-\t\ttest \"$(git rev-list refs/remotes/git-svn | wc -l)\" -eq 4 &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author DDDDDDD DDDDDDD <dd@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author CCCCCCC CCCCCCC <cc@example\\.com> \"\n+\t\tgit rev-list refs/remotes/git-svn >actual &&\n+\t\ttest_line_count = 4 actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author DDDDDDD DDDDDDD <dd@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&\n+\t\tgrep \"^author CCCCCCC CCCCCCC <cc@example\\.com> \" actual\n \t)\n \t'\n \n@@ -102,8 +104,10 @@ test_expect_success !MINGW 'fresh clone with svn.authors-file in config' '\n \t\ttest x\"$HOME\"/svn-authors = x\"$(git config svn.authorsfile)\" &&\n \t\tgit svn clone \"$svnrepo\" gitconfig.clone &&\n \t\tcd gitconfig.clone &&\n-\t\tnr_ex=$(git log | grep \"^Author:.*example.com\" | wc -l) &&\n-\t\tnr_rev=$(git rev-list HEAD | wc -l) &&\n+\t\tgit log >actual &&\n+\t\tnr_ex=$(grep \"^Author:.*example.com\" actual | wc -l) &&\n+\t\tgit rev-list HEAD >actual &&\n+\t\tnr_rev=$(wc -l <actual) &&\n \t\ttest $nr_rev -eq $nr_ex\n \t)\n '\ndiff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh\nindex 7d7e9d46b..f684f5578 100755\n--- a/t/t9138-git-svn-authors-prog.sh\n+++ b/t/t9138-git-svn-authors-prog.sh\n@@ -37,31 +37,32 @@ test_expect_success 'import authors with prog and file' '\n test_expect_success 'imported 6 revisions successfully' '\n \t(\n \t\tcd x\n-\t\ttest \"$(git rev-list refs/remotes/git-svn | wc -l)\" -eq 6\n+\t\tgit rev-list refs/remotes/git-svn >actual &&\n+\t\ttest_line_count = 6 actual\n \t)\n '\n \n test_expect_success 'authors-prog ran correctly' '\n \t(\n \t\tcd x\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author ee-foo <ee-foo@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~2 | \\\n-\t\t  grep \"^author dd <dd@sub\\.example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~3 | \\\n-\t\t  grep \"^author cc <cc@sub\\.example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~4 | \\\n-\t\t  grep \"^author bb <bb@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~5 | \\\n-\t\t  grep \"^author aa <aa@example\\.com> \"\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&\n+\t\tgrep \"^author ee-foo <ee-foo@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~2 >actual2 &&\n+\t\tgrep \"^author dd <dd@sub\\.example\\.com> \" actual2 &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~3 >actual3 &&\n+\t\tgrep \"^author cc <cc@sub\\.example\\.com> \" actual3 &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~4 >actual4 &&\n+\t\tgrep \"^author bb <bb@example\\.com> \" actual4 &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~5 >actual5 &&\n+\t\tgrep \"^author aa <aa@example\\.com> \" actual5\n \t)\n '\n \n test_expect_success 'authors-file overrode authors-prog' '\n \t(\n \t\tcd x\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author FFFFFFF FFFFFFF <fFf@other\\.example\\.com> \"\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author FFFFFFF FFFFFFF <fFf@other\\.example\\.com> \" actual\n \t)\n '\n \n@@ -73,8 +74,8 @@ test_expect_success 'authors-prog handled special characters in username' '\n \t(\n \t\tcd x &&\n \t\tgit svn --authors-prog=../svn-authors-prog fetch &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn |\n-\t\tgrep \"^author xyz; touch evil <xyz; touch evil@example\\.com> \" &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author xyz; touch evil <xyz; touch evil@example\\.com> \" actual &&\n \t\t! test -f evil\n \t)\n '\ndiff --git a/t/t9153-git-svn-rewrite-uuid.sh b/t/t9153-git-svn-rewrite-uuid.sh\nindex 372ef1568..6cd28bb9a 100755\n--- a/t/t9153-git-svn-rewrite-uuid.sh\n+++ b/t/t9153-git-svn-rewrite-uuid.sh\n@@ -16,10 +16,10 @@ test_expect_success 'load svn repo' \"\n \t\"\n \n test_expect_success 'verify uuid' \"\n-\tgit cat-file commit refs/remotes/git-svn~0 | \\\n-\t   grep '^git-svn-id: .*@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/git-svn~1 | \\\n-\t   grep '^git-svn-id: .*@1 $uuid$'\n+\tgit cat-file commit refs/remotes/git-svn~0 >actual &&\n+\tgrep '^git-svn-id: .*@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/git-svn~1 >actual1 &&\n+\tgrep '^git-svn-id: .*@1 $uuid$' actual1\n \t\"\n \n test_done\ndiff --git a/t/t9168-git-svn-partially-globbed-names.sh b/t/t9168-git-svn-partially-globbed-names.sh\nindex 8b22f2272..df6f3a974 100755\n--- a/t/t9168-git-svn-partially-globbed-names.sh\n+++ b/t/t9168-git-svn-partially-globbed-names.sh\n@@ -48,8 +48,8 @@ test_expect_success 'test refspec prefixed globbing' '\n \tgit config --add svn-remote.svn.tags\\\n \t\t\t \"tags/t_*/src/a:refs/remotes/tags/t_*\" &&\n \tgit svn multi-fetch &&\n-\tgit log --pretty=oneline refs/remotes/tags/t_end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.end &&\n+\tgit log --pretty=oneline refs/remotes/tags/t_end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.end &&\n \ttest_cmp expect.end output.end &&\n \ttest \"$(git rev-parse refs/remotes/tags/t_end~1)\" = \\\n \t\t\"$(git rev-parse refs/remotes/branches/b_start)\" &&\n@@ -78,14 +78,16 @@ test_expect_success 'test left-hand-side only prefixed globbing' '\n \t\tsvn_cmd commit -m \"try to try\"\n \t) &&\n \tgit svn fetch two &&\n-\ttest $(git rev-list refs/remotes/two/tags/t_end | wc -l) -eq 6 &&\n-\ttest $(git rev-list refs/remotes/two/branches/b_start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/two/tags/t_end >actual &&\n+\ttest_line_count = 6 actual &&\n+\tgit rev-list refs/remotes/two/branches/b_start >actual2 &&\n+\ttest_line_count = 3 actual2 &&\n \ttest $(git rev-parse refs/remotes/two/branches/b_start~2) = \\\n \t     $(git rev-parse refs/remotes/two/trunk) &&\n \ttest $(git rev-parse refs/remotes/two/tags/t_end~3) = \\\n \t     $(git rev-parse refs/remotes/two/branches/b_start) &&\n-\tgit log --pretty=oneline refs/remotes/two/tags/t_end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.two &&\n+\tgit log --pretty=oneline refs/remotes/two/tags/t_end >actual3 &&\n+\tsed -e \"s/^.\\{41\\}//\" actual3 >output.two &&\n \ttest_cmp expect.two output.two\n \t'\n \n@@ -118,14 +120,16 @@ test_expect_success 'test prefixed globs match just prefix' '\n \t\tsvn_cmd up\n \t) &&\n \tgit svn fetch three &&\n-\ttest $(git rev-list refs/remotes/three/branches/b_ | wc -l) -eq 2 &&\n-\ttest $(git rev-list refs/remotes/three/tags/t_ | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/three/branches/b_ >actual &&\n+\ttest_line_count = 2 actual &&\n+\tgit rev-list refs/remotes/three/tags/t_ >actual2 &&\n+\ttest_line_count = 3 actual2 &&\n \ttest $(git rev-parse refs/remotes/three/branches/b_~1) = \\\n \t     $(git rev-parse refs/remotes/three/trunk) &&\n \ttest $(git rev-parse refs/remotes/three/tags/t_~1) = \\\n \t     $(git rev-parse refs/remotes/three/branches/b_) &&\n-\tgit log --pretty=oneline refs/remotes/three/tags/t_ | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.three &&\n+\tgit log --pretty=oneline refs/remotes/three/tags/t_ >actual3 &&\n+\tsed -e \"s/^.\\{41\\}//\" actual3 >output.three &&\n \ttest_cmp expect.three output.three\n \t'\n \n@@ -186,14 +190,16 @@ test_expect_success 'test globbing in the middle of the word' '\n \t\tsvn_cmd up\n \t) &&\n \tgit svn fetch five &&\n-\ttest $(git rev-list refs/remotes/five/branches/abcde | wc -l) -eq 2 &&\n-\ttest $(git rev-list refs/remotes/five/tags/fghij | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/five/branches/abcde >actual &&\n+\ttest_line_count = 2 actual &&\n+\tgit rev-list refs/remotes/five/tags/fghij >actual2 &&\n+\ttest_line_count = 3 actual2 &&\n \ttest $(git rev-parse refs/remotes/five/branches/abcde~1) = \\\n \t     $(git rev-parse refs/remotes/five/trunk) &&\n \ttest $(git rev-parse refs/remotes/five/tags/fghij~1) = \\\n \t     $(git rev-parse refs/remotes/five/branches/abcde) &&\n-\tgit log --pretty=oneline refs/remotes/five/tags/fghij | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.five &&\n+\tgit log --pretty=oneline refs/remotes/five/tags/fghij >actual3 &&\n+\tsed -e \"s/^.\\{41\\}//\" actual3 >output.five &&\n \ttest_cmp expect.five output.five\n \t'\n \ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex 866ddf605..116b4e5f8 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -43,20 +43,20 @@ test_expect_success 'fast-export | fast-import' '\n \tMUSS=$(git rev-parse --verify muss) &&\n \tmkdir new &&\n \tgit --git-dir=new/.git init &&\n-\tgit fast-export --all |\n+\tgit fast-export --all >actual &&\n \t(cd new &&\n \t git fast-import &&\n \t test $MASTER = $(git rev-parse --verify refs/heads/master) &&\n \t test $REIN = $(git rev-parse --verify refs/tags/rein) &&\n \t test $WER = $(git rev-parse --verify refs/heads/wer) &&\n-\t test $MUSS = $(git rev-parse --verify refs/tags/muss))\n+\t test $MUSS = $(git rev-parse --verify refs/tags/muss)) <actual\n \n '\n \n test_expect_success 'fast-export master~2..master' '\n \n-\tgit fast-export master~2..master |\n-\t\tsed \"s/master/partial/\" |\n+\tgit fast-export master~2..master >actual &&\n+\tsed \"s/master/partial/\" actual |\n \t\t(cd new &&\n \t\t git fast-import &&\n \t\t test $MASTER != $(git rev-parse --verify refs/heads/partial) &&\n@@ -74,11 +74,12 @@ test_expect_success 'iso-8859-1' '\n \ttest_tick &&\n \techo rosten >file &&\n \tgit commit -s -m den file &&\n-\tgit fast-export wer^..wer |\n-\t\tsed \"s/wer/i18n/\" |\n-\t\t(cd new &&\n-\t\t git fast-import &&\n-\t\t git cat-file commit i18n | grep \"Áéí óú\")\n+\tgit fast-export wer^..wer >actual &&\n+\tsed \"s/wer/i18n/\" actual |\n+\t    (cd new &&\n+\t\tgit fast-import &&\n+\t\tgit cat-file commit i18n >actual &&\n+\t\tgrep \"Áéí óú\" actual)\n \n '\n test_expect_success 'import/export-marks' '\n@@ -87,18 +88,18 @@ test_expect_success 'import/export-marks' '\n \tgit fast-export --export-marks=tmp-marks HEAD &&\n \ttest -s tmp-marks &&\n \ttest_line_count = 3 tmp-marks &&\n+\tgit fast-export --import-marks=tmp-marks \\\n+\t\t--export-marks=tmp-marks HEAD >actual &&\n \ttest $(\n-\t\tgit fast-export --import-marks=tmp-marks\\\n-\t\t--export-marks=tmp-marks HEAD |\n-\t\tgrep ^commit |\n+\t\tgrep ^commit actual |\n \t\twc -l) \\\n \t-eq 0 &&\n \techo change > file &&\n \tgit commit -m \"last commit\" file &&\n+\tgit fast-export --import-marks=tmp-marks \\\n+\t\t--export-marks=tmp-marks HEAD >actual2 &&\n \ttest $(\n-\t\tgit fast-export --import-marks=tmp-marks \\\n-\t\t--export-marks=tmp-marks HEAD |\n-\t\tgrep ^commit\\  |\n+\t\tgrep ^commit\\  actual2 |\n \t\twc -l) \\\n \t-eq 1 &&\n \ttest_line_count = 4 tmp-marks\n@@ -184,7 +185,7 @@ test_expect_success 'submodule fast-export | fast-import' '\n \trm -rf new &&\n \tmkdir new &&\n \tgit --git-dir=new/.git init &&\n-\tgit fast-export --signed-tags=strip --all |\n+\tgit fast-export --signed-tags=strip --all >actual &&\n \t(cd new &&\n \t git fast-import &&\n \t test \"$SUBENT1\" = \"$(git ls-tree refs/heads/master^ sub)\" &&\n@@ -192,7 +193,7 @@ test_expect_success 'submodule fast-export | fast-import' '\n \t git checkout master &&\n \t git submodule init &&\n \t git submodule update &&\n-\t cmp sub/file ../sub/file)\n+\t cmp sub/file ../sub/file) <actual\n \n '\n \n@@ -361,18 +362,20 @@ test_expect_failure 'no exact-ref revisions included' '\n \t)\n '\n \n-test_expect_success 'path limiting with import-marks does not lose unmodified files'        '\n+test_expect_success 'path limiting with import-marks does not lose unmodified files'\t     '\n \tgit checkout -b simple marks~2 &&\n \tgit fast-export --export-marks=marks simple -- file > /dev/null &&\n \techo more content >> file &&\n \ttest_tick &&\n \tgit commit -mnext file &&\n-\tgit fast-export --import-marks=marks simple -- file file0 | grep file0\n+\tgit fast-export --import-marks=marks simple -- file file0 >actual &&\n+\tgrep file0 actual\n '\n \n-test_expect_success 'full-tree re-shows unmodified files'        '\n+test_expect_success 'full-tree re-shows unmodified files'\t  '\n \tgit checkout -f simple &&\n-\ttest $(git fast-export --full-tree simple | grep -c file0) -eq 3\n+\tgit fast-export --full-tree simple >actual &&\n+\ttest $(grep -c file0 actual) -eq 3\n '\n \n test_expect_success 'set-up a few more tags for tag export tests' '\n@@ -500,13 +503,13 @@ test_expect_success 'refs are updated even if no commits need to be exported' '\n \tgit fast-export --import-marks=tmp-marks \\\n \t\t--export-marks=tmp-marks master > /dev/null &&\n \tgit fast-export --import-marks=tmp-marks \\\n-\t\t--export-marks=tmp-marks master > actual &&\n+\t\t--export-marks=tmp-marks master >actual &&\n \ttest_cmp expected actual\n '\n \n test_expect_success 'use refspec' '\n-\tgit fast-export --refspec refs/heads/master:refs/heads/foobar master | \\\n-\t\tgrep \"^commit \" | sort | uniq > actual &&\n+\tgit fast-export --refspec refs/heads/master:refs/heads/foobar master >actual2 &&\n+\tgrep \"^commit \" actual2 | sort | uniq >actual &&\n \techo \"commit refs/heads/foobar\" > expected &&\n \ttest_cmp expected actual\n '\n@@ -534,7 +537,8 @@ test_expect_success 'when using -C, do not declare copy when source of copy is a\n \tgit -C src commit -m 2nd_commit &&\n \n \ttest_create_repo dst &&\n-\tgit -C src fast-export --all -C | git -C dst fast-import &&\n+\tgit -C src fast-export --all -C >actual &&\n+\tgit -C dst fast-import <actual &&\n \tgit -C src show >expected &&\n \tgit -C dst show >actual &&\n \ttest_cmp expected actual\n-- \n2.16.2\n\n"},{"id":"342431","messageId":"xmqqo9jhpadh.fsf@gitster-ct.c.googlers.com","threadId":"48036","inReplyTo":"20180321152356.10754-1-predatoramigo@gmail.com","subject":"Re: [GSoC][PATCH v3] test: avoid pipes in git related commands for test","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-03-21T18:11:06Z","receivedAt":"2018-03-21T18:11:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pratik Karki <predatoramigo@gmail.com> writes:\n\n> Thank you Eric, for the review. This is follow on patch[1].\n>\n> The changes in patch increased from v1 to v2 because I\n> got excited to work in Git codebase and I tried to\n> fix the exisiting problems as much as possible.\n> Hence, the large number of changes.\n\nEric understands why the scope was increased between the two; he\nexplained why it is not a good idea to increase the scope in the\nmiddle, and I tend to agree with his reasoning.  The reason why the\nscope was increased does not matter.\n\n>>> @@ -120,18 +122,20 @@ test_expect_success 'test another branch' '\n>>>         git config --add svn-remote.four.url \"$svnrepo\" &&\n>>>         git config --add svn-remote.four.fetch trunk:refs/remotes/four/trunk &&\n>>>         git config --add svn-remote.four.branches \\\n>>> -                        \"branches/*/*:refs/remotes/four/branches/*/*\" &&\n>>> +                        \"branches/*/*:refs/remotes/four/branches/*/*\" &&\n>>>         git config --add svn-remote.four.tags \\\n>>> -                        \"tags/*:refs/remotes/four/tags/*\" &&\n>>> +                        \"tags/*:refs/remotes/four/tags/*\" &&\n>\n>>I guess you sneaked in a whitespace change here which is unrelated to\n>>the stated purpose of this patch, thus acted as a speed bump during\n>>review....\n>>Therefore, you should omit this change.\n>\n> I used tabify in Emacs and it must have messed up the whitespace\n> change.\n\nThen don't.  Make sure the lines _you_ change are indented and\nformatted correctly.  Do not touch near-by (or far-away for that\nmatter) lines that you do not have to touch only to change the\nformatting.\n\n> I read SubmittingPatches guideline[2] for git where it\n> is said that whitespace check must be done and git community is\n> picky about it and 'git diff --check' must be done before commit.\n\nYes.\n\n> If I change this change back to original the 'git diff --check'\n> reports whitespace identation with space.\n\nI do not think 'diff --check' would.  Save the patch you sent to a\nfile, edit it so that these two lines Eric pointed out are not\nchanged, and then apply it with \"git apply --whitespace=nowarn\".\nThen ask \"git diff --check\"---it should not complain about an\nexisting whitespace glitch that you did not introduce.\n\n> So, isn't this\n> supposedly a fix?\n\nUnless it is a \"here is a patch to reindent and fix whitespaces\"\npatch that does nothing else, it is an unwelcome noise that\ndistracts reviewers from the real changes.\n\n> ------------------------------------- >8----------------------------------------\n\nThis is not wrong per se, but just a\n\n-- >8 --\n\nis sufficient ;-)\n\n>\n>  Avoid using pipes downstream of Git commands since the exit\n>  codes of commands upstream of pipes get swallowed, thus potentially hiding\n>  failure of those commands. Instead, capture Git command output to a file and\n>  apply the downstream command(s) to that file.\n\nPlease do not indent the body of the log message by one space.\n\n> diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\n> index 9c68b9925..707208284 100755\n> --- a/t/t5300-pack-object.sh\n> +++ b/t/t5300-pack-object.sh\n> @@ -311,9 +311,9 @@ test_expect_success 'unpacking with --strict' '\n>  \trm -f .git/index &&\n>  \ttail -n 10 LIST | git update-index --index-info &&\n>  \tST=$(git write-tree) &&\n> -\tPACK5=$( git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" | \\\n> -\t\tgit pack-objects test-5 ) &&\n> -\tPACK6=$( (\n> +\tgit rev-list --objects \"$LIST\" \"$LI\" \"$ST\" >actual &&\n> +\tPACK5=$( git pack-objects test-5 <actual ) &&\n> +\tPACK6=$((\n\nI thought that Eric already pointed out and explained why this\nchange to PACK6 is wrong in the previous round?\n\n> diff --git a/t/t9111-git-svn-use-svnsync-props.sh b/t/t9111-git-svn-use-svnsync-props.sh\n> index 22b6e5ee7..a4225c9f6 100755\n> --- a/t/t9111-git-svn-use-svnsync-props.sh\n> +++ b/t/t9111-git-svn-use-svnsync-props.sh\n> @@ -20,32 +20,32 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89\n>  \n>  bar_url=http://mayonaise/svnrepo/bar\n>  test_expect_success 'verify metadata for /bar' \"\n> -\tgit cat-file commit refs/remotes/bar | \\\n> -\t   grep '^git-svn-id: $bar_url@12 $uuid$' &&\n> -\tgit cat-file commit refs/remotes/bar~1 | \\\n> -\t   grep '^git-svn-id: $bar_url@11 $uuid$' &&\n> -\tgit cat-file commit refs/remotes/bar~2 | \\\n> -\t   grep '^git-svn-id: $bar_url@10 $uuid$' &&\n> -\tgit cat-file commit refs/remotes/bar~3 | \\\n> -\t   grep '^git-svn-id: $bar_url@9 $uuid$' &&\n> -\tgit cat-file commit refs/remotes/bar~4 | \\\n> -\t   grep '^git-svn-id: $bar_url@6 $uuid$' &&\n> -\tgit cat-file commit refs/remotes/bar~5 | \\\n> -\t   grep '^git-svn-id: $bar_url@1 $uuid$'\n> +\tgit cat-file commit refs/remotes/bar >actual &&\n> +\tgrep '^git-svn-id: $bar_url@12 $uuid$' actual &&\n> +\tgit cat-file commit refs/remotes/bar~1 >actual1 &&\n> +\tgrep '^git-svn-id: $bar_url@11 $uuid$' actual1 &&\n> +\tgit cat-file commit refs/remotes/bar~2 >actual2 &&\n> +\tgrep '^git-svn-id: $bar_url@10 $uuid$' actual2 &&\n> +\tgit cat-file commit refs/remotes/bar~3 >actual3 &&\n> +\tgrep '^git-svn-id: $bar_url@9 $uuid$' actual3 &&\n> +\tgit cat-file commit refs/remotes/bar~4 >actual4 &&\n> +\tgrep '^git-svn-id: $bar_url@6 $uuid$' actual4 &&\n> +\tgit cat-file commit refs/remotes/bar~5 >actual5 &&\n> +\tgrep '^git-svn-id: $bar_url@1 $uuid$' actual5\n>  \t\"\n\nI also thought that Eric already pointed out that the above is not a\ngood idea because it forces readers to wonder if \"actual[1-5]\" need\nto exist together with \"actual\" at the same time in the previous\nround?\n\n"},{"id":"342440","messageId":"CAPig+cQ1KSL8LreoE7waBzqz2V1N0rwLujDCM82nqTdgF=MC3g@mail.gmail.com","threadId":"48036","inReplyTo":"xmqqo9jhpadh.fsf@gitster-ct.c.googlers.com","subject":"Re: [GSoC][PATCH v3] test: avoid pipes in git related commands for test","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-03-21T18:45:06Z","receivedAt":"2018-03-21T18:45:12Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Mar 21, 2018 at 2:11 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Pratik Karki <predatoramigo@gmail.com> writes:\n>> The changes in patch increased from v1 to v2 because I\n>> got excited to work in Git codebase and I tried to\n>> fix the exisiting problems as much as possible.\n>> Hence, the large number of changes.\n>\n> Eric understands why the scope was increased between the two; he\n> explained why it is not a good idea to increase the scope in the\n> middle, and I tend to agree with his reasoning.  The reason why the\n> scope was increased does not matter.\n\nThanks, Junio. I had just started writing a review of v3 when your\nreview arrived, and you covered every point I was going to make, thus\nsaved me the effort. I agree with everything in your review.\n\nOne additional comment, Pratik, is that this patch seems to be based\nupon a slightly old version of the Git source code, thus does not\napply cleanly to present-day 'master'. Before re-rolling, update to\nthe latest Git and rebase your patch atop it.\n\n>> -     PACK5=$( git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" | \\\n>> -             git pack-objects test-5 ) &&\n>> -     PACK6=$( (\n>> +     git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" >actual &&\n>> +     PACK5=$( git pack-objects test-5 <actual ) &&\n>> +     PACK6=$((\n>\n> I thought that Eric already pointed out and explained why this\n> change to PACK6 is wrong in the previous round?\n\nI probably should have been more explicit by naming PACK6 directly.\nComparing v3 against v2, I see that Pratik probably misunderstood my\ncomment, thinking that I was talking about losing the whitespace\ninside PACK5=$(...); v2 dropped that whitespace and v3 restored it.\n\nPratik, dropping the unnecessary whitespace inside PACK5=$(...) is\nfine (no complaint about that), but changing PACK6=$( (...) ) to\nPACK6=$((...)) is outright incorrect as explained in [1].\n\n[1]: https://public-inbox.org/git/CAPig+cTKkp6kpFcJfVV8W1ejCrCWQH33mHtgFUn+MpMgw5i1pA@mail.gmail.com/\n"},{"id":"342441","messageId":"CAPig+cRnO6e5B=mYAfkt7bdgit2uOJk1a+CAahQ2+uRRbPAObQ@mail.gmail.com","threadId":"48036","inReplyTo":"xmqqo9jhpadh.fsf@gitster-ct.c.googlers.com","subject":"Re: [GSoC][PATCH v3] test: avoid pipes in git related commands for test","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-03-21T18:58:54Z","receivedAt":"2018-03-21T18:59:00Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Mar 21, 2018 at 2:11 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Pratik Karki <predatoramigo@gmail.com> writes:\n>>  Avoid using pipes downstream of Git commands since the exit\n>>  codes of commands upstream of pipes get swallowed, thus potentially hiding\n>>  failure of those commands. Instead, capture Git command output to a file and\n>>  apply the downstream command(s) to that file.\n>\n> Please do not indent the body of the log message by one space.\n\nOne other issue I forgot to mention is that the commit message in v3\nstarted getting too wide again[1]; it was fine in v2. Pratik, try to\nkeep the commit message wrapped to about 70-72 characters or so.\n\n[1]: https://public-inbox.org/git/CAPig+cRPzyw525ODC4=-E7w=zbpbhVN2eqxSYDSLij5wfW8S_A@mail.gmail.com/\n"},{"id":"342589","messageId":"20180323150150.31186-1-predatoramigo@gmail.com","threadId":"48036","inReplyTo":"CAPig+cRnO6e5B=mYAfkt7bdgit2uOJk1a+CAahQ2+uRRbPAObQ@mail.gmail.com","subject":"[GSoC][PATCH v4] test: avoid pipes in git related commands for test","fromName":"Pratik Karki","fromEmail":"predatoramigo@gmail.com","sentAt":"2018-03-23T15:01:50Z","receivedAt":"2018-03-23T15:02:26Z","isPatch":true,"sender":{"key":"predatoramigo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12194950?v=4"},"body":"Thank you Eric and Junio for the review.\n\nI hope this follow-on patch[1] is ready for merge.\n\n[1]: https://public-inbox.org/git/20180321152356.10754-1-predatoramigo@gmail.com/\n\n-- >8 --\n\nAvoid using pipes downstream of Git commands since the exit codes\nof commands upstream of pipes get swallowed, thus potentially\nhiding failure of those commands. Instead, capture Git command\noutput to a file and apply the downstream command(s) to that file.\n\nSigned-off-by: Pratik Karki <predatoramigo@gmail.com>\n---\n t/t5300-pack-object.sh                     |  8 ++---\n t/t5510-fetch.sh                           |  8 ++---\n t/t7001-mv.sh                              | 22 +++++++-------\n t/t7003-filter-branch.sh                   |  9 ++++--\n t/t9104-git-svn-follow-parent.sh           | 16 +++++-----\n t/t9108-git-svn-glob.sh                    | 14 +++++----\n t/t9109-git-svn-multi-glob.sh              | 24 ++++++++-------\n t/t9110-git-svn-use-svm-props.sh           | 40 ++++++++++++-------------\n t/t9111-git-svn-use-svnsync-props.sh       | 36 +++++++++++-----------\n t/t9114-git-svn-dcommit-merge.sh           | 10 ++++---\n t/t9130-git-svn-authors-file.sh            | 28 +++++++++--------\n t/t9138-git-svn-authors-prog.sh            | 31 +++++++++----------\n t/t9153-git-svn-rewrite-uuid.sh            |  8 ++---\n t/t9168-git-svn-partially-globbed-names.sh | 34 ++++++++++++---------\n t/t9350-fast-export.sh                     | 48 ++++++++++++++++--------------\n 15 files changed, 180 insertions(+), 156 deletions(-)\n\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex 9c68b9925..156beb2d5 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -311,8 +311,8 @@ test_expect_success 'unpacking with --strict' '\n \trm -f .git/index &&\n \ttail -n 10 LIST | git update-index --index-info &&\n \tST=$(git write-tree) &&\n-\tPACK5=$( git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" | \\\n-\t\tgit pack-objects test-5 ) &&\n+\tgit rev-list --objects \"$LIST\" \"$LI\" \"$ST\" >actual &&\n+\tPACK5=$( git pack-objects test-5 <actual ) &&\n \tPACK6=$( (\n \t\t\techo \"$LIST\"\n \t\t\techo \"$LI\"\n@@ -358,8 +358,8 @@ test_expect_success 'index-pack with --strict' '\n \trm -f .git/index &&\n \ttail -n 10 LIST | git update-index --index-info &&\n \tST=$(git write-tree) &&\n-\tPACK5=$( git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" | \\\n-\t\tgit pack-objects test-5 ) &&\n+\tgit rev-list --objects \"$LIST\" \"$LI\" \"$ST\" >actual &&\n+\tPACK5=$( git pack-objects test-5 <actual ) &&\n \tPACK6=$( (\n \t\t\techo \"$LIST\"\n \t\t\techo \"$LI\"\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex da9ac0055..f6d28ed7f 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -840,8 +840,8 @@ test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '\n \ttest_commit looooooooooooong-tag &&\n \t(\n \t\tcd full-output &&\n-\t\tgit -c fetch.output=full fetch origin 2>&1 | \\\n-\t\t\tgrep -e \"->\" | cut -c 22- >../actual\n+\t\tgit -c fetch.output=full fetch origin >actual2 2>&1 &&\n+\t\tgrep -e \"->\" actual2 | cut -c 22- >../actual\n \t) &&\n \tcat >expect <<-\\EOF &&\n \tmaster               -> origin/master\n@@ -855,8 +855,8 @@ test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '\n \ttest_commit extraaa &&\n \t(\n \t\tcd compact &&\n-\t\tgit -c fetch.output=compact fetch origin 2>&1 | \\\n-\t\t\tgrep -e \"->\" | cut -c 22- >../actual\n+\t\tgit -c fetch.output=compact fetch origin >actual2 2>&1 &&\n+\t\tgrep -e \"->\" actual2 | cut -c 22- >../actual\n \t) &&\n \tcat >expect <<-\\EOF &&\n \tmaster     -> origin/*\ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex d4e6485a2..e96cbdb10 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -21,8 +21,8 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-    grep \"^R100..*path0/COPYING..*path1/COPYING\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+    grep \"^R100..*path0/COPYING..*path1/COPYING\" actual'\n \n test_expect_success \\\n     'moving the file back into subdirectory' \\\n@@ -35,8 +35,8 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-    grep \"^R100..*path1/COPYING..*path0/COPYING\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+    grep \"^R100..*path1/COPYING..*path0/COPYING\" actual'\n \n test_expect_success \\\n     'mv --dry-run does not move file' \\\n@@ -122,10 +122,9 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path0/COPYING..*path2/COPYING\" &&\n-     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path0/README..*path2/README\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+     grep \"^R100..*path0/COPYING..*path2/COPYING\" actual &&\n+     grep \"^R100..*path0/README..*path2/README\" actual'\n \n test_expect_success \\\n     'succeed when source is a prefix of destination' \\\n@@ -141,10 +140,9 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path2/COPYING..*path1/path2/COPYING\" &&\n-     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path2/README..*path1/path2/README\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+     grep \"^R100..*path2/COPYING..*path1/path2/COPYING\" actual &&\n+     grep \"^R100..*path2/README..*path1/path2/README\" actual'\n \n test_expect_success \\\n     'do not move directory over existing directory' \\\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex 7cb60799b..6a28b6cce 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -187,7 +187,8 @@ test_expect_success 'author information is preserved' '\n \t\t\ttest \\$GIT_COMMIT != $(git rev-parse master) || \\\n \t\t\techo Hallo\" \\\n \t\tpreserved-author) &&\n-\ttest 1 = $(git rev-list --author=\"B V Uips\" preserved-author | wc -l)\n+\tgit rev-list --author=\"B V Uips\" preserved-author >actual &&\n+\ttest_line_count = 1 actual\n '\n \n test_expect_success \"remove a certain author's commits\" '\n@@ -205,7 +206,8 @@ test_expect_success \"remove a certain author's commits\" '\n \tcnt1=$(git rev-list master | wc -l) &&\n \tcnt2=$(git rev-list removed-author | wc -l) &&\n \ttest $cnt1 -eq $(($cnt2 + 1)) &&\n-\ttest 0 = $(git rev-list --author=\"B V Uips\" removed-author | wc -l)\n+\tgit rev-list --author=\"B V Uips\" removed-author >actual &&\n+\ttest_line_count = 0 actual\n '\n \n test_expect_success 'barf on invalid name' '\n@@ -258,7 +260,8 @@ test_expect_success 'Subdirectory filter with disappearing trees' '\n \tgit commit -m \"Re-adding foo\" &&\n \n \tgit filter-branch -f --subdirectory-filter foo &&\n-\ttest $(git rev-list master | wc -l) = 3\n+\tgit rev-list master >actual &&\n+\ttest_line_count = 3 actual\n '\n \n test_expect_success 'Tag name filtering retains tag message' '\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex cd480edf1..a735fa371 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -33,8 +33,8 @@ test_expect_success 'init and fetch a moved directory' '\n \tgit svn fetch -i thunk &&\n \ttest \"$(git rev-parse --verify refs/remotes/thunk@2)\" \\\n \t   = \"$(git rev-parse --verify refs/remotes/thunk~1)\" &&\n-\ttest \"$(git cat-file blob refs/remotes/thunk:readme |\\\n-\t\t sed -n -e \"3p\")\" = goodbye &&\n+\tgit cat-file blob refs/remotes/thunk:readme >actual &&\n+\ttest \"$(sed -n -e \"3p\" actual)\" = goodbye &&\n \ttest -z \"$(git config --get svn-remote.svn.fetch \\\n \t\t \"^trunk:refs/remotes/thunk@2$\")\"\n \t'\n@@ -48,8 +48,8 @@ test_expect_success 'init and fetch from one svn-remote' '\n         git svn fetch -i svn/thunk &&\n \ttest \"$(git rev-parse --verify refs/remotes/svn/trunk)\" \\\n \t   = \"$(git rev-parse --verify refs/remotes/svn/thunk~1)\" &&\n-\ttest \"$(git cat-file blob refs/remotes/svn/thunk:readme |\\\n-\t\t sed -n -e \"3p\")\" = goodbye\n+\tgit cat-file blob refs/remotes/svn/thunk:readme >actual &&\n+\ttest \"$(sed -n -e \"3p\" actual)\" = goodbye\n         '\n \n test_expect_success 'follow deleted parent' '\n@@ -107,7 +107,8 @@ test_expect_success 'follow deleted directory' '\n \tgit svn init --minimize-url -i glob \"$svnrepo\"/glob &&\n \tgit svn fetch -i glob &&\n \ttest \"$(git cat-file blob refs/remotes/glob:blob/bye)\" = hi &&\n-\ttest \"$(git ls-tree refs/remotes/glob | wc -l )\" -eq 1\n+\tgit ls-tree refs/remotes/glob >actual &&\n+\ttest_line_count = 1 actual\n \t'\n \n # ref: r9270 of the Subversion repository: (http://svn.collab.net/repos/svn)\n@@ -204,8 +205,9 @@ test_expect_success \"follow-parent is atomic\" '\n test_expect_success \"track multi-parent paths\" '\n \tsvn_cmd cp -m \"resurrect /glob\" \"$svnrepo\"/r9270 \"$svnrepo\"/glob &&\n \tgit svn multi-fetch &&\n-\ttest $(git cat-file commit refs/remotes/glob | \\\n-\t       grep \"^parent \" | wc -l) -eq 2\n+\tgit cat-file commit refs/remotes/glob >actual &&\n+\tgrep \"^parent \" actual >actual2 &&\n+\ttest_line_count = 2 actual2\n \t'\n \n test_expect_success \"multi-fetch continues to work\" \"\ndiff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh\nindex a94286c8e..6990f6436 100755\n--- a/t/t9108-git-svn-glob.sh\n+++ b/t/t9108-git-svn-glob.sh\n@@ -47,8 +47,8 @@ test_expect_success 'test refspec globbing' '\n \tgit config --add svn-remote.svn.tags\\\n \t                 \"tags/*/src/a:refs/remotes/tags/*\" &&\n \tgit svn multi-fetch &&\n-\tgit log --pretty=oneline refs/remotes/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.end &&\n+\tgit log --pretty=oneline refs/remotes/tags/end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.end &&\n \ttest_cmp expect.end output.end &&\n \ttest \"$(git rev-parse refs/remotes/tags/end~1)\" = \\\n \t\t\"$(git rev-parse refs/remotes/branches/start)\" &&\n@@ -75,14 +75,16 @@ test_expect_success 'test left-hand-side only globbing' '\n \t\tsvn_cmd commit -m \"try to try\"\n \t) &&\n \tgit svn fetch two &&\n-\ttest $(git rev-list refs/remotes/two/tags/end | wc -l) -eq 6 &&\n-\ttest $(git rev-list refs/remotes/two/branches/start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/two/tags/end >actual &&\n+\ttest_line_count = 6 actual &&\n+\tgit rev-list refs/remotes/two/branches/start >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/two/branches/start~2) = \\\n \t     $(git rev-parse refs/remotes/two/trunk) &&\n \ttest $(git rev-parse refs/remotes/two/tags/end~3) = \\\n \t     $(git rev-parse refs/remotes/two/branches/start) &&\n-\tgit log --pretty=oneline refs/remotes/two/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.two &&\n+\tgit log --pretty=oneline refs/remotes/two/tags/end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.two &&\n \ttest_cmp expect.two output.two\n \t'\n \ndiff --git a/t/t9109-git-svn-multi-glob.sh b/t/t9109-git-svn-multi-glob.sh\nindex 8d99e848d..c1e7542a3 100755\n--- a/t/t9109-git-svn-multi-glob.sh\n+++ b/t/t9109-git-svn-multi-glob.sh\n@@ -47,8 +47,8 @@ test_expect_success 'test refspec globbing' '\n \tgit config --add svn-remote.svn.tags\\\n \t                 \"tags/*/src/a:refs/remotes/tags/*\" &&\n \tgit svn multi-fetch &&\n-\tgit log --pretty=oneline refs/remotes/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.end &&\n+\tgit log --pretty=oneline refs/remotes/tags/end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.end &&\n \ttest_cmp expect.end output.end &&\n \ttest \"$(git rev-parse refs/remotes/tags/end~1)\" = \\\n \t\t\"$(git rev-parse refs/remotes/branches/v1/start)\" &&\n@@ -75,14 +75,16 @@ test_expect_success 'test left-hand-side only globbing' '\n \t\tsvn_cmd commit -m \"try to try\"\n \t) &&\n \tgit svn fetch two &&\n-\ttest $(git rev-list refs/remotes/two/tags/end | wc -l) -eq 6 &&\n-\ttest $(git rev-list refs/remotes/two/branches/v1/start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/two/tags/end >actual &&\n+\ttest_line_count = 6 actual &&\n+\tgit rev-list refs/remotes/two/branches/v1/start >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/two/branches/v1/start~2) = \\\n \t     $(git rev-parse refs/remotes/two/trunk) &&\n \ttest $(git rev-parse refs/remotes/two/tags/end~3) = \\\n \t     $(git rev-parse refs/remotes/two/branches/v1/start) &&\n-\tgit log --pretty=oneline refs/remotes/two/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.two &&\n+\tgit log --pretty=oneline refs/remotes/two/tags/end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.two &&\n \ttest_cmp expect.two output.two\n \t'\n cat > expect.four <<EOF\n@@ -124,14 +126,16 @@ test_expect_success 'test another branch' '\n \tgit config --add svn-remote.four.tags \\\n \t                 \"tags/*:refs/remotes/four/tags/*\" &&\n \tgit svn fetch four &&\n-\ttest $(git rev-list refs/remotes/four/tags/next | wc -l) -eq 5 &&\n-\ttest $(git rev-list refs/remotes/four/branches/v2/start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/four/tags/next >actual &&\n+\ttest_line_count = 5 actual &&\n+\tgit rev-list refs/remotes/four/branches/v2/start >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/four/branches/v2/start~2) = \\\n \t     $(git rev-parse refs/remotes/four/trunk) &&\n \ttest $(git rev-parse refs/remotes/four/tags/next~2) = \\\n \t     $(git rev-parse refs/remotes/four/branches/v2/start) &&\n-\tgit log --pretty=oneline refs/remotes/four/tags/next | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.four &&\n+\tgit log --pretty=oneline refs/remotes/four/tags/next >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.four &&\n \ttest_cmp expect.four output.four\n \t'\n \ndiff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh\nindex dde0a3c22..ad37d980c 100755\n--- a/t/t9110-git-svn-use-svm-props.sh\n+++ b/t/t9110-git-svn-use-svm-props.sh\n@@ -21,37 +21,37 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89\n \n bar_url=http://mayonaise/svnrepo/bar\n test_expect_success 'verify metadata for /bar' \"\n-\tgit cat-file commit refs/remotes/bar | \\\n-\t   grep '^git-svn-id: $bar_url@12 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~1 | \\\n-\t   grep '^git-svn-id: $bar_url@11 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~2 | \\\n-\t   grep '^git-svn-id: $bar_url@10 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~3 | \\\n-\t   grep '^git-svn-id: $bar_url@9 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~4 | \\\n-\t   grep '^git-svn-id: $bar_url@6 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~5 | \\\n-\t   grep '^git-svn-id: $bar_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/bar >actual &&\n+\tgrep '^git-svn-id: $bar_url@12 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~1 >actual &&\n+\tgrep '^git-svn-id: $bar_url@11 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~2 >actual &&\n+\tgrep '^git-svn-id: $bar_url@10 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~3 >actual &&\n+\tgrep '^git-svn-id: $bar_url@9 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~4 >actual &&\n+\tgrep '^git-svn-id: $bar_url@6 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~5 >actual &&\n+\tgrep '^git-svn-id: $bar_url@1 $uuid$' actual\n \t\"\n \n e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e\n test_expect_success 'verify metadata for /dir/a/b/c/d/e' \"\n-\tgit cat-file commit refs/remotes/e | \\\n-\t   grep '^git-svn-id: $e_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/e >actual &&\n+\tgrep '^git-svn-id: $e_url@1 $uuid$' actual\n \t\"\n \n dir_url=http://mayonaise/svnrepo/dir\n test_expect_success 'verify metadata for /dir' \"\n-\tgit cat-file commit refs/remotes/dir | \\\n-\t   grep '^git-svn-id: $dir_url@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/dir~1 | \\\n-\t   grep '^git-svn-id: $dir_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/dir >actual &&\n+\tgrep '^git-svn-id: $dir_url@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/dir~1 >actual &&\n+\tgrep '^git-svn-id: $dir_url@1 $uuid$' actual\n \t\"\n \n test_expect_success 'find commit based on SVN revision number' \"\n-        git svn find-rev r12 |\n-\t    grep $(git rev-parse HEAD)\n+\tgit svn find-rev r12 >actual &&\n+\tgrep $(git rev-parse HEAD) actual\n         \"\n \n test_expect_success 'empty rebase' \"\ndiff --git a/t/t9111-git-svn-use-svnsync-props.sh b/t/t9111-git-svn-use-svnsync-props.sh\nindex 22b6e5ee7..6c9307355 100755\n--- a/t/t9111-git-svn-use-svnsync-props.sh\n+++ b/t/t9111-git-svn-use-svnsync-props.sh\n@@ -20,32 +20,32 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89\n \n bar_url=http://mayonaise/svnrepo/bar\n test_expect_success 'verify metadata for /bar' \"\n-\tgit cat-file commit refs/remotes/bar | \\\n-\t   grep '^git-svn-id: $bar_url@12 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~1 | \\\n-\t   grep '^git-svn-id: $bar_url@11 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~2 | \\\n-\t   grep '^git-svn-id: $bar_url@10 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~3 | \\\n-\t   grep '^git-svn-id: $bar_url@9 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~4 | \\\n-\t   grep '^git-svn-id: $bar_url@6 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~5 | \\\n-\t   grep '^git-svn-id: $bar_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/bar >actual &&\n+\tgrep '^git-svn-id: $bar_url@12 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~1 >actual &&\n+\tgrep '^git-svn-id: $bar_url@11 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~2 >actual &&\n+\tgrep '^git-svn-id: $bar_url@10 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~3 >actual &&\n+\tgrep '^git-svn-id: $bar_url@9 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~4 >actual &&\n+\tgrep '^git-svn-id: $bar_url@6 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~5 >actual &&\n+\tgrep '^git-svn-id: $bar_url@1 $uuid$' actual\n \t\"\n \n e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e\n test_expect_success 'verify metadata for /dir/a/b/c/d/e' \"\n-\tgit cat-file commit refs/remotes/e | \\\n-\t   grep '^git-svn-id: $e_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/e >actual &&\n+\tgrep '^git-svn-id: $e_url@1 $uuid$' actual\n \t\"\n \n dir_url=http://mayonaise/svnrepo/dir\n test_expect_success 'verify metadata for /dir' \"\n-\tgit cat-file commit refs/remotes/dir | \\\n-\t   grep '^git-svn-id: $dir_url@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/dir~1 | \\\n-\t   grep '^git-svn-id: $dir_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/dir >actual &&\n+\tgrep '^git-svn-id: $dir_url@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/dir~1 >actual &&\n+\tgrep '^git-svn-id: $dir_url@1 $uuid$' actual\n \t\"\n \n test_done\ndiff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh\nindex 50bca62de..32317d6bc 100755\n--- a/t/t9114-git-svn-dcommit-merge.sh\n+++ b/t/t9114-git-svn-dcommit-merge.sh\n@@ -68,7 +68,8 @@ test_debug 'gitk --all & sleep 1'\n test_expect_success 'verify pre-merge ancestry' \"\n \ttest x\\$(git rev-parse --verify refs/heads/svn^2) = \\\n \t     x\\$(git rev-parse --verify refs/heads/merge) &&\n-\tgit cat-file commit refs/heads/svn^ | grep '^friend$'\n+\tgit cat-file commit refs/heads/svn^ >actual &&\n+\tgrep '^friend$' actual\n \t\"\n \n test_expect_success 'git svn dcommit merges' \"\n@@ -82,12 +83,13 @@ test_expect_success 'verify post-merge ancestry' \"\n \t     x\\$(git rev-parse --verify refs/remotes/origin/trunk) &&\n \ttest x\\$(git rev-parse --verify refs/heads/svn^2) = \\\n \t     x\\$(git rev-parse --verify refs/heads/merge) &&\n-\tgit cat-file commit refs/heads/svn^ | grep '^friend$'\n+\tgit cat-file commit refs/heads/svn^ >actual &&\n+\tgrep '^friend$' actual\n \t\"\n \n test_expect_success 'verify merge commit message' \"\n-\tgit rev-list --pretty=raw -1 refs/heads/svn | \\\n-\t  grep \\\"    Merge branch 'merge' into svn\\\"\n+\tgit rev-list --pretty=raw -1 refs/heads/svn >actual &&\n+\tgrep \\\"    Merge branch 'merge' into svn\\\" actual\n \t\"\n \n test_done\ndiff --git a/t/t9130-git-svn-authors-file.sh b/t/t9130-git-svn-authors-file.sh\nindex 41264818c..7752a1fae 100755\n--- a/t/t9130-git-svn-authors-file.sh\n+++ b/t/t9130-git-svn-authors-file.sh\n@@ -26,11 +26,12 @@ test_expect_success 'start import with incomplete authors file' '\n test_expect_success 'imported 2 revisions successfully' '\n \t(\n \t\tcd x\n-\t\ttest \"$(git rev-list refs/remotes/git-svn | wc -l)\" -eq 2 &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author BBBBBBB BBBBBBB <bb@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author AAAAAAA AAAAAAA <aa@example\\.com> \"\n+\t\tgit rev-list refs/remotes/git-svn >actual &&\n+\t\ttest_line_count = 2 actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author BBBBBBB BBBBBBB <bb@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&\n+\t\tgrep \"^author AAAAAAA AAAAAAA <aa@example\\.com> \" actual\n \t)\n \t'\n \n@@ -43,11 +44,12 @@ test_expect_success 'continues to import once authors have been added' '\n \t(\n \t\tcd x\n \t\tgit svn fetch --authors-file=../svn-authors &&\n-\t\ttest \"$(git rev-list refs/remotes/git-svn | wc -l)\" -eq 4 &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author DDDDDDD DDDDDDD <dd@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author CCCCCCC CCCCCCC <cc@example\\.com> \"\n+\t\tgit rev-list refs/remotes/git-svn >actual &&\n+\t\ttest_line_count = 4 actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author DDDDDDD DDDDDDD <dd@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&\n+\t\tgrep \"^author CCCCCCC CCCCCCC <cc@example\\.com> \" actual\n \t)\n \t'\n \n@@ -102,8 +104,10 @@ test_expect_success !MINGW 'fresh clone with svn.authors-file in config' '\n \t\ttest x\"$HOME\"/svn-authors = x\"$(git config svn.authorsfile)\" &&\n \t\tgit svn clone \"$svnrepo\" gitconfig.clone &&\n \t\tcd gitconfig.clone &&\n-\t\tnr_ex=$(git log | grep \"^Author:.*example.com\" | wc -l) &&\n-\t\tnr_rev=$(git rev-list HEAD | wc -l) &&\n+\t\tgit log >actual &&\n+\t\tnr_ex=$(grep \"^Author:.*example.com\" actual | wc -l) &&\n+\t\tgit rev-list HEAD >actual &&\n+\t\tnr_rev=$(wc -l <actual) &&\n \t\ttest $nr_rev -eq $nr_ex\n \t)\n '\ndiff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh\nindex 7d7e9d46b..48109f949 100755\n--- a/t/t9138-git-svn-authors-prog.sh\n+++ b/t/t9138-git-svn-authors-prog.sh\n@@ -37,31 +37,32 @@ test_expect_success 'import authors with prog and file' '\n test_expect_success 'imported 6 revisions successfully' '\n \t(\n \t\tcd x\n-\t\ttest \"$(git rev-list refs/remotes/git-svn | wc -l)\" -eq 6\n+\t\tgit rev-list refs/remotes/git-svn >actual &&\n+\t\ttest_line_count = 6 actual\n \t)\n '\n \n test_expect_success 'authors-prog ran correctly' '\n \t(\n \t\tcd x\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author ee-foo <ee-foo@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~2 | \\\n-\t\t  grep \"^author dd <dd@sub\\.example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~3 | \\\n-\t\t  grep \"^author cc <cc@sub\\.example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~4 | \\\n-\t\t  grep \"^author bb <bb@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~5 | \\\n-\t\t  grep \"^author aa <aa@example\\.com> \"\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&\n+\t\tgrep \"^author ee-foo <ee-foo@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~2 >actual &&\n+\t\tgrep \"^author dd <dd@sub\\.example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~3 >actual &&\n+\t\tgrep \"^author cc <cc@sub\\.example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~4 >actual &&\n+\t\tgrep \"^author bb <bb@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~5 >actual &&\n+\t\tgrep \"^author aa <aa@example\\.com> \" actual\n \t)\n '\n \n test_expect_success 'authors-file overrode authors-prog' '\n \t(\n \t\tcd x\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author FFFFFFF FFFFFFF <fFf@other\\.example\\.com> \"\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author FFFFFFF FFFFFFF <fFf@other\\.example\\.com> \" actual\n \t)\n '\n \n@@ -73,8 +74,8 @@ test_expect_success 'authors-prog handled special characters in username' '\n \t(\n \t\tcd x &&\n \t\tgit svn --authors-prog=../svn-authors-prog fetch &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn |\n-\t\tgrep \"^author xyz; touch evil <xyz; touch evil@example\\.com> \" &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author xyz; touch evil <xyz; touch evil@example\\.com> \" actual &&\n \t\t! test -f evil\n \t)\n '\ndiff --git a/t/t9153-git-svn-rewrite-uuid.sh b/t/t9153-git-svn-rewrite-uuid.sh\nindex 372ef1568..8cb2b5c69 100755\n--- a/t/t9153-git-svn-rewrite-uuid.sh\n+++ b/t/t9153-git-svn-rewrite-uuid.sh\n@@ -16,10 +16,10 @@ test_expect_success 'load svn repo' \"\n \t\"\n \n test_expect_success 'verify uuid' \"\n-\tgit cat-file commit refs/remotes/git-svn~0 | \\\n-\t   grep '^git-svn-id: .*@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/git-svn~1 | \\\n-\t   grep '^git-svn-id: .*@1 $uuid$'\n+\tgit cat-file commit refs/remotes/git-svn~0 >actual &&\n+\tgrep '^git-svn-id: .*@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/git-svn~1 >actual &&\n+\tgrep '^git-svn-id: .*@1 $uuid$' actual\n \t\"\n \n test_done\ndiff --git a/t/t9168-git-svn-partially-globbed-names.sh b/t/t9168-git-svn-partially-globbed-names.sh\nindex 8b22f2272..bdf6e8499 100755\n--- a/t/t9168-git-svn-partially-globbed-names.sh\n+++ b/t/t9168-git-svn-partially-globbed-names.sh\n@@ -48,8 +48,8 @@ test_expect_success 'test refspec prefixed globbing' '\n \tgit config --add svn-remote.svn.tags\\\n \t\t\t \"tags/t_*/src/a:refs/remotes/tags/t_*\" &&\n \tgit svn multi-fetch &&\n-\tgit log --pretty=oneline refs/remotes/tags/t_end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.end &&\n+\tgit log --pretty=oneline refs/remotes/tags/t_end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.end &&\n \ttest_cmp expect.end output.end &&\n \ttest \"$(git rev-parse refs/remotes/tags/t_end~1)\" = \\\n \t\t\"$(git rev-parse refs/remotes/branches/b_start)\" &&\n@@ -78,14 +78,16 @@ test_expect_success 'test left-hand-side only prefixed globbing' '\n \t\tsvn_cmd commit -m \"try to try\"\n \t) &&\n \tgit svn fetch two &&\n-\ttest $(git rev-list refs/remotes/two/tags/t_end | wc -l) -eq 6 &&\n-\ttest $(git rev-list refs/remotes/two/branches/b_start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/two/tags/t_end >actual &&\n+\ttest_line_count = 6 actual &&\n+\tgit rev-list refs/remotes/two/branches/b_start >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/two/branches/b_start~2) = \\\n \t     $(git rev-parse refs/remotes/two/trunk) &&\n \ttest $(git rev-parse refs/remotes/two/tags/t_end~3) = \\\n \t     $(git rev-parse refs/remotes/two/branches/b_start) &&\n-\tgit log --pretty=oneline refs/remotes/two/tags/t_end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.two &&\n+\tgit log --pretty=oneline refs/remotes/two/tags/t_end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.two &&\n \ttest_cmp expect.two output.two\n \t'\n \n@@ -118,14 +120,16 @@ test_expect_success 'test prefixed globs match just prefix' '\n \t\tsvn_cmd up\n \t) &&\n \tgit svn fetch three &&\n-\ttest $(git rev-list refs/remotes/three/branches/b_ | wc -l) -eq 2 &&\n-\ttest $(git rev-list refs/remotes/three/tags/t_ | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/three/branches/b_ >actual &&\n+\ttest_line_count = 2 actual &&\n+\tgit rev-list refs/remotes/three/tags/t_ >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/three/branches/b_~1) = \\\n \t     $(git rev-parse refs/remotes/three/trunk) &&\n \ttest $(git rev-parse refs/remotes/three/tags/t_~1) = \\\n \t     $(git rev-parse refs/remotes/three/branches/b_) &&\n-\tgit log --pretty=oneline refs/remotes/three/tags/t_ | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.three &&\n+\tgit log --pretty=oneline refs/remotes/three/tags/t_ >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.three &&\n \ttest_cmp expect.three output.three\n \t'\n \n@@ -186,14 +190,16 @@ test_expect_success 'test globbing in the middle of the word' '\n \t\tsvn_cmd up\n \t) &&\n \tgit svn fetch five &&\n-\ttest $(git rev-list refs/remotes/five/branches/abcde | wc -l) -eq 2 &&\n-\ttest $(git rev-list refs/remotes/five/tags/fghij | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/five/branches/abcde >actual &&\n+\ttest_line_count = 2 actual &&\n+\tgit rev-list refs/remotes/five/tags/fghij >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/five/branches/abcde~1) = \\\n \t     $(git rev-parse refs/remotes/five/trunk) &&\n \ttest $(git rev-parse refs/remotes/five/tags/fghij~1) = \\\n \t     $(git rev-parse refs/remotes/five/branches/abcde) &&\n-\tgit log --pretty=oneline refs/remotes/five/tags/fghij | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.five &&\n+\tgit log --pretty=oneline refs/remotes/five/tags/fghij >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.five &&\n \ttest_cmp expect.five output.five\n \t'\n \ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex 866ddf605..b5f9ef6ff 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -43,20 +43,20 @@ test_expect_success 'fast-export | fast-import' '\n \tMUSS=$(git rev-parse --verify muss) &&\n \tmkdir new &&\n \tgit --git-dir=new/.git init &&\n-\tgit fast-export --all |\n+\tgit fast-export --all >actual &&\n \t(cd new &&\n \t git fast-import &&\n \t test $MASTER = $(git rev-parse --verify refs/heads/master) &&\n \t test $REIN = $(git rev-parse --verify refs/tags/rein) &&\n \t test $WER = $(git rev-parse --verify refs/heads/wer) &&\n-\t test $MUSS = $(git rev-parse --verify refs/tags/muss))\n+\t test $MUSS = $(git rev-parse --verify refs/tags/muss)) <actual\n \n '\n \n test_expect_success 'fast-export master~2..master' '\n \n-\tgit fast-export master~2..master |\n-\t\tsed \"s/master/partial/\" |\n+\tgit fast-export master~2..master >actual &&\n+\tsed \"s/master/partial/\" actual |\n \t\t(cd new &&\n \t\t git fast-import &&\n \t\t test $MASTER != $(git rev-parse --verify refs/heads/partial) &&\n@@ -74,11 +74,12 @@ test_expect_success 'iso-8859-1' '\n \ttest_tick &&\n \techo rosten >file &&\n \tgit commit -s -m den file &&\n-\tgit fast-export wer^..wer |\n-\t\tsed \"s/wer/i18n/\" |\n+\tgit fast-export wer^..wer >actual &&\n+\tsed \"s/wer/i18n/\" actual |\n \t\t(cd new &&\n \t\t git fast-import &&\n-\t\t git cat-file commit i18n | grep \"Áéí óú\")\n+\t\t git cat-file commit i18n >actual &&\n+\t\t grep \"Áéí óú\" actual)\n \n '\n test_expect_success 'import/export-marks' '\n@@ -87,18 +88,16 @@ test_expect_success 'import/export-marks' '\n \tgit fast-export --export-marks=tmp-marks HEAD &&\n \ttest -s tmp-marks &&\n \ttest_line_count = 3 tmp-marks &&\n-\ttest $(\n-\t\tgit fast-export --import-marks=tmp-marks\\\n-\t\t--export-marks=tmp-marks HEAD |\n-\t\tgrep ^commit |\n+\tgit fast-export --import-marks=tmp-marks \\\n+\t\t--export-marks=tmp-marks HEAD >actual &&\n+\ttest $(grep ^commit actual |\n \t\twc -l) \\\n \t-eq 0 &&\n \techo change > file &&\n \tgit commit -m \"last commit\" file &&\n-\ttest $(\n-\t\tgit fast-export --import-marks=tmp-marks \\\n-\t\t--export-marks=tmp-marks HEAD |\n-\t\tgrep ^commit\\  |\n+\tgit fast-export --import-marks=tmp-marks \\\n+\t\t--export-marks=tmp-marks HEAD >actual &&\n+\ttest $(grep ^commit\\  actual |\n \t\twc -l) \\\n \t-eq 1 &&\n \ttest_line_count = 4 tmp-marks\n@@ -184,7 +183,7 @@ test_expect_success 'submodule fast-export | fast-import' '\n \trm -rf new &&\n \tmkdir new &&\n \tgit --git-dir=new/.git init &&\n-\tgit fast-export --signed-tags=strip --all |\n+\tgit fast-export --signed-tags=strip --all >actual &&\n \t(cd new &&\n \t git fast-import &&\n \t test \"$SUBENT1\" = \"$(git ls-tree refs/heads/master^ sub)\" &&\n@@ -192,7 +191,7 @@ test_expect_success 'submodule fast-export | fast-import' '\n \t git checkout master &&\n \t git submodule init &&\n \t git submodule update &&\n-\t cmp sub/file ../sub/file)\n+\t cmp sub/file ../sub/file) <actual\n \n '\n \n@@ -367,12 +366,14 @@ test_expect_success 'path limiting with import-marks does not lose unmodified fi\n \techo more content >> file &&\n \ttest_tick &&\n \tgit commit -mnext file &&\n-\tgit fast-export --import-marks=marks simple -- file file0 | grep file0\n+\tgit fast-export --import-marks=marks simple -- file file0 >actual &&\n+\tgrep file0 actual\n '\n \n test_expect_success 'full-tree re-shows unmodified files'        '\n \tgit checkout -f simple &&\n-\ttest $(git fast-export --full-tree simple | grep -c file0) -eq 3\n+\tgit fast-export --full-tree simple >actual &&\n+\ttest $(grep -c file0 actual) -eq 3\n '\n \n test_expect_success 'set-up a few more tags for tag export tests' '\n@@ -500,13 +501,13 @@ test_expect_success 'refs are updated even if no commits need to be exported' '\n \tgit fast-export --import-marks=tmp-marks \\\n \t\t--export-marks=tmp-marks master > /dev/null &&\n \tgit fast-export --import-marks=tmp-marks \\\n-\t\t--export-marks=tmp-marks master > actual &&\n+\t\t--export-marks=tmp-marks master >actual &&\n \ttest_cmp expected actual\n '\n \n test_expect_success 'use refspec' '\n-\tgit fast-export --refspec refs/heads/master:refs/heads/foobar master | \\\n-\t\tgrep \"^commit \" | sort | uniq > actual &&\n+\tgit fast-export --refspec refs/heads/master:refs/heads/foobar master >actual2 &&\n+\tgrep \"^commit \" actual2 | sort | uniq >actual &&\n \techo \"commit refs/heads/foobar\" > expected &&\n \ttest_cmp expected actual\n '\n@@ -534,7 +535,8 @@ test_expect_success 'when using -C, do not declare copy when source of copy is a\n \tgit -C src commit -m 2nd_commit &&\n \n \ttest_create_repo dst &&\n-\tgit -C src fast-export --all -C | git -C dst fast-import &&\n+\tgit -C src fast-export --all -C >actual &&\n+\tgit -C dst fast-import <actual &&\n \tgit -C src show >expected &&\n \tgit -C dst show >actual &&\n \ttest_cmp expected actual\n-- \n2.16.2\n\n"},{"id":"342877","messageId":"CAPig+cS3GjYo+5C_W6WqzK3RP=W+918E6Cz=FSvHky6EWCEZPA@mail.gmail.com","threadId":"48036","inReplyTo":"20180323150150.31186-1-predatoramigo@gmail.com","subject":"Re: [GSoC][PATCH v4] test: avoid pipes in git related commands for test","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-03-25T08:37:54Z","receivedAt":"2018-03-25T08:38:03Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Mar 23, 2018 at 11:01 AM, Pratik Karki <predatoramigo@gmail.com> wrote:\n> I hope this follow-on patch[1] is ready for merge.\n\nThis iteration appears to address review comments from the last few\nrounds, however, see below for a few new ones...\n\n> Avoid using pipes downstream of Git commands since the exit codes\n> of commands upstream of pipes get swallowed, thus potentially\n> hiding failure of those commands. Instead, capture Git command\n> output to a file and apply the downstream command(s) to that file.\n>\n> Signed-off-by: Pratik Karki <predatoramigo@gmail.com>\n> ---\n> diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\n> @@ -840,8 +840,8 @@ test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '\n>         test_commit looooooooooooong-tag &&\n>         (\n>                 cd full-output &&\n> -               git -c fetch.output=full fetch origin 2>&1 | \\\n> -                       grep -e \"->\" | cut -c 22- >../actual\n> +               git -c fetch.output=full fetch origin >actual2 2>&1 &&\n> +               grep -e \"->\" actual2 | cut -c 22- >../actual\n\nThe file \"actual2\" is clearly distinct from the file \"../actual\", so\ninventing a name (\"actual2\") isn't particularly helping; you could\njust as easily also name it \"actual\" without hurting comprehension.\n(Not necessarily worth a re-roll.)\n\n>         ) &&\n> @@ -855,8 +855,8 @@ test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '\n>         test_commit extraaa &&\n>         (\n>                 cd compact &&\n> -               git -c fetch.output=compact fetch origin 2>&1 | \\\n> -                       grep -e \"->\" | cut -c 22- >../actual\n> +               git -c fetch.output=compact fetch origin >actual2 2>&1 &&\n> +               grep -e \"->\" actual2 | cut -c 22- >../actual\n\nSame comment.\n\n>         ) &&\n> diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\n> @@ -74,11 +74,12 @@ test_expect_success 'iso-8859-1' '\n>         git commit -s -m den file &&\n> -       git fast-export wer^..wer |\n> -               sed \"s/wer/i18n/\" |\n> +       git fast-export wer^..wer >actual &&\n> +       sed \"s/wer/i18n/\" actual |\n>                 (cd new &&\n>                  git fast-import &&\n> -                git cat-file commit i18n | grep \"Áéí óú\")\n> +                git cat-file commit i18n >actual &&\n> +                grep \"Áéí óú\" actual)\n\nIt was a bit surprising to see a new \"actual\" file created inside the\nsubshell even as 'sed' is processing a file named \"actual\" outside the\nsubshell, and, as a reader, I was concerned about bad interaction\nbetween the operations. However, the file in the subshell is really\n\"new/actual\", thus is distinct from the other \"actual\", so it's okay.\n\nThis is one of those cases, however, in which it might make sense to\ngive the files different names to make the code easier to grok, so\nfuture readers don't stumble over this as well. For instance, the\nouter file could be named \"iso8859-1.fi\" (or something), and the file\nin the subshell can remain \"actual\". Not itself worth a re-roll, but\nprobably a good idea.\n\n(This differs in couple ways from my comment above about t5510 tests\nnaming files \"actual2\" and \"../actual\". In that case, it was quite\nclear that, within the cd'd subshell, file \"../actual\" was distinct\nfrom the file created within the cd'd directory, so no confusion.\nMoreover, those files were not being accessed at the same time,\nwhereas in this t9350 test, the 'sed' is reading from the a file at\nthe same time as 'git cat-file' is outputting to a similarly named\nfile, which is potentially confusing and requires extra brain cycles\nto sort out.)\n\n>  '\n> @@ -87,18 +88,16 @@ test_expect_success 'import/export-marks' '\n>         test_line_count = 3 tmp-marks &&\n> -       test $(\n> -               git fast-export --import-marks=tmp-marks\\\n> -               --export-marks=tmp-marks HEAD |\n> -               grep ^commit |\n> +       git fast-export --import-marks=tmp-marks \\\n> +               --export-marks=tmp-marks HEAD >actual &&\n> +       test $(grep ^commit actual |\n>                 wc -l) \\\n>         -eq 0 &&\n\nSince the git-fast-export invocation has been pulled out of the\n$(...), the entire 'test' expression is now short enough to fit easily\non one line. Making such a change would improve readability\nconsidering how hard it is to read split over three lines like that\n(with inconsistent indentation, moreover):\n\n    test $(grep ^commit actual | wc -l) -eq 0 &&\n\n>         echo change > file &&\n>         git commit -m \"last commit\" file &&\n> -       test $(\n> -               git fast-export --import-marks=tmp-marks \\\n> -               --export-marks=tmp-marks HEAD |\n> -               grep ^commit\\  |\n> +       git fast-export --import-marks=tmp-marks \\\n> +               --export-marks=tmp-marks HEAD >actual &&\n> +       test $(grep ^commit\\  actual |\n>                 wc -l) \\\n>         -eq 1 &&\n\nSame comment.\n\n>         test_line_count = 4 tmp-marks\n> @@ -500,13 +501,13 @@ test_expect_success 'refs are updated even if no commits need to be exported' '\n>         git fast-export --import-marks=tmp-marks \\\n>                 --export-marks=tmp-marks master > /dev/null &&\n>         git fast-export --import-marks=tmp-marks \\\n> -               --export-marks=tmp-marks master > actual &&\n> +               --export-marks=tmp-marks master >actual &&\n\nThis change is unrelated to the purpose of this patch, thus is noise\nwhich distracts reviewers from real changes. Fixing style problems in\ncode you're touching is fine (and usually recommended), however, this\ncode is outside the scope of what the patch should be touching (there\nis no piping output of a git command here). Moreover, it doesn't make\nsense to fix only \"> actual\" but not \"> /dev/null\" just above it.\nConsequently, this change should be dropped from the patch.\n\n>         test_cmp expected actual\n>  '\n"},{"id":"343157","messageId":"20180327173137.5970-1-predatoramigo@gmail.com","threadId":"48036","inReplyTo":"CAPig+cS3GjYo+5C_W6WqzK3RP=W+918E6Cz=FSvHky6EWCEZPA@mail.gmail.com","subject":"[GSoC][PATCH v5] test: avoid pipes in git related commands for test","fromName":"Pratik Karki","fromEmail":"predatoramigo@gmail.com","sentAt":"2018-03-27T17:31:37Z","receivedAt":"2018-03-27T17:32:12Z","isPatch":true,"sender":{"key":"predatoramigo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12194950?v=4"},"body":"Thank you Eric, I made changes according to your review.\n\n\nCheers,\nPratik\n\n-- >8 --\n\nAvoid using pipes downstream of Git commands since the exit codes\nof commands upstream of pipes get swallowed, thus potentially\nhiding failure of those commands. Instead, capture Git command\noutput to a file and apply the downstream command(s) to that file.\n\n\nSigned-off-by: Pratik Karki <predatoramigo@gmail.com>\n---\n t/t5300-pack-object.sh                     |  8 ++---\n t/t5510-fetch.sh                           |  8 ++---\n t/t7001-mv.sh                              | 22 ++++++-------\n t/t7003-filter-branch.sh                   |  9 ++++--\n t/t9104-git-svn-follow-parent.sh           | 16 +++++-----\n t/t9108-git-svn-glob.sh                    | 14 +++++----\n t/t9109-git-svn-multi-glob.sh              | 24 ++++++++------\n t/t9110-git-svn-use-svm-props.sh           | 40 ++++++++++++------------\n t/t9111-git-svn-use-svnsync-props.sh       | 36 ++++++++++-----------\n t/t9114-git-svn-dcommit-merge.sh           | 10 +++---\n t/t9130-git-svn-authors-file.sh            | 28 ++++++++++-------\n t/t9138-git-svn-authors-prog.sh            | 31 +++++++++---------\n t/t9153-git-svn-rewrite-uuid.sh            |  8 ++---\n t/t9168-git-svn-partially-globbed-names.sh | 34 +++++++++++---------\n t/t9350-fast-export.sh                     | 50 ++++++++++++++----------------\n 15 files changed, 179 insertions(+), 159 deletions(-)\n\ndiff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh\nindex 9c68b9925..156beb2d5 100755\n--- a/t/t5300-pack-object.sh\n+++ b/t/t5300-pack-object.sh\n@@ -311,8 +311,8 @@ test_expect_success 'unpacking with --strict' '\n \trm -f .git/index &&\n \ttail -n 10 LIST | git update-index --index-info &&\n \tST=$(git write-tree) &&\n-\tPACK5=$( git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" | \\\n-\t\tgit pack-objects test-5 ) &&\n+\tgit rev-list --objects \"$LIST\" \"$LI\" \"$ST\" >actual &&\n+\tPACK5=$( git pack-objects test-5 <actual ) &&\n \tPACK6=$( (\n \t\t\techo \"$LIST\"\n \t\t\techo \"$LI\"\n@@ -358,8 +358,8 @@ test_expect_success 'index-pack with --strict' '\n \trm -f .git/index &&\n \ttail -n 10 LIST | git update-index --index-info &&\n \tST=$(git write-tree) &&\n-\tPACK5=$( git rev-list --objects \"$LIST\" \"$LI\" \"$ST\" | \\\n-\t\tgit pack-objects test-5 ) &&\n+\tgit rev-list --objects \"$LIST\" \"$LI\" \"$ST\" >actual &&\n+\tPACK5=$( git pack-objects test-5 <actual ) &&\n \tPACK6=$( (\n \t\t\techo \"$LIST\"\n \t\t\techo \"$LI\"\ndiff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh\nindex da9ac0055..ae5a530a2 100755\n--- a/t/t5510-fetch.sh\n+++ b/t/t5510-fetch.sh\n@@ -840,8 +840,8 @@ test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '\n \ttest_commit looooooooooooong-tag &&\n \t(\n \t\tcd full-output &&\n-\t\tgit -c fetch.output=full fetch origin 2>&1 | \\\n-\t\t\tgrep -e \"->\" | cut -c 22- >../actual\n+\t\tgit -c fetch.output=full fetch origin >actual 2>&1 &&\n+\t\tgrep -e \"->\" actual | cut -c 22- >../actual\n \t) &&\n \tcat >expect <<-\\EOF &&\n \tmaster               -> origin/master\n@@ -855,8 +855,8 @@ test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '\n \ttest_commit extraaa &&\n \t(\n \t\tcd compact &&\n-\t\tgit -c fetch.output=compact fetch origin 2>&1 | \\\n-\t\t\tgrep -e \"->\" | cut -c 22- >../actual\n+\t\tgit -c fetch.output=compact fetch origin >actual 2>&1 &&\n+\t\tgrep -e \"->\" actual | cut -c 22- >../actual\n \t) &&\n \tcat >expect <<-\\EOF &&\n \tmaster     -> origin/*\ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex d4e6485a2..e96cbdb10 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -21,8 +21,8 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-    grep \"^R100..*path0/COPYING..*path1/COPYING\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+    grep \"^R100..*path0/COPYING..*path1/COPYING\" actual'\n \n test_expect_success \\\n     'moving the file back into subdirectory' \\\n@@ -35,8 +35,8 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-    grep \"^R100..*path1/COPYING..*path0/COPYING\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+    grep \"^R100..*path1/COPYING..*path0/COPYING\" actual'\n \n test_expect_success \\\n     'mv --dry-run does not move file' \\\n@@ -122,10 +122,9 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path0/COPYING..*path2/COPYING\" &&\n-     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path0/README..*path2/README\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+     grep \"^R100..*path0/COPYING..*path2/COPYING\" actual &&\n+     grep \"^R100..*path0/README..*path2/README\" actual'\n \n test_expect_success \\\n     'succeed when source is a prefix of destination' \\\n@@ -141,10 +140,9 @@ test_expect_success \\\n \n test_expect_success \\\n     'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path2/COPYING..*path1/path2/COPYING\" &&\n-     git diff-tree -r -M --name-status  HEAD^ HEAD | \\\n-     grep \"^R100..*path2/README..*path1/path2/README\"'\n+    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+     grep \"^R100..*path2/COPYING..*path1/path2/COPYING\" actual &&\n+     grep \"^R100..*path2/README..*path1/path2/README\" actual'\n \n test_expect_success \\\n     'do not move directory over existing directory' \\\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex 7cb60799b..6a28b6cce 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -187,7 +187,8 @@ test_expect_success 'author information is preserved' '\n \t\t\ttest \\$GIT_COMMIT != $(git rev-parse master) || \\\n \t\t\techo Hallo\" \\\n \t\tpreserved-author) &&\n-\ttest 1 = $(git rev-list --author=\"B V Uips\" preserved-author | wc -l)\n+\tgit rev-list --author=\"B V Uips\" preserved-author >actual &&\n+\ttest_line_count = 1 actual\n '\n \n test_expect_success \"remove a certain author's commits\" '\n@@ -205,7 +206,8 @@ test_expect_success \"remove a certain author's commits\" '\n \tcnt1=$(git rev-list master | wc -l) &&\n \tcnt2=$(git rev-list removed-author | wc -l) &&\n \ttest $cnt1 -eq $(($cnt2 + 1)) &&\n-\ttest 0 = $(git rev-list --author=\"B V Uips\" removed-author | wc -l)\n+\tgit rev-list --author=\"B V Uips\" removed-author >actual &&\n+\ttest_line_count = 0 actual\n '\n \n test_expect_success 'barf on invalid name' '\n@@ -258,7 +260,8 @@ test_expect_success 'Subdirectory filter with disappearing trees' '\n \tgit commit -m \"Re-adding foo\" &&\n \n \tgit filter-branch -f --subdirectory-filter foo &&\n-\ttest $(git rev-list master | wc -l) = 3\n+\tgit rev-list master >actual &&\n+\ttest_line_count = 3 actual\n '\n \n test_expect_success 'Tag name filtering retains tag message' '\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex cd480edf1..a735fa371 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -33,8 +33,8 @@ test_expect_success 'init and fetch a moved directory' '\n \tgit svn fetch -i thunk &&\n \ttest \"$(git rev-parse --verify refs/remotes/thunk@2)\" \\\n \t   = \"$(git rev-parse --verify refs/remotes/thunk~1)\" &&\n-\ttest \"$(git cat-file blob refs/remotes/thunk:readme |\\\n-\t\t sed -n -e \"3p\")\" = goodbye &&\n+\tgit cat-file blob refs/remotes/thunk:readme >actual &&\n+\ttest \"$(sed -n -e \"3p\" actual)\" = goodbye &&\n \ttest -z \"$(git config --get svn-remote.svn.fetch \\\n \t\t \"^trunk:refs/remotes/thunk@2$\")\"\n \t'\n@@ -48,8 +48,8 @@ test_expect_success 'init and fetch from one svn-remote' '\n         git svn fetch -i svn/thunk &&\n \ttest \"$(git rev-parse --verify refs/remotes/svn/trunk)\" \\\n \t   = \"$(git rev-parse --verify refs/remotes/svn/thunk~1)\" &&\n-\ttest \"$(git cat-file blob refs/remotes/svn/thunk:readme |\\\n-\t\t sed -n -e \"3p\")\" = goodbye\n+\tgit cat-file blob refs/remotes/svn/thunk:readme >actual &&\n+\ttest \"$(sed -n -e \"3p\" actual)\" = goodbye\n         '\n \n test_expect_success 'follow deleted parent' '\n@@ -107,7 +107,8 @@ test_expect_success 'follow deleted directory' '\n \tgit svn init --minimize-url -i glob \"$svnrepo\"/glob &&\n \tgit svn fetch -i glob &&\n \ttest \"$(git cat-file blob refs/remotes/glob:blob/bye)\" = hi &&\n-\ttest \"$(git ls-tree refs/remotes/glob | wc -l )\" -eq 1\n+\tgit ls-tree refs/remotes/glob >actual &&\n+\ttest_line_count = 1 actual\n \t'\n \n # ref: r9270 of the Subversion repository: (http://svn.collab.net/repos/svn)\n@@ -204,8 +205,9 @@ test_expect_success \"follow-parent is atomic\" '\n test_expect_success \"track multi-parent paths\" '\n \tsvn_cmd cp -m \"resurrect /glob\" \"$svnrepo\"/r9270 \"$svnrepo\"/glob &&\n \tgit svn multi-fetch &&\n-\ttest $(git cat-file commit refs/remotes/glob | \\\n-\t       grep \"^parent \" | wc -l) -eq 2\n+\tgit cat-file commit refs/remotes/glob >actual &&\n+\tgrep \"^parent \" actual >actual2 &&\n+\ttest_line_count = 2 actual2\n \t'\n \n test_expect_success \"multi-fetch continues to work\" \"\ndiff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh\nindex a94286c8e..6990f6436 100755\n--- a/t/t9108-git-svn-glob.sh\n+++ b/t/t9108-git-svn-glob.sh\n@@ -47,8 +47,8 @@ test_expect_success 'test refspec globbing' '\n \tgit config --add svn-remote.svn.tags\\\n \t                 \"tags/*/src/a:refs/remotes/tags/*\" &&\n \tgit svn multi-fetch &&\n-\tgit log --pretty=oneline refs/remotes/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.end &&\n+\tgit log --pretty=oneline refs/remotes/tags/end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.end &&\n \ttest_cmp expect.end output.end &&\n \ttest \"$(git rev-parse refs/remotes/tags/end~1)\" = \\\n \t\t\"$(git rev-parse refs/remotes/branches/start)\" &&\n@@ -75,14 +75,16 @@ test_expect_success 'test left-hand-side only globbing' '\n \t\tsvn_cmd commit -m \"try to try\"\n \t) &&\n \tgit svn fetch two &&\n-\ttest $(git rev-list refs/remotes/two/tags/end | wc -l) -eq 6 &&\n-\ttest $(git rev-list refs/remotes/two/branches/start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/two/tags/end >actual &&\n+\ttest_line_count = 6 actual &&\n+\tgit rev-list refs/remotes/two/branches/start >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/two/branches/start~2) = \\\n \t     $(git rev-parse refs/remotes/two/trunk) &&\n \ttest $(git rev-parse refs/remotes/two/tags/end~3) = \\\n \t     $(git rev-parse refs/remotes/two/branches/start) &&\n-\tgit log --pretty=oneline refs/remotes/two/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.two &&\n+\tgit log --pretty=oneline refs/remotes/two/tags/end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.two &&\n \ttest_cmp expect.two output.two\n \t'\n \ndiff --git a/t/t9109-git-svn-multi-glob.sh b/t/t9109-git-svn-multi-glob.sh\nindex 8d99e848d..c1e7542a3 100755\n--- a/t/t9109-git-svn-multi-glob.sh\n+++ b/t/t9109-git-svn-multi-glob.sh\n@@ -47,8 +47,8 @@ test_expect_success 'test refspec globbing' '\n \tgit config --add svn-remote.svn.tags\\\n \t                 \"tags/*/src/a:refs/remotes/tags/*\" &&\n \tgit svn multi-fetch &&\n-\tgit log --pretty=oneline refs/remotes/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.end &&\n+\tgit log --pretty=oneline refs/remotes/tags/end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.end &&\n \ttest_cmp expect.end output.end &&\n \ttest \"$(git rev-parse refs/remotes/tags/end~1)\" = \\\n \t\t\"$(git rev-parse refs/remotes/branches/v1/start)\" &&\n@@ -75,14 +75,16 @@ test_expect_success 'test left-hand-side only globbing' '\n \t\tsvn_cmd commit -m \"try to try\"\n \t) &&\n \tgit svn fetch two &&\n-\ttest $(git rev-list refs/remotes/two/tags/end | wc -l) -eq 6 &&\n-\ttest $(git rev-list refs/remotes/two/branches/v1/start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/two/tags/end >actual &&\n+\ttest_line_count = 6 actual &&\n+\tgit rev-list refs/remotes/two/branches/v1/start >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/two/branches/v1/start~2) = \\\n \t     $(git rev-parse refs/remotes/two/trunk) &&\n \ttest $(git rev-parse refs/remotes/two/tags/end~3) = \\\n \t     $(git rev-parse refs/remotes/two/branches/v1/start) &&\n-\tgit log --pretty=oneline refs/remotes/two/tags/end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.two &&\n+\tgit log --pretty=oneline refs/remotes/two/tags/end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.two &&\n \ttest_cmp expect.two output.two\n \t'\n cat > expect.four <<EOF\n@@ -124,14 +126,16 @@ test_expect_success 'test another branch' '\n \tgit config --add svn-remote.four.tags \\\n \t                 \"tags/*:refs/remotes/four/tags/*\" &&\n \tgit svn fetch four &&\n-\ttest $(git rev-list refs/remotes/four/tags/next | wc -l) -eq 5 &&\n-\ttest $(git rev-list refs/remotes/four/branches/v2/start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/four/tags/next >actual &&\n+\ttest_line_count = 5 actual &&\n+\tgit rev-list refs/remotes/four/branches/v2/start >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/four/branches/v2/start~2) = \\\n \t     $(git rev-parse refs/remotes/four/trunk) &&\n \ttest $(git rev-parse refs/remotes/four/tags/next~2) = \\\n \t     $(git rev-parse refs/remotes/four/branches/v2/start) &&\n-\tgit log --pretty=oneline refs/remotes/four/tags/next | \\\n-\t    sed -e \"s/^.\\{41\\}//\" > output.four &&\n+\tgit log --pretty=oneline refs/remotes/four/tags/next >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.four &&\n \ttest_cmp expect.four output.four\n \t'\n \ndiff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh\nindex dde0a3c22..ad37d980c 100755\n--- a/t/t9110-git-svn-use-svm-props.sh\n+++ b/t/t9110-git-svn-use-svm-props.sh\n@@ -21,37 +21,37 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89\n \n bar_url=http://mayonaise/svnrepo/bar\n test_expect_success 'verify metadata for /bar' \"\n-\tgit cat-file commit refs/remotes/bar | \\\n-\t   grep '^git-svn-id: $bar_url@12 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~1 | \\\n-\t   grep '^git-svn-id: $bar_url@11 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~2 | \\\n-\t   grep '^git-svn-id: $bar_url@10 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~3 | \\\n-\t   grep '^git-svn-id: $bar_url@9 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~4 | \\\n-\t   grep '^git-svn-id: $bar_url@6 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~5 | \\\n-\t   grep '^git-svn-id: $bar_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/bar >actual &&\n+\tgrep '^git-svn-id: $bar_url@12 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~1 >actual &&\n+\tgrep '^git-svn-id: $bar_url@11 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~2 >actual &&\n+\tgrep '^git-svn-id: $bar_url@10 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~3 >actual &&\n+\tgrep '^git-svn-id: $bar_url@9 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~4 >actual &&\n+\tgrep '^git-svn-id: $bar_url@6 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~5 >actual &&\n+\tgrep '^git-svn-id: $bar_url@1 $uuid$' actual\n \t\"\n \n e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e\n test_expect_success 'verify metadata for /dir/a/b/c/d/e' \"\n-\tgit cat-file commit refs/remotes/e | \\\n-\t   grep '^git-svn-id: $e_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/e >actual &&\n+\tgrep '^git-svn-id: $e_url@1 $uuid$' actual\n \t\"\n \n dir_url=http://mayonaise/svnrepo/dir\n test_expect_success 'verify metadata for /dir' \"\n-\tgit cat-file commit refs/remotes/dir | \\\n-\t   grep '^git-svn-id: $dir_url@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/dir~1 | \\\n-\t   grep '^git-svn-id: $dir_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/dir >actual &&\n+\tgrep '^git-svn-id: $dir_url@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/dir~1 >actual &&\n+\tgrep '^git-svn-id: $dir_url@1 $uuid$' actual\n \t\"\n \n test_expect_success 'find commit based on SVN revision number' \"\n-        git svn find-rev r12 |\n-\t    grep $(git rev-parse HEAD)\n+\tgit svn find-rev r12 >actual &&\n+\tgrep $(git rev-parse HEAD) actual\n         \"\n \n test_expect_success 'empty rebase' \"\ndiff --git a/t/t9111-git-svn-use-svnsync-props.sh b/t/t9111-git-svn-use-svnsync-props.sh\nindex 22b6e5ee7..6c9307355 100755\n--- a/t/t9111-git-svn-use-svnsync-props.sh\n+++ b/t/t9111-git-svn-use-svnsync-props.sh\n@@ -20,32 +20,32 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89\n \n bar_url=http://mayonaise/svnrepo/bar\n test_expect_success 'verify metadata for /bar' \"\n-\tgit cat-file commit refs/remotes/bar | \\\n-\t   grep '^git-svn-id: $bar_url@12 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~1 | \\\n-\t   grep '^git-svn-id: $bar_url@11 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~2 | \\\n-\t   grep '^git-svn-id: $bar_url@10 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~3 | \\\n-\t   grep '^git-svn-id: $bar_url@9 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~4 | \\\n-\t   grep '^git-svn-id: $bar_url@6 $uuid$' &&\n-\tgit cat-file commit refs/remotes/bar~5 | \\\n-\t   grep '^git-svn-id: $bar_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/bar >actual &&\n+\tgrep '^git-svn-id: $bar_url@12 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~1 >actual &&\n+\tgrep '^git-svn-id: $bar_url@11 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~2 >actual &&\n+\tgrep '^git-svn-id: $bar_url@10 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~3 >actual &&\n+\tgrep '^git-svn-id: $bar_url@9 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~4 >actual &&\n+\tgrep '^git-svn-id: $bar_url@6 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/bar~5 >actual &&\n+\tgrep '^git-svn-id: $bar_url@1 $uuid$' actual\n \t\"\n \n e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e\n test_expect_success 'verify metadata for /dir/a/b/c/d/e' \"\n-\tgit cat-file commit refs/remotes/e | \\\n-\t   grep '^git-svn-id: $e_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/e >actual &&\n+\tgrep '^git-svn-id: $e_url@1 $uuid$' actual\n \t\"\n \n dir_url=http://mayonaise/svnrepo/dir\n test_expect_success 'verify metadata for /dir' \"\n-\tgit cat-file commit refs/remotes/dir | \\\n-\t   grep '^git-svn-id: $dir_url@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/dir~1 | \\\n-\t   grep '^git-svn-id: $dir_url@1 $uuid$'\n+\tgit cat-file commit refs/remotes/dir >actual &&\n+\tgrep '^git-svn-id: $dir_url@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/dir~1 >actual &&\n+\tgrep '^git-svn-id: $dir_url@1 $uuid$' actual\n \t\"\n \n test_done\ndiff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh\nindex 50bca62de..32317d6bc 100755\n--- a/t/t9114-git-svn-dcommit-merge.sh\n+++ b/t/t9114-git-svn-dcommit-merge.sh\n@@ -68,7 +68,8 @@ test_debug 'gitk --all & sleep 1'\n test_expect_success 'verify pre-merge ancestry' \"\n \ttest x\\$(git rev-parse --verify refs/heads/svn^2) = \\\n \t     x\\$(git rev-parse --verify refs/heads/merge) &&\n-\tgit cat-file commit refs/heads/svn^ | grep '^friend$'\n+\tgit cat-file commit refs/heads/svn^ >actual &&\n+\tgrep '^friend$' actual\n \t\"\n \n test_expect_success 'git svn dcommit merges' \"\n@@ -82,12 +83,13 @@ test_expect_success 'verify post-merge ancestry' \"\n \t     x\\$(git rev-parse --verify refs/remotes/origin/trunk) &&\n \ttest x\\$(git rev-parse --verify refs/heads/svn^2) = \\\n \t     x\\$(git rev-parse --verify refs/heads/merge) &&\n-\tgit cat-file commit refs/heads/svn^ | grep '^friend$'\n+\tgit cat-file commit refs/heads/svn^ >actual &&\n+\tgrep '^friend$' actual\n \t\"\n \n test_expect_success 'verify merge commit message' \"\n-\tgit rev-list --pretty=raw -1 refs/heads/svn | \\\n-\t  grep \\\"    Merge branch 'merge' into svn\\\"\n+\tgit rev-list --pretty=raw -1 refs/heads/svn >actual &&\n+\tgrep \\\"    Merge branch 'merge' into svn\\\" actual\n \t\"\n \n test_done\ndiff --git a/t/t9130-git-svn-authors-file.sh b/t/t9130-git-svn-authors-file.sh\nindex 41264818c..7752a1fae 100755\n--- a/t/t9130-git-svn-authors-file.sh\n+++ b/t/t9130-git-svn-authors-file.sh\n@@ -26,11 +26,12 @@ test_expect_success 'start import with incomplete authors file' '\n test_expect_success 'imported 2 revisions successfully' '\n \t(\n \t\tcd x\n-\t\ttest \"$(git rev-list refs/remotes/git-svn | wc -l)\" -eq 2 &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author BBBBBBB BBBBBBB <bb@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author AAAAAAA AAAAAAA <aa@example\\.com> \"\n+\t\tgit rev-list refs/remotes/git-svn >actual &&\n+\t\ttest_line_count = 2 actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author BBBBBBB BBBBBBB <bb@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&\n+\t\tgrep \"^author AAAAAAA AAAAAAA <aa@example\\.com> \" actual\n \t)\n \t'\n \n@@ -43,11 +44,12 @@ test_expect_success 'continues to import once authors have been added' '\n \t(\n \t\tcd x\n \t\tgit svn fetch --authors-file=../svn-authors &&\n-\t\ttest \"$(git rev-list refs/remotes/git-svn | wc -l)\" -eq 4 &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author DDDDDDD DDDDDDD <dd@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author CCCCCCC CCCCCCC <cc@example\\.com> \"\n+\t\tgit rev-list refs/remotes/git-svn >actual &&\n+\t\ttest_line_count = 4 actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author DDDDDDD DDDDDDD <dd@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&\n+\t\tgrep \"^author CCCCCCC CCCCCCC <cc@example\\.com> \" actual\n \t)\n \t'\n \n@@ -102,8 +104,10 @@ test_expect_success !MINGW 'fresh clone with svn.authors-file in config' '\n \t\ttest x\"$HOME\"/svn-authors = x\"$(git config svn.authorsfile)\" &&\n \t\tgit svn clone \"$svnrepo\" gitconfig.clone &&\n \t\tcd gitconfig.clone &&\n-\t\tnr_ex=$(git log | grep \"^Author:.*example.com\" | wc -l) &&\n-\t\tnr_rev=$(git rev-list HEAD | wc -l) &&\n+\t\tgit log >actual &&\n+\t\tnr_ex=$(grep \"^Author:.*example.com\" actual | wc -l) &&\n+\t\tgit rev-list HEAD >actual &&\n+\t\tnr_rev=$(wc -l <actual) &&\n \t\ttest $nr_rev -eq $nr_ex\n \t)\n '\ndiff --git a/t/t9138-git-svn-authors-prog.sh b/t/t9138-git-svn-authors-prog.sh\nindex 7d7e9d46b..48109f949 100755\n--- a/t/t9138-git-svn-authors-prog.sh\n+++ b/t/t9138-git-svn-authors-prog.sh\n@@ -37,31 +37,32 @@ test_expect_success 'import authors with prog and file' '\n test_expect_success 'imported 6 revisions successfully' '\n \t(\n \t\tcd x\n-\t\ttest \"$(git rev-list refs/remotes/git-svn | wc -l)\" -eq 6\n+\t\tgit rev-list refs/remotes/git-svn >actual &&\n+\t\ttest_line_count = 6 actual\n \t)\n '\n \n test_expect_success 'authors-prog ran correctly' '\n \t(\n \t\tcd x\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n-\t\t  grep \"^author ee-foo <ee-foo@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~2 | \\\n-\t\t  grep \"^author dd <dd@sub\\.example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~3 | \\\n-\t\t  grep \"^author cc <cc@sub\\.example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~4 | \\\n-\t\t  grep \"^author bb <bb@example\\.com> \" &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~5 | \\\n-\t\t  grep \"^author aa <aa@example\\.com> \"\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 >actual &&\n+\t\tgrep \"^author ee-foo <ee-foo@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~2 >actual &&\n+\t\tgrep \"^author dd <dd@sub\\.example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~3 >actual &&\n+\t\tgrep \"^author cc <cc@sub\\.example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~4 >actual &&\n+\t\tgrep \"^author bb <bb@example\\.com> \" actual &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~5 >actual &&\n+\t\tgrep \"^author aa <aa@example\\.com> \" actual\n \t)\n '\n \n test_expect_success 'authors-file overrode authors-prog' '\n \t(\n \t\tcd x\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n-\t\t  grep \"^author FFFFFFF FFFFFFF <fFf@other\\.example\\.com> \"\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author FFFFFFF FFFFFFF <fFf@other\\.example\\.com> \" actual\n \t)\n '\n \n@@ -73,8 +74,8 @@ test_expect_success 'authors-prog handled special characters in username' '\n \t(\n \t\tcd x &&\n \t\tgit svn --authors-prog=../svn-authors-prog fetch &&\n-\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn |\n-\t\tgrep \"^author xyz; touch evil <xyz; touch evil@example\\.com> \" &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn >actual &&\n+\t\tgrep \"^author xyz; touch evil <xyz; touch evil@example\\.com> \" actual &&\n \t\t! test -f evil\n \t)\n '\ndiff --git a/t/t9153-git-svn-rewrite-uuid.sh b/t/t9153-git-svn-rewrite-uuid.sh\nindex 372ef1568..8cb2b5c69 100755\n--- a/t/t9153-git-svn-rewrite-uuid.sh\n+++ b/t/t9153-git-svn-rewrite-uuid.sh\n@@ -16,10 +16,10 @@ test_expect_success 'load svn repo' \"\n \t\"\n \n test_expect_success 'verify uuid' \"\n-\tgit cat-file commit refs/remotes/git-svn~0 | \\\n-\t   grep '^git-svn-id: .*@2 $uuid$' &&\n-\tgit cat-file commit refs/remotes/git-svn~1 | \\\n-\t   grep '^git-svn-id: .*@1 $uuid$'\n+\tgit cat-file commit refs/remotes/git-svn~0 >actual &&\n+\tgrep '^git-svn-id: .*@2 $uuid$' actual &&\n+\tgit cat-file commit refs/remotes/git-svn~1 >actual &&\n+\tgrep '^git-svn-id: .*@1 $uuid$' actual\n \t\"\n \n test_done\ndiff --git a/t/t9168-git-svn-partially-globbed-names.sh b/t/t9168-git-svn-partially-globbed-names.sh\nindex 8b22f2272..bdf6e8499 100755\n--- a/t/t9168-git-svn-partially-globbed-names.sh\n+++ b/t/t9168-git-svn-partially-globbed-names.sh\n@@ -48,8 +48,8 @@ test_expect_success 'test refspec prefixed globbing' '\n \tgit config --add svn-remote.svn.tags\\\n \t\t\t \"tags/t_*/src/a:refs/remotes/tags/t_*\" &&\n \tgit svn multi-fetch &&\n-\tgit log --pretty=oneline refs/remotes/tags/t_end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.end &&\n+\tgit log --pretty=oneline refs/remotes/tags/t_end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.end &&\n \ttest_cmp expect.end output.end &&\n \ttest \"$(git rev-parse refs/remotes/tags/t_end~1)\" = \\\n \t\t\"$(git rev-parse refs/remotes/branches/b_start)\" &&\n@@ -78,14 +78,16 @@ test_expect_success 'test left-hand-side only prefixed globbing' '\n \t\tsvn_cmd commit -m \"try to try\"\n \t) &&\n \tgit svn fetch two &&\n-\ttest $(git rev-list refs/remotes/two/tags/t_end | wc -l) -eq 6 &&\n-\ttest $(git rev-list refs/remotes/two/branches/b_start | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/two/tags/t_end >actual &&\n+\ttest_line_count = 6 actual &&\n+\tgit rev-list refs/remotes/two/branches/b_start >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/two/branches/b_start~2) = \\\n \t     $(git rev-parse refs/remotes/two/trunk) &&\n \ttest $(git rev-parse refs/remotes/two/tags/t_end~3) = \\\n \t     $(git rev-parse refs/remotes/two/branches/b_start) &&\n-\tgit log --pretty=oneline refs/remotes/two/tags/t_end | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.two &&\n+\tgit log --pretty=oneline refs/remotes/two/tags/t_end >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.two &&\n \ttest_cmp expect.two output.two\n \t'\n \n@@ -118,14 +120,16 @@ test_expect_success 'test prefixed globs match just prefix' '\n \t\tsvn_cmd up\n \t) &&\n \tgit svn fetch three &&\n-\ttest $(git rev-list refs/remotes/three/branches/b_ | wc -l) -eq 2 &&\n-\ttest $(git rev-list refs/remotes/three/tags/t_ | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/three/branches/b_ >actual &&\n+\ttest_line_count = 2 actual &&\n+\tgit rev-list refs/remotes/three/tags/t_ >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/three/branches/b_~1) = \\\n \t     $(git rev-parse refs/remotes/three/trunk) &&\n \ttest $(git rev-parse refs/remotes/three/tags/t_~1) = \\\n \t     $(git rev-parse refs/remotes/three/branches/b_) &&\n-\tgit log --pretty=oneline refs/remotes/three/tags/t_ | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.three &&\n+\tgit log --pretty=oneline refs/remotes/three/tags/t_ >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.three &&\n \ttest_cmp expect.three output.three\n \t'\n \n@@ -186,14 +190,16 @@ test_expect_success 'test globbing in the middle of the word' '\n \t\tsvn_cmd up\n \t) &&\n \tgit svn fetch five &&\n-\ttest $(git rev-list refs/remotes/five/branches/abcde | wc -l) -eq 2 &&\n-\ttest $(git rev-list refs/remotes/five/tags/fghij | wc -l) -eq 3 &&\n+\tgit rev-list refs/remotes/five/branches/abcde >actual &&\n+\ttest_line_count = 2 actual &&\n+\tgit rev-list refs/remotes/five/tags/fghij >actual &&\n+\ttest_line_count = 3 actual &&\n \ttest $(git rev-parse refs/remotes/five/branches/abcde~1) = \\\n \t     $(git rev-parse refs/remotes/five/trunk) &&\n \ttest $(git rev-parse refs/remotes/five/tags/fghij~1) = \\\n \t     $(git rev-parse refs/remotes/five/branches/abcde) &&\n-\tgit log --pretty=oneline refs/remotes/five/tags/fghij | \\\n-\t    sed -e \"s/^.\\{41\\}//\" >output.five &&\n+\tgit log --pretty=oneline refs/remotes/five/tags/fghij >actual &&\n+\tsed -e \"s/^.\\{41\\}//\" actual >output.five &&\n \ttest_cmp expect.five output.five\n \t'\n \ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex 866ddf605..d5679ffb8 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -43,20 +43,20 @@ test_expect_success 'fast-export | fast-import' '\n \tMUSS=$(git rev-parse --verify muss) &&\n \tmkdir new &&\n \tgit --git-dir=new/.git init &&\n-\tgit fast-export --all |\n+\tgit fast-export --all >actual &&\n \t(cd new &&\n \t git fast-import &&\n \t test $MASTER = $(git rev-parse --verify refs/heads/master) &&\n \t test $REIN = $(git rev-parse --verify refs/tags/rein) &&\n \t test $WER = $(git rev-parse --verify refs/heads/wer) &&\n-\t test $MUSS = $(git rev-parse --verify refs/tags/muss))\n+\t test $MUSS = $(git rev-parse --verify refs/tags/muss)) <actual\n \n '\n \n test_expect_success 'fast-export master~2..master' '\n \n-\tgit fast-export master~2..master |\n-\t\tsed \"s/master/partial/\" |\n+\tgit fast-export master~2..master >actual &&\n+\tsed \"s/master/partial/\" actual |\n \t\t(cd new &&\n \t\t git fast-import &&\n \t\t test $MASTER != $(git rev-parse --verify refs/heads/partial) &&\n@@ -74,11 +74,12 @@ test_expect_success 'iso-8859-1' '\n \ttest_tick &&\n \techo rosten >file &&\n \tgit commit -s -m den file &&\n-\tgit fast-export wer^..wer |\n-\t\tsed \"s/wer/i18n/\" |\n+\tgit fast-export wer^..wer >iso8859-1.fi &&\n+\tsed \"s/wer/i18n/\" iso8859-1.fi |\n \t\t(cd new &&\n \t\t git fast-import &&\n-\t\t git cat-file commit i18n | grep \"Áéí óú\")\n+\t\t git cat-file commit i18n >actual &&\n+\t\t grep \"Áéí óú\" actual)\n \n '\n test_expect_success 'import/export-marks' '\n@@ -87,20 +88,14 @@ test_expect_success 'import/export-marks' '\n \tgit fast-export --export-marks=tmp-marks HEAD &&\n \ttest -s tmp-marks &&\n \ttest_line_count = 3 tmp-marks &&\n-\ttest $(\n-\t\tgit fast-export --import-marks=tmp-marks\\\n-\t\t--export-marks=tmp-marks HEAD |\n-\t\tgrep ^commit |\n-\t\twc -l) \\\n-\t-eq 0 &&\n+\tgit fast-export --import-marks=tmp-marks \\\n+\t\t--export-marks=tmp-marks HEAD >actual &&\n+\ttest $(grep ^commit actual | wc -l) -eq 0 &&\n \techo change > file &&\n \tgit commit -m \"last commit\" file &&\n-\ttest $(\n-\t\tgit fast-export --import-marks=tmp-marks \\\n-\t\t--export-marks=tmp-marks HEAD |\n-\t\tgrep ^commit\\  |\n-\t\twc -l) \\\n-\t-eq 1 &&\n+\tgit fast-export --import-marks=tmp-marks \\\n+\t\t--export-marks=tmp-marks HEAD >actual &&\n+\ttest $(grep ^commit\\  actual | wc -l) -eq 1 &&\n \ttest_line_count = 4 tmp-marks\n \n '\n@@ -184,7 +179,7 @@ test_expect_success 'submodule fast-export | fast-import' '\n \trm -rf new &&\n \tmkdir new &&\n \tgit --git-dir=new/.git init &&\n-\tgit fast-export --signed-tags=strip --all |\n+\tgit fast-export --signed-tags=strip --all >actual &&\n \t(cd new &&\n \t git fast-import &&\n \t test \"$SUBENT1\" = \"$(git ls-tree refs/heads/master^ sub)\" &&\n@@ -192,7 +187,7 @@ test_expect_success 'submodule fast-export | fast-import' '\n \t git checkout master &&\n \t git submodule init &&\n \t git submodule update &&\n-\t cmp sub/file ../sub/file)\n+\t cmp sub/file ../sub/file) <actual\n \n '\n \n@@ -367,12 +362,14 @@ test_expect_success 'path limiting with import-marks does not lose unmodified fi\n \techo more content >> file &&\n \ttest_tick &&\n \tgit commit -mnext file &&\n-\tgit fast-export --import-marks=marks simple -- file file0 | grep file0\n+\tgit fast-export --import-marks=marks simple -- file file0 >actual &&\n+\tgrep file0 actual\n '\n \n test_expect_success 'full-tree re-shows unmodified files'        '\n \tgit checkout -f simple &&\n-\ttest $(git fast-export --full-tree simple | grep -c file0) -eq 3\n+\tgit fast-export --full-tree simple >actual &&\n+\ttest $(grep -c file0 actual) -eq 3\n '\n \n test_expect_success 'set-up a few more tags for tag export tests' '\n@@ -505,8 +502,8 @@ test_expect_success 'refs are updated even if no commits need to be exported' '\n '\n \n test_expect_success 'use refspec' '\n-\tgit fast-export --refspec refs/heads/master:refs/heads/foobar master | \\\n-\t\tgrep \"^commit \" | sort | uniq > actual &&\n+\tgit fast-export --refspec refs/heads/master:refs/heads/foobar master >actual2 &&\n+\tgrep \"^commit \" actual2 | sort | uniq >actual &&\n \techo \"commit refs/heads/foobar\" > expected &&\n \ttest_cmp expected actual\n '\n@@ -534,7 +531,8 @@ test_expect_success 'when using -C, do not declare copy when source of copy is a\n \tgit -C src commit -m 2nd_commit &&\n \n \ttest_create_repo dst &&\n-\tgit -C src fast-export --all -C | git -C dst fast-import &&\n+\tgit -C src fast-export --all -C >actual &&\n+\tgit -C dst fast-import <actual &&\n \tgit -C src show >expected &&\n \tgit -C dst show >actual &&\n \ttest_cmp expected actual\n-- \n2.16.2\n\n"},{"id":"343490","messageId":"CAPig+cSykgDMO-CMc0O5g5ke7D3VSKoaQdNLQDHfu8oTWTDS6w@mail.gmail.com","threadId":"48036","inReplyTo":"20180327173137.5970-1-predatoramigo@gmail.com","subject":"Re: [GSoC][PATCH v5] test: avoid pipes in git related commands for test","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-03-30T21:45:13Z","receivedAt":"2018-03-30T21:45:20Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Mar 27, 2018 at 1:31 PM, Pratik Karki <predatoramigo@gmail.com> wrote:\n> Avoid using pipes downstream of Git commands since the exit codes\n> of commands upstream of pipes get swallowed, thus potentially\n> hiding failure of those commands. Instead, capture Git command\n> output to a file and apply the downstream command(s) to that file.\n>\n>\n> Signed-off-by: Pratik Karki <predatoramigo@gmail.com>\n\nUnnecessary double blank line above sign-off.\n\nAside from that minor hiccup (which Junio fixed when queuing), this\niteration addresses all my review comments[1] from the previous round\nand does not seem to introduce any new issues.\n\nThanks.\n\n[1]: https://public-inbox.org/git/CAPig+cS3GjYo+5C_W6WqzK3RP=W+918E6Cz=FSvHky6EWCEZPA@mail.gmail.com/\n"},{"id":"343492","messageId":"xmqqmuyp1aj8.fsf@gitster-ct.c.googlers.com","threadId":"48036","inReplyTo":"CAPig+cSykgDMO-CMc0O5g5ke7D3VSKoaQdNLQDHfu8oTWTDS6w@mail.gmail.com","subject":"Re: [GSoC][PATCH v5] test: avoid pipes in git related commands for test","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-03-30T22:08:43Z","receivedAt":"2018-03-30T22:08:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> On Tue, Mar 27, 2018 at 1:31 PM, Pratik Karki <predatoramigo@gmail.com> wrote:\n>> Avoid using pipes downstream of Git commands since the exit codes\n>> of commands upstream of pipes get swallowed, thus potentially\n>> hiding failure of those commands. Instead, capture Git command\n>> output to a file and apply the downstream command(s) to that file.\n>>\n>>\n>> Signed-off-by: Pratik Karki <predatoramigo@gmail.com>\n>\n> Unnecessary double blank line above sign-off.\n\n\"git am\" would automatically trigger stripspace, which would eat the\nextra blank line from that two-blank-line block.\n\n> Aside from that minor hiccup (which Junio fixed when queuing), this\n> iteration addresses all my review comments[1] from the previous round\n> and does not seem to introduce any new issues.\n\nThanks for a review.\n"}]}