diff options
Diffstat (limited to 'mergetools')
-rw-r--r-- | mergetools/diffmerge | 1 | ||||
-rw-r--r-- | mergetools/emerge | 1 | ||||
-rw-r--r-- | mergetools/kdiff3 | 1 | ||||
-rw-r--r-- | mergetools/winmerge | 36 |
4 files changed, 36 insertions, 3 deletions
diff --git a/mergetools/diffmerge b/mergetools/diffmerge index 85ac720157..f138cb4e73 100644 --- a/mergetools/diffmerge +++ b/mergetools/diffmerge @@ -11,5 +11,4 @@ merge_cmd () { "$merge_tool_path" --merge \ --result="$MERGED" "$LOCAL" "$REMOTE" fi - status=$? } diff --git a/mergetools/emerge b/mergetools/emerge index f96d9e550a..7b895fdb1f 100644 --- a/mergetools/emerge +++ b/mergetools/emerge @@ -15,7 +15,6 @@ merge_cmd () { "$LOCAL" "$REMOTE" \ "$(basename "$MERGED")" fi - status=$? } translate_merge_tool_path() { diff --git a/mergetools/kdiff3 b/mergetools/kdiff3 index a30034f116..793d1293b1 100644 --- a/mergetools/kdiff3 +++ b/mergetools/kdiff3 @@ -20,5 +20,4 @@ merge_cmd () { -o "$MERGED" "$LOCAL" "$REMOTE" \ >/dev/null 2>&1 fi - status=$? } diff --git a/mergetools/winmerge b/mergetools/winmerge new file mode 100644 index 0000000000..74a66d4e8d --- /dev/null +++ b/mergetools/winmerge @@ -0,0 +1,36 @@ +diff_cmd () { + "$merge_tool_path" -u -e "$LOCAL" "$REMOTE" + return 0 +} + +merge_cmd () { + # mergetool.winmerge.trustExitCode is implicitly false. + # touch $BACKUP so that we can check_unchanged. + touch "$BACKUP" + "$merge_tool_path" -u -e -dl Local -dr Remote \ + "$LOCAL" "$REMOTE" "$MERGED" + check_unchanged +} + +translate_merge_tool_path() { + # Use WinMergeU.exe if it exists in $PATH + if type -p WinMergeU.exe >/dev/null 2>&1 + then + printf WinMergeU.exe + return + fi + + # Look for WinMergeU.exe in the typical locations + winmerge_exe="WinMerge/WinMergeU.exe" + for directory in $(env | grep -Ei '^PROGRAM(FILES(\(X86\))?|W6432)=' | + cut -d '=' -f 2- | sort -u) + do + if test -n "$directory" && test -x "$directory/$winmerge_exe" + then + printf '%s' "$directory/$winmerge_exe" + return + fi + done + + printf WinMergeU.exe +} |