git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t4253-am-keep-cr-dos: avoid using pipes

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 5, 2019, 06:32 UTC
Message-ID
<CAPig+cRuiXh2NgTt1_-en=AzYEsu1P1HgDLo=PFgzZiVxSRDqg@mail.gmail.com>
In-Reply-To
<20190505023852.33986-1-liboxuan@connect.hku.hk>
On Sat, May 4, 2019 at 10:39 PM Boxuan Li <liboxuan@connect.hku.hk> wrote:
Show 13 quoted lines
> The exit code of the upstream in a pipe is ignored thus we should avoid
> using it. By writing out the output of the git command to a file, we can
> test the exit codes of both the commands.
>
> Signed-off-by: Boxuan Li <liboxuan@connect.hku.hk>
> ---
> diff --git a/t/t4253-am-keep-cr-dos.sh b/t/t4253-am-keep-cr-dos.sh
> @@ -51,14 +51,16 @@ test_expect_success 'am with dos files without --keep-cr' '
>  test_expect_success 'am with dos files with --keep-cr' '
>         git checkout -b dosfiles-keep-cr initial &&
> -       git format-patch -k --stdout initial..master | git am --keep-cr -k -3 &&
> +       git format-patch -k --stdout initial..master > actual &&
> +       git am --keep-cr -k -3 actual &&

Style nit: In this codebase, the space is omitted after the redirection operator (i.e. >actual).

Nit: Given that the name "actual" is typically used in conjunction
with an "expect" (or "expected") file, its use here is somewhat
unexpected. Other possible names which might be more meaningful
include "patches" and "output".
>         git diff --exit-code master
>  '
Previous: Boxuan Li
Message 2 of 2 in “t4253-am-keep-cr-dos: avoid using pipes”
  1. t4253-am-keep-cr-dos: avoid using pipesBoxuan Li, May 5, 2019
  2. Eric SunshineMay 5, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.