git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
> +'
Previous: Kevin DaudtNext: Kevin Daudt
Message 3 of 10 in “Bypassing hooks while cherry-picking”
  1. greg0ireMar 1, 2016
  2. cherry-pick: add --no-verify optionKevin Daudt, Mar 1, 2016
  3. Eric SunshineMar 2, 2016
  4. cherry-pick: add --no-verify optionKevin Daudt, Mar 2, 2016
  5. Kevin DaudtMar 3, 2016
  6. Grégoire PARISMar 3, 2016
  7. Junio C HamanoMar 3, 2016
  8. Grégoire PARISMar 3, 2016
  9. Junio C HamanoMar 3, 2016
  10. Grégoire PARISMar 3, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.