git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Kevin Daudt <me@ikke.info>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH] cherry-pick: add --no-verify option
Date: Tue, 1 Mar 2016 19:33:12 -0500	[thread overview]
Message-ID: <CAPig+cTT11J00aRO1gO06O6j5zdf4y6XRJhG5X7ZFeP6n7TOGQ@mail.gmail.com> (raw)
In-Reply-To: <1456864846-14185-1-git-send-email-me@ikke.info>

On Tue, Mar 1, 2016 at 3:40 PM, Kevin Daudt <me@ikke.info> wrote:
> git commit has a --no-verify option to prevent the pre-commit hook from
> running. When continuing a conflicted cherry-pick, git commit gets
> executed which also causes the pre-commit hook to be run.
>
> Add --no-verify and pass that through to the git commit command so that
> the can prevent that from happening
>
> Signed-off-by: Kevin Daudt <me@ikke.info>
> ---
> diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh
> @@ -340,6 +340,18 @@ test_expect_success '--continue after resolving conflicts and committing' '
> +test_expect_success '--continue --no-verify does not run pre-commit hook ' '
> +       pristine_detach initial &&
> +       mkdir -p .git/hooks &&
> +       echo -e "#!/bin/sh\nexit 1" >.git/hooks/pre-commit &&

Non-portable 'echo'. You could use printf instead, however, even
better would be to use write_script() along with a here-doc (then you
could drop the 'chmod' also).

> +       chmod u+x .git/hooks/pre-commit &&
> +       test_when_finished "rm -r .git/hooks/" &&
> +
> +       test_must_fail git cherry-pick picked &&
> +       git add foo &&
> +       git cherry-pick --continue --no-verify
> +'

  reply	other threads:[~2016-03-02  0:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 11:01 Bypassing hooks while cherry-picking greg0ire
2016-03-01 20:40 ` [PATCH] cherry-pick: add --no-verify option Kevin Daudt
2016-03-02  0:33   ` Eric Sunshine [this message]
2016-03-02 11:58   ` [PATCH v2] " Kevin Daudt
2016-03-03 21:17 ` Bypassing hooks while cherry-picking Kevin Daudt
2016-03-03 22:18   ` Grégoire PARIS
2016-03-03 21:30 ` Junio C Hamano
2016-03-03 22:20   ` Grégoire PARIS
2016-03-03 22:55     ` Junio C Hamano
2016-03-03 23:18       ` Grégoire PARIS

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=CAPig+cTT11J00aRO1gO06O6j5zdf4y6XRJhG5X7ZFeP6n7TOGQ@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=me@ikke.info \
    /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;
as well as URLs for NNTP newsgroup(s).