git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: chizobajames21@gmail.com
Cc: git@vger.kernel.org,  phillip.wood@dunelm.org.uk,  ps@pks.im
Subject: Re: [Outreachy][PATCH v3] t6050: avoid pipes with downstream Git commands
Date: Fri, 11 Oct 2024 09:02:54 -0700	[thread overview]
Message-ID: <xmqq8quuiq4x.fsf@gitster.g> (raw)
In-Reply-To: <20241011154555.584917-1-chizobajames21@gmail.com> (chizobajames's message of "Fri, 11 Oct 2024 16:45:55 +0100")

chizobajames21@gmail.com writes:

> From: Chizoba ODINAKA <chizobajames21@gmail.com>
>
> In pipes, the exit code of a chain of commands is determined by
> the final command. In order not to miss the exit code of a failed
> Git command, avoid pipes instead write output of Git commands
> into a file.
> For better debugging experience, instances of "grep" were changed
> to "test_grep". "test_grep" provides more context in case of a
> failed "grep".
>
> Signed-off-by: Chizoba ODINAKA <chizobajames21@gmail.com>
> ---
> Changes in v3:
> - remove some duplicated lines of code
> - fixed some typo, an ommitted input redirection sign, <,
>   and another omitted logic negation operator, !

I'd suggest looking at your commit title again.  "with downstream
Git commands" sounds like the git being tested is at the tail, not
in front, of a pipeline, which would be perfectly OK arrangement to
see what its exit status is.

The updated patch does indeed use such a construct, e.g.

> +	git cat-file commit $HASH2 >actual &&
> +	test_grep "author A U Thor" actual &&
> +	R=$(sed -e "s/A U/O/" actual | git hash-object -t commit --stdin -w) &&

here.

    Subject: [Outreachy][PATCH v3] t6050: don't lose exit status of Git to pipes

or something, perhaps.

Other than that, looking very good.  Big thanks to all of you.


  reply	other threads:[~2024-10-11 16:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08 16:21 [Outreachy][PATCH] t6050: avoid pipes in git related commands chizobajames21
2024-10-09  7:28 ` Patrick Steinhardt
2024-10-10  7:26   ` Chizoba ODINAKA
2024-10-10  6:39 ` [Outreachy][PATCH v2] t6050: avoid pipes with downstream Git commands chizobajames21
2024-10-10 14:08   ` Phillip Wood
2024-10-10 18:51     ` Chizoba ODINAKA
2024-10-11  9:17       ` phillip.wood123
2024-10-11 15:45   ` [Outreachy][PATCH v3] " chizobajames21
2024-10-11 16:02     ` Junio C Hamano [this message]
2024-10-11 16:03     ` Eric Sunshine
2024-10-11 17:49       ` Junio C Hamano
2024-10-11 23:59         ` [Outreachy][PATCH v4] t6050: avoid pipes with upstream " chizobajames21
2024-10-12  5:35           ` Eric Sunshine
2024-10-12  6:28             ` Chizoba ODINAKA
2024-10-12  6:21           ` [Outreachy][PATCH v5] " chizobajames21
2024-10-14 14:00             ` Phillip Wood
2024-10-14 15:27               ` Chizoba ODINAKA
2024-10-14 15:24             ` [Outreachy][PATCH v6] " chizobajames21
2024-10-14 21:57               ` Taylor Blau
2024-10-15 11:07                 ` Chizoba ODINAKA
2024-10-15 11:26                   ` [Outreachy][PATCH v7] " chizobajames21
2024-10-22  1:27               ` chizobajames21
2024-10-22  1:37                 ` Chizoba ODINAKA
2024-10-22  5:02                 ` Patrick Steinhardt
2024-10-22 16:48                   ` Taylor Blau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq8quuiq4x.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=chizobajames21@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).