{"thread":{"id":"41579","subject":"Bypassing hooks while cherry-picking","startedAt":"2016-03-01T11:01:53Z","lastAt":"2016-03-03T23:18:57Z","messageCount":10,"participants":["greg0ire","Kevin Daudt","Eric Sunshine","Junio C Hamano","Grégoire PARIS"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"279949","messageId":"56D576A1.3020202@greg0ire.fr","threadId":"41579","inReplyTo":null,"subject":"Bypassing hooks while cherry-picking","fromName":"greg0ire","fromEmail":"postmaster@greg0ire.fr","sentAt":"2016-03-01T11:01:53Z","receivedAt":"2016-03-01T11:01:53Z","isPatch":false,"sender":{"key":"postmaster@greg0ire.fr","avatar":"https://avatars.githubusercontent.com/u/657779?v=4"},"body":"Hello,\n\nusing git 2.1.4 here, and it seems there is no option to bypass \npre-commit hooks while cherry-picking, while git commit provides a \n--no-verify option. I ended up doing this to disable hooks while cherry \npicking :\n\n     test -f \"$GIT_DIR\"/CHERRY_PICK_HEAD && exit 0\n\nWouldn't it be best to add the --no-verify option to cherry-pick too?\nI had a conflict when cherry-picking the commit, maybe this does not \nhappen otherwise?\n\nSteps to reproduce :\n\n1. create a pre-commit hook\n2. create a commit that fails the hook, and bypass the hook\n3. checkout another branch\n4. might be optional : create a conflicting change with the previously \ncreated commit\n5. cherry-pick the commit\n6. might be optional : solve the conflick and use git cherry-pick --continue\n\nRegards,\n\n--\ngreg0ire\n"},{"id":"280003","messageId":"1456864846-14185-1-git-send-email-me@ikke.info","threadId":"41579","inReplyTo":"56D576A1.3020202@greg0ire.fr","subject":"[PATCH] cherry-pick: add --no-verify option","fromName":"Kevin Daudt","fromEmail":"me@ikke.info","sentAt":"2016-03-01T20:40:46Z","receivedAt":"2016-03-01T20:40:46Z","isPatch":true,"sender":{"key":"me@ikke.info","avatar":"https://avatars.githubusercontent.com/u/135698?v=4"},"body":"git commit has a --no-verify option to prevent the pre-commit hook from\nrunning. When continuing a conflicted cherry-pick, git commit gets\nexecuted which also causes the pre-commit hook to be run.\n\nAdd --no-verify and pass that through to the git commit command so that\nthe can prevent that from happening\n\nSigned-off-by: Kevin Daudt <me@ikke.info>\n---\n builtin/revert.c                |  2 ++\n sequencer.c                     | 21 ++++++++++++++++-----\n sequencer.h                     |  1 +\n t/t3510-cherry-pick-sequence.sh | 12 ++++++++++++\n 4 files changed, 31 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 56a2c36..81d9c85 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -97,6 +97,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \t\tOPT_END(),\n \t\tOPT_END(),\n \t\tOPT_END(),\n+\t\tOPT_END(),\n \t};\n \n \tif (opts->action == REPLAY_PICK) {\n@@ -106,6 +107,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \t\t\tOPT_BOOL(0, \"allow-empty\", &opts->allow_empty, N_(\"preserve initially empty commits\")),\n \t\t\tOPT_BOOL(0, \"allow-empty-message\", &opts->allow_empty_message, N_(\"allow commits with empty messages\")),\n \t\t\tOPT_BOOL(0, \"keep-redundant-commits\", &opts->keep_redundant_commits, N_(\"keep redundant, empty commits\")),\n+\t\t\tOPT_BOOL(0, \"no-verify\", &opts->no_verify, N_(\"don't run pre-commit hook when continuing cherry-pick\")),\n \t\t\tOPT_END(),\n \t\t};\n \t\tif (parse_options_concat(options, ARRAY_SIZE(options), cp_extra))\ndiff --git a/sequencer.c b/sequencer.c\nindex e66f2fe..657a381 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -978,14 +978,25 @@ static int pick_commits(struct commit_list *todo_list, struct replay_opts *opts)\n \treturn 0;\n }\n \n-static int continue_single_pick(void)\n+static int continue_single_pick(struct replay_opts *opts)\n {\n-\tconst char *argv[] = { \"commit\", NULL };\n+\tstruct argv_array array;\n+\tint rc;\n+\n+\targv_array_init(&array);\n+\targv_array_push(&array, \"commit\");\n \n \tif (!file_exists(git_path_cherry_pick_head()) &&\n \t    !file_exists(git_path_revert_head()))\n \t\treturn error(_(\"no cherry-pick or revert in progress\"));\n-\treturn run_command_v_opt(argv, RUN_GIT_CMD);\n+\n+\tif (opts->no_verify)\n+\t\targv_array_push(&array, \"--no-verify\");\n+\n+\trc = run_command_v_opt(array.argv, RUN_GIT_CMD);\n+\targv_array_clear(&array);\n+\n+\treturn rc;\n }\n \n static int sequencer_continue(struct replay_opts *opts)\n@@ -993,14 +1004,14 @@ static int sequencer_continue(struct replay_opts *opts)\n \tstruct commit_list *todo_list = NULL;\n \n \tif (!file_exists(git_path_todo_file()))\n-\t\treturn continue_single_pick();\n+\t\treturn continue_single_pick(opts);\n \tread_populate_opts(&opts);\n \tread_populate_todo(&todo_list, opts);\n \n \t/* Verify that the conflict has been resolved */\n \tif (file_exists(git_path_cherry_pick_head()) ||\n \t    file_exists(git_path_revert_head())) {\n-\t\tint ret = continue_single_pick();\n+\t\tint ret = continue_single_pick(opts);\n \t\tif (ret)\n \t\t\treturn ret;\n \t}\ndiff --git a/sequencer.h b/sequencer.h\nindex 5ed5cb1..d868a50 100644\n--- a/sequencer.h\n+++ b/sequencer.h\n@@ -34,6 +34,7 @@ struct replay_opts {\n \tint allow_empty;\n \tint allow_empty_message;\n \tint keep_redundant_commits;\n+\tint no_verify;\n \n \tint mainline;\n \ndiff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh\nindex 7b7a89d..29a06f8 100755\n--- a/t/t3510-cherry-pick-sequence.sh\n+++ b/t/t3510-cherry-pick-sequence.sh\n@@ -340,6 +340,18 @@ test_expect_success '--continue after resolving conflicts and committing' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success '--continue --no-verify does not run pre-commit hook ' '\n+\tpristine_detach initial &&\n+\tmkdir -p .git/hooks &&\n+\techo -e \"#!/bin/sh\\nexit 1\" >.git/hooks/pre-commit &&\n+\tchmod u+x .git/hooks/pre-commit &&\n+\ttest_when_finished \"rm -r .git/hooks/\" &&\n+\n+\ttest_must_fail git cherry-pick picked &&\n+\tgit add foo &&\n+\tgit cherry-pick --continue --no-verify\n+'\n+\n test_expect_success '--continue asks for help after resolving patch to nil' '\n \tpristine_detach conflicting &&\n \ttest_must_fail git cherry-pick initial..picked &&\n-- \n2.7.2\n"},{"id":"280024","messageId":"CAPig+cTT11J00aRO1gO06O6j5zdf4y6XRJhG5X7ZFeP6n7TOGQ@mail.gmail.com","threadId":"41579","inReplyTo":"1456864846-14185-1-git-send-email-me@ikke.info","subject":"Re: [PATCH] cherry-pick: add --no-verify option","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2016-03-02T00:33:12Z","receivedAt":"2016-03-02T00:33:12Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Mar 1, 2016 at 3:40 PM, Kevin Daudt <me@ikke.info> wrote:\n> git commit has a --no-verify option to prevent the pre-commit hook from\n> running. When continuing a conflicted cherry-pick, git commit gets\n> executed which also causes the pre-commit hook to be run.\n>\n> Add --no-verify and pass that through to the git commit command so that\n> the can prevent that from happening\n>\n> Signed-off-by: Kevin Daudt <me@ikke.info>\n> ---\n> diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh\n> @@ -340,6 +340,18 @@ test_expect_success '--continue after resolving conflicts and committing' '\n> +test_expect_success '--continue --no-verify does not run pre-commit hook ' '\n> +       pristine_detach initial &&\n> +       mkdir -p .git/hooks &&\n> +       echo -e \"#!/bin/sh\\nexit 1\" >.git/hooks/pre-commit &&\n\nNon-portable 'echo'. You could use printf instead, however, even\nbetter would be to use write_script() along with a here-doc (then you\ncould drop the 'chmod' also).\n\n> +       chmod u+x .git/hooks/pre-commit &&\n> +       test_when_finished \"rm -r .git/hooks/\" &&\n> +\n> +       test_must_fail git cherry-pick picked &&\n> +       git add foo &&\n> +       git cherry-pick --continue --no-verify\n> +'\n"},{"id":"280062","messageId":"1456919906-9747-1-git-send-email-me@ikke.info","threadId":"41579","inReplyTo":"1456864846-14185-1-git-send-email-me@ikke.info","subject":"[PATCH v2] cherry-pick: add --no-verify option","fromName":"Kevin Daudt","fromEmail":"me@ikke.info","sentAt":"2016-03-02T11:58:26Z","receivedAt":"2016-03-02T11:58:26Z","isPatch":true,"sender":{"key":"me@ikke.info","avatar":"https://avatars.githubusercontent.com/u/135698?v=4"},"body":"git commit has a --no-verify option to prevent the pre-commit hook from\nrunning. When continuing a conflicted cherry-pick, git commit gets\nexecuted which also causes the pre-commit hook to be run.\n\nAdd --no-verify and pass that through to the git commit command.\n\nSigned-off-by: Kevin Daudt <me@ikke.info>\n---\nChanges since v1:\n- Use write_script to create hook\n- Add option to cherry-pick man page\n\n Documentation/git-cherry-pick.txt |  5 +++++\n builtin/revert.c                  |  2 ++\n sequencer.c                       | 21 ++++++++++++++++-----\n sequencer.h                       |  1 +\n t/t3510-cherry-pick-sequence.sh   | 14 ++++++++++++++\n 5 files changed, 38 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt\nindex 6154e57..30bbdbd 100644\n--- a/Documentation/git-cherry-pick.txt\n+++ b/Documentation/git-cherry-pick.txt\n@@ -148,6 +148,11 @@ effect to your index in a row.\n \tPass the merge strategy-specific option through to the\n \tmerge strategy.  See linkgit:git-merge[1] for details.\n \n+--no-verify::\n+\tPass --no-verify to the commit command when continuing after a\n+\tconflicted cherry-pick to disable any pre-commit hooks that\n+\tmight get run.\n+\n SEQUENCER SUBCOMMANDS\n ---------------------\n include::sequencer.txt[]\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 56a2c36..81d9c85 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -97,6 +97,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \t\tOPT_END(),\n \t\tOPT_END(),\n \t\tOPT_END(),\n+\t\tOPT_END(),\n \t};\n \n \tif (opts->action == REPLAY_PICK) {\n@@ -106,6 +107,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \t\t\tOPT_BOOL(0, \"allow-empty\", &opts->allow_empty, N_(\"preserve initially empty commits\")),\n \t\t\tOPT_BOOL(0, \"allow-empty-message\", &opts->allow_empty_message, N_(\"allow commits with empty messages\")),\n \t\t\tOPT_BOOL(0, \"keep-redundant-commits\", &opts->keep_redundant_commits, N_(\"keep redundant, empty commits\")),\n+\t\t\tOPT_BOOL(0, \"no-verify\", &opts->no_verify, N_(\"don't run pre-commit hook when continuing cherry-pick\")),\n \t\t\tOPT_END(),\n \t\t};\n \t\tif (parse_options_concat(options, ARRAY_SIZE(options), cp_extra))\ndiff --git a/sequencer.c b/sequencer.c\nindex e66f2fe..657a381 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -978,14 +978,25 @@ static int pick_commits(struct commit_list *todo_list, struct replay_opts *opts)\n \treturn 0;\n }\n \n-static int continue_single_pick(void)\n+static int continue_single_pick(struct replay_opts *opts)\n {\n-\tconst char *argv[] = { \"commit\", NULL };\n+\tstruct argv_array array;\n+\tint rc;\n+\n+\targv_array_init(&array);\n+\targv_array_push(&array, \"commit\");\n \n \tif (!file_exists(git_path_cherry_pick_head()) &&\n \t    !file_exists(git_path_revert_head()))\n \t\treturn error(_(\"no cherry-pick or revert in progress\"));\n-\treturn run_command_v_opt(argv, RUN_GIT_CMD);\n+\n+\tif (opts->no_verify)\n+\t\targv_array_push(&array, \"--no-verify\");\n+\n+\trc = run_command_v_opt(array.argv, RUN_GIT_CMD);\n+\targv_array_clear(&array);\n+\n+\treturn rc;\n }\n \n static int sequencer_continue(struct replay_opts *opts)\n@@ -993,14 +1004,14 @@ static int sequencer_continue(struct replay_opts *opts)\n \tstruct commit_list *todo_list = NULL;\n \n \tif (!file_exists(git_path_todo_file()))\n-\t\treturn continue_single_pick();\n+\t\treturn continue_single_pick(opts);\n \tread_populate_opts(&opts);\n \tread_populate_todo(&todo_list, opts);\n \n \t/* Verify that the conflict has been resolved */\n \tif (file_exists(git_path_cherry_pick_head()) ||\n \t    file_exists(git_path_revert_head())) {\n-\t\tint ret = continue_single_pick();\n+\t\tint ret = continue_single_pick(opts);\n \t\tif (ret)\n \t\t\treturn ret;\n \t}\ndiff --git a/sequencer.h b/sequencer.h\nindex 5ed5cb1..d868a50 100644\n--- a/sequencer.h\n+++ b/sequencer.h\n@@ -34,6 +34,7 @@ struct replay_opts {\n \tint allow_empty;\n \tint allow_empty_message;\n \tint keep_redundant_commits;\n+\tint no_verify;\n \n \tint mainline;\n \ndiff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh\nindex 7b7a89d..a97ee52 100755\n--- a/t/t3510-cherry-pick-sequence.sh\n+++ b/t/t3510-cherry-pick-sequence.sh\n@@ -340,6 +340,20 @@ test_expect_success '--continue after resolving conflicts and committing' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success '--continue --no-verify does not run pre-commit hook ' '\n+\tpristine_detach initial &&\n+\n+\tmkdir -p .git/hooks &&\n+\twrite_script .git/hooks/pre-commit <<-\\EOF &&\n+\t\texit 1\n+\tEOF\n+\ttest_when_finished \"rm -r .git/hooks/\" &&\n+\n+\ttest_must_fail git cherry-pick picked &&\n+\tgit add foo &&\n+\tgit cherry-pick --continue --no-verify\n+'\n+\n test_expect_success '--continue asks for help after resolving patch to nil' '\n \tpristine_detach conflicting &&\n \ttest_must_fail git cherry-pick initial..picked &&\n-- \n2.7.2\n"},{"id":"280148","messageId":"20160303211738.GA26609@ikke.info","threadId":"41579","inReplyTo":"56D576A1.3020202@greg0ire.fr","subject":"Re: Bypassing hooks while cherry-picking","fromName":"Kevin Daudt","fromEmail":"me@ikke.info","sentAt":"2016-03-03T21:17:38Z","receivedAt":"2016-03-03T21:17:38Z","isPatch":false,"sender":{"key":"me@ikke.info","avatar":"https://avatars.githubusercontent.com/u/135698?v=4"},"body":"On Tue, Mar 01, 2016 at 12:01:53PM +0100, greg0ire wrote:\n> Hello,\n> \n> using git 2.1.4 here, and it seems there is no option to bypass pre-commit\n> hooks while cherry-picking, while git commit provides a --no-verify option.\n> I ended up doing this to disable hooks while cherry picking :\n> \n>     test -f \"$GIT_DIR\"/CHERRY_PICK_HEAD && exit 0\n> \n> Wouldn't it be best to add the --no-verify option to cherry-pick too?\n> I had a conflict when cherry-picking the commit, maybe this does not happen\n> otherwise?\n> \n> Steps to reproduce :\n> \n> 1. create a pre-commit hook\n> 2. create a commit that fails the hook, and bypass the hook\n> 3. checkout another branch\n> 4. might be optional : create a conflicting change with the previously\n> created commit\n> 5. cherry-pick the commit\n> 6. might be optional : solve the conflick and use git cherry-pick --continue\n> \n> Regards,\n> \n> --\n> greg0ire\n\nForgot to CC you, but I've submitted a patch[0] that adds this option.\nThe conflict does matter because otherwise the pre-commit hook does not\nrun.\n\nBecause they're now the rc-cycle, it might take a while before the patch\nis accepted.\n\n\n[0]:http://article.gmane.org/gmane.comp.version-control.git/288124\n"},{"id":"280149","messageId":"xmqqwppj1c83.fsf@gitster.mtv.corp.google.com","threadId":"41579","inReplyTo":"56D576A1.3020202@greg0ire.fr","subject":"Re: Bypassing hooks while cherry-picking","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-03T21:30:04Z","receivedAt":"2016-03-03T21:30:04Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"greg0ire <postmaster@greg0ire.fr> writes:\n\n> Steps to reproduce :\n>\n> 1. create a pre-commit hook\n> 2. create a commit that fails the hook, and bypass the hook\n> 3. checkout another branch\n> 4. might be optional : create a conflicting change with the previously\n> created commit\n> 5. cherry-pick the commit\n> 6. might be optional : solve the conflick and use git cherry-pick --continue\n\nWouldn't \"commit --no-verify\" at that last step, instead of\n\"cherry-pick --continue\", just work?\n"},{"id":"280155","messageId":"56D8B835.5040407@greg0ire.fr","threadId":"41579","inReplyTo":"20160303211738.GA26609@ikke.info","subject":"Re: Bypassing hooks while cherry-picking","fromName":"Grégoire PARIS","fromEmail":"postmaster@greg0ire.fr","sentAt":"2016-03-03T22:18:29Z","receivedAt":"2016-03-03T22:18:29Z","isPatch":false,"sender":{"key":"postmaster@greg0ire.fr","avatar":"https://avatars.githubusercontent.com/u/657779?v=4"},"body":"Oh great, glad to see that, good job!\n\ngreg0ire\n\nLe 03/03/2016 22:17, Kevin Daudt a écrit :\n> On Tue, Mar 01, 2016 at 12:01:53PM +0100, greg0ire wrote:\n>> Hello,\n>>\n>> using git 2.1.4 here, and it seems there is no option to bypass pre-commit\n>> hooks while cherry-picking, while git commit provides a --no-verify option.\n>> I ended up doing this to disable hooks while cherry picking :\n>>\n>>      test -f \"$GIT_DIR\"/CHERRY_PICK_HEAD && exit 0\n>>\n>> Wouldn't it be best to add the --no-verify option to cherry-pick too?\n>> I had a conflict when cherry-picking the commit, maybe this does not happen\n>> otherwise?\n>>\n>> Steps to reproduce :\n>>\n>> 1. create a pre-commit hook\n>> 2. create a commit that fails the hook, and bypass the hook\n>> 3. checkout another branch\n>> 4. might be optional : create a conflicting change with the previously\n>> created commit\n>> 5. cherry-pick the commit\n>> 6. might be optional : solve the conflick and use git cherry-pick --continue\n>>\n>> Regards,\n>>\n>> --\n>> greg0ire\n> Forgot to CC you, but I've submitted a patch[0] that adds this option.\n> The conflict does matter because otherwise the pre-commit hook does not\n> run.\n>\n> Because they're now the rc-cycle, it might take a while before the patch\n> is accepted.\n>\n>\n> [0]:http://article.gmane.org/gmane.comp.version-control.git/288124\n>\n"},{"id":"280154","messageId":"56D8B895.9030308@greg0ire.fr","threadId":"41579","inReplyTo":"xmqqwppj1c83.fsf@gitster.mtv.corp.google.com","subject":"Re: Bypassing hooks while cherry-picking","fromName":"Grégoire PARIS","fromEmail":"postmaster@greg0ire.fr","sentAt":"2016-03-03T22:20:05Z","receivedAt":"2016-03-03T22:20:05Z","isPatch":false,"sender":{"key":"postmaster@greg0ire.fr","avatar":"https://avatars.githubusercontent.com/u/657779?v=4"},"body":"Not sure how cherry-picking is managed, and whether commit is able to \nsee that we are doing a cherry-pick, and end it up properly. Anyway, \nwith Kevin's patch, we should be able to happily use cherry-pick\n\ngreg0ire\n\nLe 03/03/2016 22:30, Junio C Hamano a écrit :\n> greg0ire <postmaster@greg0ire.fr> writes:\n>\n>> Steps to reproduce :\n>>\n>> 1. create a pre-commit hook\n>> 2. create a commit that fails the hook, and bypass the hook\n>> 3. checkout another branch\n>> 4. might be optional : create a conflicting change with the previously\n>> created commit\n>> 5. cherry-pick the commit\n>> 6. might be optional : solve the conflick and use git cherry-pick --continue\n> Wouldn't \"commit --no-verify\" at that last step, instead of\n> \"cherry-pick --continue\", just work?\n>\n>\n"},{"id":"280158","messageId":"xmqqk2lj189l.fsf@gitster.mtv.corp.google.com","threadId":"41579","inReplyTo":"56D8B895.9030308@greg0ire.fr","subject":"Re: Bypassing hooks while cherry-picking","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-03T22:55:34Z","receivedAt":"2016-03-03T22:55:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Grégoire PARIS <postmaster@greg0ire.fr> writes:\n\n> Not sure how cherry-picking is managed, and whether commit is able to\n> see that we are doing a cherry-pick, and end it up properly. Anyway,\n> with Kevin's patch, we should be able to happily use cherry-pick\n\n[Please do not top post]\n\nIt is somewhat sad to see such a response as that is backwards.\n\n\"cherry-pick --continue\" originally was \"I am done with the commit I\nwas asked to deal with, so please replay the next one\", and in order\nto \"be done with\" the commit, you would used \"git commit\" yourself,\nwith whatever necessary options (e.g. --no-verify, -s, -c) you want\nto affect the behaviour of the \"git commit\".\n\nIt is a later invention that \"cherry-pick --continue\" additionally\ncreates a commit when the user, even though she claims to \"be done\nwith\", hasn't actually made the commit before going on to replay the\nnext one.  It was accepted as a short-cut as most of the time you do\nnot give any option to your \"git commit\" invocation, but probably\nwas a misguided invention--it made new people somehow think that\nthey are not allowed to run \"git commit\" to conclude the conflict\nresolution, when in reality that is an acceptable and primary way\nto do so and \"--continue\" is a mere short-hand.\n\nAs \"git commit\" does have options other than \"--no-verify\" that\naffects the way it behaves, and can gain more such options in the\nfuture, having to keep adding corresponding options to \"cherry-pick\n--continue --more-options\" will not be a good solution in the longer\nrun.\n"},{"id":"280160","messageId":"56D8C661.9000303@greg0ire.fr","threadId":"41579","inReplyTo":"xmqqk2lj189l.fsf@gitster.mtv.corp.google.com","subject":"Re: Bypassing hooks while cherry-picking","fromName":"Grégoire PARIS","fromEmail":"postmaster@greg0ire.fr","sentAt":"2016-03-03T23:18:57Z","receivedAt":"2016-03-03T23:18:57Z","isPatch":false,"sender":{"key":"postmaster@greg0ire.fr","avatar":"https://avatars.githubusercontent.com/u/657779?v=4"},"body":"Le 03/03/2016 23:55, Junio C Hamano a écrit :\n> Grégoire PARIS <postmaster@greg0ire.fr> writes:\n>\n>> Not sure how cherry-picking is managed, and whether commit is able to\n>> see that we are doing a cherry-pick, and end it up properly. Anyway,\n>> with Kevin's patch, we should be able to happily use cherry-pick\n> [Please do not top post]\n>\n> It is somewhat sad to see such a response as that is backwards.\n>\n> \"cherry-pick --continue\" originally was \"I am done with the commit I\n> was asked to deal with, so please replay the next one\", and in order\n> to \"be done with\" the commit, you would used \"git commit\" yourself,\n> with whatever necessary options (e.g. --no-verify, -s, -c) you want\n> to affect the behaviour of the \"git commit\".\n>\n> It is a later invention that \"cherry-pick --continue\" additionally\n> creates a commit when the user, even though she claims to \"be done\n> with\", hasn't actually made the commit before going on to replay the\n> next one.  It was accepted as a short-cut as most of the time you do\n> not give any option to your \"git commit\" invocation, but probably\n> was a misguided invention--it made new people somehow think that\n> they are not allowed to run \"git commit\" to conclude the conflict\n> resolution, when in reality that is an acceptable and primary way\n> to do so and \"--continue\" is a mere short-hand.\n>\n> As \"git commit\" does have options other than \"--no-verify\" that\n> affects the way it behaves, and can gain more such options in the\n> future, having to keep adding corresponding options to \"cherry-pick\n> --continue --more-options\" will not be a good solution in the longer\n> run.\n>\n>\nSorry for top-posting, I'll keep in mind to not do this.\n\nYou're describing very precisely how using cherry-pick --continue makes \nme feel. I checked again right now and even though there is a comment to \nmake me understand that commit would do a great job at solving my \nproblem (hint: and commit the result with 'git commit'), I failed to \nnotice it.\n\nI agree with you, adding every commit option is not a good solution… \nMaybe a good solution would be to display a special message when using \ncherry-pick --continue with unrecognized options? Like for instance\n\n > hint: try git commit --no-verify, then git cherry-pick --continue to \nreplay the next commit\n\nWhat do you think?\n\n--\ngreg0ire\n"}]}