Re: [PATCH] ll-merge: killing the external merge driver aborts the merge
Hi,
On Fri, 23 Jun 2023, Junio C Hamano wrote:
Show 17 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
> > Elijah Newren <newren@gmail.com> writes:
> >
> >> Reviewed-by: Elijah Newren <newren@gmail.com>
> >
> >
> > Thanks for a quick review.
>
> Unfortunately Windows does not seem to correctly detect the aborting
> merge driver. Does run_command() there report process death due to
> signals differently, I wonder?
>
> https://github.com/git/git/actions/runs/5360400800/jobs/9725341775#step:6:285
>
> shows that on Windows, aborted external merge driver is not noticed
> and we happily take the auto-merged result, ouch.
Hmm. I tried to verify this, but failed. With this patch:
```diff
diff --git a/git.c b/git.c
index 2f42da20f4e0..3c513e3f2cb1 100644
--- a/git.c
+++ b/git.c
@@ -330,6 +330,8 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
setenv(GIT_ATTR_SOURCE_ENVIRONMENT, cmd, 1);
if (envchanged)
*envchanged = 1;
+ } else if (!strcmp(cmd, "--abort")) {
+ abort();
} else {
fprintf(stderr, _("unknown option: %s\n"), cmd);
usage(git_usage_string);
```
I get this:
```console
$ ./git.exe --abort
$ echo $?
3
```
For that reason, I am somehow doubtful that the `abort()` is actually
called?!?
Ciao,
Johannes