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

Re: [PATCH v2] t9116: avoid using pipes

From
Christian Couder <christian.couder@gmail.com>
Date
Mar 24, 2020, 18:34 UTC
Message-ID
<CAP8UFD2Uu-dPJcZB--T7k0tMuXc0iVeqnMUn3Y_x+3iaFf9xFQ@mail.gmail.com>
In-Reply-To
<20200324093502.32394-1-shanthanu.s.rai9@gmail.com>
On Tue, Mar 24, 2020 at 10:36 AM Shanthanu <shanthanu.s.rai9@gmail.com> wrote:
Show 10 quoted lines
>
> Commit c6f44e1da5 (t9813: avoid using pipes, 2017-01-04) recommends to
> avoid using pipes, since the exit code of upstream in the pipe is
> ignored. Hence, redirect the output to a file and parse that file.
>
> Commit de26f02db1 (t9001, t9116: avoid pipes, 2020-02-14) noted that
> this also allows easy debugging in case the test fails, since the file
> will be left on disk and can be manually inspected.
>
> Signed-off-by: Shanthanu <shanthanu.s.rai9@gmail.com>

We usually ask for a legal name in a format similar to "<Firstname> <MaybeMiddleNameInitial> <Lastname>" where <MaybeMiddleNameInitial> can be omitted. The name should also match what is in the "From:" field of the emails you send.

Show 17 quoted lines
> ---
>  t/t9116-git-svn-log.sh | 53 +++++++++++++++++++++++++++++++-----------
>  1 file changed, 39 insertions(+), 14 deletions(-)
>
> diff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh
> index 0a9f1ef366..56d68e4aed 100755
> --- a/t/t9116-git-svn-log.sh
> +++ b/t/t9116-git-svn-log.sh
> @@ -61,12 +61,16 @@ printf 'r1 \nr2 \nr4 \n' > expected-range-r1-r2-r4
>
>  test_expect_success 'test ascending revision range' "
>         git reset --hard origin/trunk &&
> -       git svn log -r 1:4 | grep '^r[0-9]' | cut -d'|' -f1 | test_cmp expected-range-r1-r2-r4 -
> +       git svn log -r 1:4 >out &&
> +       grep '^r[0-9]' out | cut -d'|' -f1 >actual &&
> +       test_cmp expected-range-r1-r2-r4 actual
>         "

It seems that the code that your patch changes is repeated a lot in this test script. I wonder if it would be better to write a shell function to avoid those repetitions.

Previous: ShanthanuNext: Shanthanu
Message 6 of 7 in “Microproject Submission”
  1. ShanthanuMar 22, 2020
  2. [GSoC][PATCH 1/1] t9116: avoid using pipesShanthanu, Mar 22, 2020
  3. Torsten BögershausenMar 22, 2020
  4. ShanthanuMar 23, 2020
  5. t9116: avoid using pipesShanthanu, Mar 24, 2020
  6. Christian CouderMar 24, 2020
  7. ShanthanuMar 25, 2020

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.