{"thread":{"id":"51033","subject":"[PATCH] t4253-am-keep-cr-dos: avoid using pipes","startedAt":"2019-05-05T02:39:31Z","lastAt":"2019-05-05T06:32:31Z","messageCount":2,"participants":["Boxuan Li","Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"374901","messageId":"20190505023852.33986-1-liboxuan@connect.hku.hk","threadId":"51033","inReplyTo":null,"subject":"[PATCH] t4253-am-keep-cr-dos: avoid using pipes","fromName":"Boxuan Li","fromEmail":"liboxuan@connect.hku.hk","sentAt":"2019-05-05T02:38:52Z","receivedAt":"2019-05-05T02:39:31Z","isPatch":true,"sender":{"key":"liboxuan@connect.hku.hk","avatar":"https://avatars.githubusercontent.com/u/25746010?v=4"},"body":"The exit code of the upstream in a pipe is ignored thus we should avoid\nusing it. By writing out the output of the git command to a file, we can\ntest the exit codes of both the commands.\n\nSigned-off-by: Boxuan Li <liboxuan@connect.hku.hk>\n---\n t/t4253-am-keep-cr-dos.sh | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t4253-am-keep-cr-dos.sh b/t/t4253-am-keep-cr-dos.sh\nindex 553fe3e88e..5408c23dca 100755\n--- a/t/t4253-am-keep-cr-dos.sh\n+++ b/t/t4253-am-keep-cr-dos.sh\n@@ -51,14 +51,16 @@ test_expect_success 'am with dos files without --keep-cr' '\n \n test_expect_success 'am with dos files with --keep-cr' '\n \tgit checkout -b dosfiles-keep-cr initial &&\n-\tgit format-patch -k --stdout initial..master | git am --keep-cr -k -3 &&\n+\tgit format-patch -k --stdout initial..master > actual &&\n+\tgit am --keep-cr -k -3 actual &&\n \tgit diff --exit-code master\n '\n \n test_expect_success 'am with dos files config am.keepcr' '\n \tgit config am.keepcr 1 &&\n \tgit checkout -b dosfiles-conf-keepcr initial &&\n-\tgit format-patch -k --stdout initial..master | git am -k -3 &&\n+\tgit format-patch -k --stdout initial..master > actual &&\n+\tgit am -k -3 actual &&\n \tgit diff --exit-code master\n '\n \n-- \n2.21.0.777.g83232e3864\n\n"},{"id":"374906","messageId":"CAPig+cRuiXh2NgTt1_-en=AzYEsu1P1HgDLo=PFgzZiVxSRDqg@mail.gmail.com","threadId":"51033","inReplyTo":"20190505023852.33986-1-liboxuan@connect.hku.hk","subject":"Re: [PATCH] t4253-am-keep-cr-dos: avoid using pipes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2019-05-05T06:32:19Z","receivedAt":"2019-05-05T06:32:31Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, May 4, 2019 at 10:39 PM Boxuan Li <liboxuan@connect.hku.hk> wrote:\n> The exit code of the upstream in a pipe is ignored thus we should avoid\n> using it. By writing out the output of the git command to a file, we can\n> test the exit codes of both the commands.\n>\n> Signed-off-by: Boxuan Li <liboxuan@connect.hku.hk>\n> ---\n> diff --git a/t/t4253-am-keep-cr-dos.sh b/t/t4253-am-keep-cr-dos.sh\n> @@ -51,14 +51,16 @@ test_expect_success 'am with dos files without --keep-cr' '\n>  test_expect_success 'am with dos files with --keep-cr' '\n>         git checkout -b dosfiles-keep-cr initial &&\n> -       git format-patch -k --stdout initial..master | git am --keep-cr -k -3 &&\n> +       git format-patch -k --stdout initial..master > actual &&\n> +       git am --keep-cr -k -3 actual &&\n\nStyle nit: In this codebase, the space is omitted after the\nredirection operator (i.e. >actual).\n\nNit: Given that the name \"actual\" is typically used in conjunction\nwith an \"expect\" (or \"expected\") file, its use here is somewhat\nunexpected. Other possible names which might be more meaningful\ninclude \"patches\" and \"output\".\n\n>         git diff --exit-code master\n>  '\n"}]}