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

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

On Tue, Nov 29, 2022 at 10:20:05AM +0900, Junio C Hamano wrote:
> Thierry Reding <thierry.reding@gmail.com> writes:
> 
> > +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
> > +'
> > +
> >  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
> > +'
> > +
> >  test_expect_success 'am with post-applypatch hook' '
> >  	rm -fr .git/rebase-apply &&
> >  	git reset --hard &&
> 
> These two tests will still pass if you change the implementation to
> run the hook and simply ignore its exit status, but I recall you
> making a good argument against that alternative implementation ,in
> comparison to "not running the hook at all".
> 
> I think these tests should make sure that the hooks did not even
> run.  Perhaps by creating a marker file before running "git am",
> adding a "rm" that marker file in the hook, and making sure that
> the marker file still exists after "git am" returns, or something
> like that.

All good points. I've updated both tests to check that patches have been
applied correctly and that the scripts haven't been run.

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
2022-11-29  1:20 ` Junio C Hamano
2022-11-29 10:03   ` Thierry Reding [this message]

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=Y4XY/tUT+vKOrabX@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).