diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-06-22 17:33:01 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-06-23 09:27:10 -0700 |
commit | 2b7b788fb31a74bcbff4e4c6efc6f3db6c3a49b7 (patch) | |
tree | b24e68a77ce2af1e69d9c384189067e98b2cd614 /Documentation/gitattributes.txt | |
parent | 6640c2d06d112675426cf436f0594f0e8c614848 (diff) | |
download | git-2b7b788fb31a74bcbff4e4c6efc6f3db6c3a49b7.tar.gz |
ll-merge: killing the external merge driver aborts the merge
When an external merge driver dies with a signal, we should not
expect that the result left on the filesystem is in any useful
state. However, because the current code uses the return value from
run_command() and declares any positive value as a sign that the
driver successfully left conflicts in the result, and because the
return value from run_command() for a subprocess that died upon a
signal is positive, we end up treating whatever garbage left on the
filesystem as the result the merge driver wanted to leave us.
run_command() returns larger than 128 (WTERMSIG(status) + 128, to be
exact) when it notices that the subprocess died with a signal, so
detect such a case and return LL_MERGE_ERROR from ll_ext_merge().
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Diffstat (limited to 'Documentation/gitattributes.txt')
-rw-r--r-- | Documentation/gitattributes.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 02a3ec83e4..6deb89a296 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -1132,7 +1132,10 @@ size (see below). The merge driver is expected to leave the result of the merge in the file named with `%A` by overwriting it, and exit with zero status if it managed to merge them cleanly, or non-zero if there -were conflicts. +were conflicts. When the driver crashes (e.g. killed by SEGV), +it is expected to exit with non-zero status that are higher than +128, and in such a case, the merge results in a failure (which is +different from producing a conflict). The `merge.*.recursive` variable specifies what other merge driver to use when the merge driver is called for an internal |