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

Re: Bypassing hooks while cherry-picking

From
Grégoire PARIS <postmaster@greg0ire.fr>
Date
Mar 3, 2016, 22:18 UTC
Message-ID
<56D8B835.5040407@greg0ire.fr>
In-Reply-To
<20160303211738.GA26609@ikke.info>
Oh great, glad to see that, good job!
greg0ire
Le 03/03/2016 22:17, Kevin Daudt a écrit :
Show 37 quoted lines
> On Tue, Mar 01, 2016 at 12:01:53PM +0100, greg0ire wrote:
>> Hello,
>>
>> using git 2.1.4 here, and it seems there is no option to bypass pre-commit
>> hooks while cherry-picking, while git commit provides a --no-verify option.
>> I ended up doing this to disable hooks while cherry picking :
>>
>>      test -f "$GIT_DIR"/CHERRY_PICK_HEAD && exit 0
>>
>> Wouldn't it be best to add the --no-verify option to cherry-pick too?
>> I had a conflict when cherry-picking the commit, maybe this does not happen
>> otherwise?
>>
>> Steps to reproduce :
>>
>> 1. create a pre-commit hook
>> 2. create a commit that fails the hook, and bypass the hook
>> 3. checkout another branch
>> 4. might be optional : create a conflicting change with the previously
>> created commit
>> 5. cherry-pick the commit
>> 6. might be optional : solve the conflick and use git cherry-pick --continue
>>
>> Regards,
>>
>> --
>> greg0ire
> Forgot to CC you, but I've submitted a patch[0] that adds this option.
> The conflict does matter because otherwise the pre-commit hook does not
> run.
>
> Because they're now the rc-cycle, it might take a while before the patch
> is accepted.
>
>
> [0]:http://article.gmane.org/gmane.comp.version-control.git/288124
>
Previous: Kevin DaudtNext: Junio C Hamano
Message 6 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.