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

[-- Attachment #1: Type: text/plain, Size: 3435 bytes --]

On Mon, Nov 28, 2022 at 06:07:38PM -0500, Taylor Blau wrote:
> 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.

That's fine. No rush. I've had local workarounds for this for a very
long time, so I can be patient for a little longer. =)

> 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?

I adopted the wording as for git commit and since the behavior is
exactly the same, it seemed best to stay consistent with that. My
interpretation of "bypassed" is equivalent to "unused" or "ignored",
though "ignored" in this case relating to their existence rather than
return value.

Either wording is fine with me, so if you feel strongly I can reword
this. In that case it might be worth updating the git commit
documentation as well to avoid the same ambiguity.

> 
> 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?

Yes, that's a good point. I've updated both tests to check that the
patch has been applied and the scripts haven't been run.

Thanks,
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-11-29 10:03 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
2022-11-29 10:02   ` Thierry Reding [this message]
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=Y4XYzPhZLhmoGzZT@orome \
    --to=thierry.reding@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.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).