git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [QUESTION] Can I merge --continue with --no-verify
@ 2024-10-24  7:59 Abhijeet Sonar
  2024-10-24 16:54 ` Taylor Blau
  0 siblings, 1 reply; 2+ messages in thread
From: Abhijeet Sonar @ 2024-10-24  7:59 UTC (permalink / raw)
  To: git

I recently found myself wanting to continue a merge after resolving
conflicts without having the pre-commit hook run:

git merge --continue --no-verify

this fails and prints usage.

Digging the source, I can see that in builtin/merge.c:1378 we do:

    if (continue_current_merge) {
        [...]

        if (orig_argc != 2)
            usage_msg_opt(_("--continue expects no arguments"),   
                  builtin_merge_usage, builtin_merge_options);

I see why we would want this - the --continue flag makes the merge command
perform an operation that is very different than what merge normally does
without this option and therefore the usual options do not apply.
However, I think
it does make sense to allow --no-verify - it feels very intuitive to use
it when
bypassing the pre-commit hook is desired while continuing a merge.

Thanks



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [QUESTION] Can I merge --continue with --no-verify
  2024-10-24  7:59 [QUESTION] Can I merge --continue with --no-verify Abhijeet Sonar
@ 2024-10-24 16:54 ` Taylor Blau
  0 siblings, 0 replies; 2+ messages in thread
From: Taylor Blau @ 2024-10-24 16:54 UTC (permalink / raw)
  To: Abhijeet Sonar; +Cc: git

On Thu, Oct 24, 2024 at 01:29:21PM +0530, Abhijeet Sonar wrote:
> I recently found myself wanting to continue a merge after resolving
> conflicts without having the pre-commit hook run:
>
> git merge --continue --no-verify
>
> this fails and prints usage.
>
> Digging the source, I can see that in builtin/merge.c:1378 we do:
>
>     if (continue_current_merge) {
>         [...]
>
>         if (orig_argc != 2)
>             usage_msg_opt(_("--continue expects no arguments"),   
>                   builtin_merge_usage, builtin_merge_options);
>
> I see why we would want this - the --continue flag makes the merge command
> perform an operation that is very different than what merge normally does
> without this option and therefore the usual options do not apply.

Yeah, this looks like a bug to me. I wondered if '--no-verify --continue'
would resolve the issue, but it won't, because we are comparing against
orig_argc, which will be 2 in either case.

I suspect that this dates back to bc40ce4de6 (merge: --no-verify to
bypass pre-merge-commit hook, 2019-08-07), likely as a result of
042e290da6 (merge: ensure '--abort' option takes no arguments,
2016-12-14), which came before it.

Probably we should update the logic here to work around the issue.

> However, I think it does make sense to allow --no-verify - it feels
> very intuitive to use it when bypassing the pre-commit hook is desired
> while continuing a merge.

Agreed.

Thanks,
Taylor

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-24 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-24  7:59 [QUESTION] Can I merge --continue with --no-verify Abhijeet Sonar
2024-10-24 16:54 ` Taylor Blau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).