git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "David Bimmler via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,  David Bimmler <david.bimmler@isovalent.com>
Subject: Re: [PATCH] sequencer: honor signoff opt in run_git_commit
Date: Thu, 04 Apr 2024 09:45:50 -0700	[thread overview]
Message-ID: <xmqqr0fl13gh.fsf@gitster.g> (raw)
In-Reply-To: <xmqqzfu914jc.fsf@gitster.g> (Junio C. Hamano's message of "Thu, 04 Apr 2024 09:22:31 -0700")

Junio C Hamano <gitster@pobox.com> writes:

>> +	git cat-file commit HEAD | sed -e "1,/^\$/d" >actual &&
>> +	test_cmp expected-signed-after-conflict actual
>
> Running any git command on the left hand side of a pipe is frowned
> upon, as it will hide exit status from it when it fails.
>
> In this case, the primary thing we care about is that we have added
> the sign off that did not exist in the original, so I wonder
>
> 	git cat-file commit HEAD >actual &&
> 	test_grep "Signed-off-by: " actual
>
> would be sufficient?

The answer is No.  It is plausible that somebody else in a future
may think that a better fix is to always prepare the final commit
message inside sequencer.c and call append_signoff(), and use it in
both the "in-process commit" codepath in try_to_commit() and in the
code that was fixed in the patch we are discussing.  If such a
future update is done carelessly, we might end up adding duplicate
sign off.  A "at least one instance must be there" test_grep would
not be a good tool to catch such a breakage.

	git show -s --format=%B HEAD >actual &&
	test_cmp expect actual

may be a good replacement.

But having said that, and then after having looked at the existing
tests in the file, I see that it is littered with the same "do not
run git on the upstream of the pipe" violation.  So let's not worry
about this one.  The whole t3428 script needs to be cleaned up after
the dust settles.

Thanks.


  reply	other threads:[~2024-04-04 16:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04  9:39 [PATCH] sequencer: honor signoff opt in run_git_commit David Bimmler via GitGitGadget
2024-04-04 16:22 ` Junio C Hamano
2024-04-04 16:45   ` Junio C Hamano [this message]
2024-04-04 19:22     ` Phillip Wood
2024-04-04 19:21   ` Phillip Wood
2024-04-05 11:50     ` David Bimmler

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqr0fl13gh.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=david.bimmler@isovalent.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).