{"thread":{"id":"62402","subject":"[QUESTION] Can I merge --continue with --no-verify","startedAt":"2024-10-24T07:59:25Z","lastAt":"2024-10-24T16:54:51Z","messageCount":2,"participants":["Abhijeet Sonar","Taylor Blau"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"506008","messageId":"7038bb3a-2aad-4bde-bd46-f2bd2ef659d1@gmail.com","threadId":"62402","inReplyTo":null,"subject":"[QUESTION] Can I merge --continue with --no-verify","fromName":"Abhijeet Sonar","fromEmail":"abhijeet.nkt@gmail.com","sentAt":"2024-10-24T07:59:21Z","receivedAt":"2024-10-24T07:59:25Z","isPatch":false,"sender":{"key":"abhijeet.nkt@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40241646?v=4"},"body":"I recently found myself wanting to continue a merge after resolving\nconflicts without having the pre-commit hook run:\n\ngit merge --continue --no-verify\n\nthis fails and prints usage.\n\nDigging the source, I can see that in builtin/merge.c:1378 we do:\n\n    if (continue_current_merge) {\n        [...]\n\n        if (orig_argc != 2)\n            usage_msg_opt(_(\"--continue expects no arguments\"),   \n                  builtin_merge_usage, builtin_merge_options);\n\nI see why we would want this - the --continue flag makes the merge command\nperform an operation that is very different than what merge normally does\nwithout this option and therefore the usual options do not apply.\nHowever, I think\nit does make sense to allow --no-verify - it feels very intuitive to use\nit when\nbypassing the pre-commit hook is desired while continuing a merge.\n\nThanks\n\n\n"},{"id":"506052","messageId":"Zxp72aZ5U67pB4V7@nand.local","threadId":"62402","inReplyTo":"7038bb3a-2aad-4bde-bd46-f2bd2ef659d1@gmail.com","subject":"Re: [QUESTION] Can I merge --continue with --no-verify","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-10-24T16:54:49Z","receivedAt":"2024-10-24T16:54:51Z","isPatch":false,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Thu, Oct 24, 2024 at 01:29:21PM +0530, Abhijeet Sonar wrote:\n> I recently found myself wanting to continue a merge after resolving\n> conflicts without having the pre-commit hook run:\n>\n> git merge --continue --no-verify\n>\n> this fails and prints usage.\n>\n> Digging the source, I can see that in builtin/merge.c:1378 we do:\n>\n>     if (continue_current_merge) {\n>         [...]\n>\n>         if (orig_argc != 2)\n>             usage_msg_opt(_(\"--continue expects no arguments\"),   \n>                   builtin_merge_usage, builtin_merge_options);\n>\n> I see why we would want this - the --continue flag makes the merge command\n> perform an operation that is very different than what merge normally does\n> without this option and therefore the usual options do not apply.\n\nYeah, this looks like a bug to me. I wondered if '--no-verify --continue'\nwould resolve the issue, but it won't, because we are comparing against\norig_argc, which will be 2 in either case.\n\nI suspect that this dates back to bc40ce4de6 (merge: --no-verify to\nbypass pre-merge-commit hook, 2019-08-07), likely as a result of\n042e290da6 (merge: ensure '--abort' option takes no arguments,\n2016-12-14), which came before it.\n\nProbably we should update the logic here to work around the issue.\n\n> However, I think it does make sense to allow --no-verify - it feels\n> very intuitive to use it when bypassing the pre-commit hook is desired\n> while continuing a merge.\n\nAgreed.\n\nThanks,\nTaylor\n"}]}