@@ -1,3 +1,9 @@
+mergetool.<tool>.autoMerge::
+ A mergetool-specific override for the global `mergetool.autoMerge`
+ configuration flag. This allows individual mergetools to enable or
+ disable the flag regardless of the global setting. See
+ `mergetool.autoMerge` for the full description.
+
mergetool.<tool>.cmd::
Specify the command to invoke the specified merge tool. The
specified command is evaluated in shell with the following
@@ -41,7 +47,14 @@ mergetool.meld.useAutoMerge::
default value.
mergetool.autoMerge::
- Remove lines without conflicts from all the files. Defaults to `true`.
+ During a merge Git will automatically resolve as many conflicts as
+ possible and then wrap conflict markers around any conflicts that it
+ cannot resolve. This flag consolidates the non-conflicting parts into
+ the corresponding 'LOCAL' and 'REMOTE' files so that only the
+ unresolved conflicts are presented to the merge tool. Can be overriden
+ per-tool via the `mergetool.<tool>.autoMerge` configuration variable.
+ Note: individual mergetool scripts can elect to ignore user preferences
+ entirely. Defaults to `true`.
mergetool.keepBackup::
After performing a merge, the original file with conflict markers
@@ -334,7 +334,10 @@ merge_file () {
checkout_staged_file 2 "$MERGED" "$LOCAL"
checkout_staged_file 3 "$MERGED" "$REMOTE"
- if test "$(git config --bool mergetool.autoMerge)" != "false"
+ if test "$(
+ git config --get --bool "mergetool.$merge_tool.automerge" ||
+ git config --get --bool "mergetool.automerge" ||
+ echo true)" = true
then
auto_merge
fi
Keep the global mergetool flag and add a per-tool override flag so that users may enable the flag for one tool and disable it for another. Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Seth House <seth@eseth.com> --- Documentation/config/mergetool.txt | 15 ++++++++++++++- git-mergetool.sh | 5 ++++- 2 files changed, 18 insertions(+), 2 deletions(-)