From: Eric Sunshine Date: Wed, 02 Mar 2016 00:33:12 GMT Subject: Re: [PATCH] cherry-pick: add --no-verify option Message-ID: In-Reply-To: <1456864846-14185-1-git-send-email-me@ikke.info> On Tue, Mar 1, 2016 at 3:40 PM, Kevin Daudt 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 > --- > 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 > +'