public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Francesco Paparatto <francescopaparatto@gmail.com>
Cc: sunshine@sunshineco.com,  git@vger.kernel.org
Subject: Re: [PATCH v2] t3310: avoid hiding failures from rev-parse in command substitutions
Date: Thu, 05 Mar 2026 11:13:15 -0800	[thread overview]
Message-ID: <xmqq5x7a3x9w.fsf@gitster.g> (raw)
In-Reply-To: <20260305090602.22436-1-francescopaparatto@gmail.com> (Francesco Paparatto's message of "Thu, 5 Mar 2026 10:06:02 +0100")

Francesco Paparatto <francescopaparatto@gmail.com> writes:

> Running `git` commands inside command substitutions like
>
> 	test "$(git rev-parse A)" = "$(git rev-parse B)"
>
> can hide failures from the `git` invocations and provide little
> diagnostic information when `test` fails.
>
> Use `test_cmp` when comparing against a stored expected value so
> mismatches show both expected and actual output. Use `test_cmp_rev`
> when comparing two revisions. These helpers produce clearer failure
> output, making it easier to understand what went wrong.
>
> Suggested-by: Junio C Hamano <gitster@pobox.com>

Hmph, did I suggest this?  I know Eric had comments on a previous
round, and the improvements in this patch seems to be influenced a
lot stronger by his input than whatever I may have said.

> Signed-off-by: Francesco Paparatto <francescopaparatto@gmail.com>
> ---
>  t/t3310-notes-merge-manual-resolve.sh | 60 ++++++++++++---------------
>  1 file changed, 27 insertions(+), 33 deletions(-)
>
> diff --git a/t/t3310-notes-merge-manual-resolve.sh b/t/t3310-notes-merge-manual-resolve.sh
> index 92a5951331..64c0a753ff 100755

On top of what commit is this patch designed to apply?

Thanks.

  reply	other threads:[~2026-03-05 19:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04 12:19 [PATCH] t3310: avoid hiding failures from rev-parse in command substitutions Francesco Paparatto
2026-03-04 22:21 ` Eric Sunshine
2026-03-05  9:06   ` [PATCH v2] " Francesco Paparatto
2026-03-05 19:13     ` Junio C Hamano [this message]
2026-03-05 22:34       ` Eric Sunshine
2026-03-05 22:49         ` Francesco Paparatto
2026-03-05 23:06         ` Junio C Hamano
2026-03-05 23:14           ` Junio C Hamano
2026-03-05 22:42       ` Francesco Paparatto
2026-03-05 22:51         ` [PATCH v3] " Francesco Paparatto
2026-03-07  6:29           ` Eric Sunshine
2026-03-07 10:17             ` Francesco Paparatto
2026-03-07 10:36           ` [PATCH v4] " Francesco Paparatto
2026-03-08  4:13             ` Eric Sunshine
2026-03-08  6:04               ` Junio C Hamano

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=xmqq5x7a3x9w.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=francescopaparatto@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sunshine@sunshineco.com \
    /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