Re: [PATCH] cherry-pick: add --no-verify option
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Mar 2, 2016, 00:33 UTC
- Message-ID
- <CAPig+cTT11J00aRO1gO06O6j5zdf4y6XRJhG5X7ZFeP6n7TOGQ@mail.gmail.com>
- 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:
Show 15 quoted lines
> 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).
Show 7 quoted lines
> + 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 > +'