git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v3] am: Allow passing --no-verify flag
Date: Mon, 28 Nov 2022 18:07:38 -0500	[thread overview]
Message-ID: <Y4U/OhHSg85UV+5L@nand.local> (raw)
In-Reply-To: <20221128174825.1510407-1-thierry.reding@gmail.com>

Hi Thierry,

This is looking pretty good. Thanks for pushing out a couple of new
rounds. I took a look at the discussion and have some thoughts below,
but they are minor.

This will likely not be in the upcoming v2.39.0, since Junio has already
cut and pushed the first release candidate tag. But you should feel free
to keep working on it in the meantime and we can revisit it post-2.39.

On Mon, Nov 28, 2022 at 06:48:25PM +0100, Thierry Reding wrote:
> diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
> index 326276e51ce5..0c1dfb3c98b4 100644
> --- a/Documentation/git-am.txt
> +++ b/Documentation/git-am.txt
> @@ -9,7 +9,7 @@ git-am - Apply a series of patches from a mailbox
>  SYNOPSIS
>  --------
>  [verse]
> -'git am' [--signoff] [--keep] [--[no-]keep-cr] [--[no-]utf8]
> +'git am' [--signoff] [--keep] [--[no-]keep-cr] [--[no-]utf8] [--no-verify]

Spelling this as "[--no-verify]" and not "[--[no-]verify]" is right,
since the option itself is called "--no-verify" (and thus has the
OPT_NONEG flag bit set), and "--verify" does not exist. Good.

>  	 [--[no-]3way] [--interactive] [--committer-date-is-author-date]
>  	 [--ignore-date] [--ignore-space-change | --ignore-whitespace]
>  	 [--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
> @@ -138,6 +138,12 @@ include::rerere-options.txt[]
>  --interactive::
>  	Run interactively.
>
> +-n::
> +--no-verify::
> +	By default, the pre-applypatch and applypatch-msg hooks are run.
> +	When any of `--no-verify` or `-n` is given, these are bypassed.

Should we be more explicit here, given the discussion in the earlier
rounds? IOW, instead of saying that they are "bypassed" (which might
lead the reader to believe that they are run and their output/exit code
ignored), should we say that they are "not run" and be clearer?

The (elided) implementation below looks good to me.

> diff --git a/t/t4150-am.sh b/t/t4150-am.sh
> index cdad4b688078..84e6bebeca7a 100755
> --- a/t/t4150-am.sh
> +++ b/t/t4150-am.sh
> @@ -345,6 +345,16 @@ test_expect_success 'am with failing applypatch-msg hook' '
>  	test_cmp_rev first HEAD
>  '
>
> +test_expect_success 'am with failing applypatch-msg hook (no verify)' '
> +	rm -fr .git/rebase-apply &&
> +	git reset --hard &&
> +	git checkout first &&
> +	test_hook applypatch-msg <<-\EOF &&
> +	exit 1
> +	EOF
> +	git am --no-verify patch1

Should we verify that the patch was applied with the expected message?

> +'
> +
>  test_expect_success 'am with pre-applypatch hook' '
>  	rm -fr .git/rebase-apply &&
>  	git reset --hard &&
> @@ -374,6 +384,16 @@ test_expect_success 'am with failing pre-applypatch hook' '
>  	test_cmp_rev first HEAD
>  '
>
> +test_expect_success 'am with failing pre-applypatch hook (no verify)' '
> +	rm -fr .git/rebase-apply &&
> +	git reset --hard &&
> +	git checkout first &&
> +	test_hook pre-applypatch <<-\EOF &&
> +	exit 1
> +	EOF
> +	git am --no-verify patch1

Ditto here.

Thanks,
Taylor

  reply	other threads:[~2022-11-28 23:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 17:48 [PATCH v3] am: Allow passing --no-verify flag Thierry Reding
2022-11-28 23:07 ` Taylor Blau [this message]
2022-11-29 10:02   ` Thierry Reding
2022-11-29  1:20 ` Junio C Hamano
2022-11-29 10:03   ` Thierry Reding

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=Y4U/OhHSg85UV+5L@nand.local \
    --to=me@ttaylorr.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=thierry.reding@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).