Re: [PATCH] ll-merge: killing the external merge driver aborts the merge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 6/27/2023 5:02 AM, Johannes Schindelin wrote:
Hi,


On Fri, 23 Jun 2023, Junio C Hamano wrote:

Junio C Hamano <gitster@xxxxxxxxx> writes:

Elijah Newren <newren@xxxxxxxxx> writes:

Reviewed-by: Elijah Newren <newren@xxxxxxxxx>

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

abort(); does _exit(3); on Windows because there are no signals. This is easily changed by providing abort like so:

void abort() { _exit(131 /* or whatever else you think goes here */); }




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux