Re: [PATCH] ll-merge: killing the external merge driver aborts the merge
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 27, 2023, 21:26 UTC
- Message-ID
- <xmqqilb8fvgu.fsf@gitster.g>
- In-Reply-To
- <cd5046d4-d66c-9dac-87e7-cdb638124170@cedaron.com>
Joshua Hudson <jhudson@cedaron.com> writes:
> Try changing kill -9 $$ to exit 137 # 128 + 9
Yeah, but then (1) we are not simulating a case where the external merge driver hits a segfault or receives a signal from outside and dies involuntarily, and (2) we are codifying that even on Windows, program that was killed by signal N must exit with 128 + N, and these are the reasons why I did not go that route.
Stepping back a bit, how does one typically diagnose programatically on Windows, after "spawning" a separate program, if the program died involuntarily and/or got killed? It does not have to be "exit with 128 + signal number"---as long as it can be done programatically and reliably, we would be happy. The code to diagnose how the spawned program exited in run_command(), which is in finish_command() and then in wait_or_whine(), may have to be updated with such a piece of Windows specific knowledge.