mergetools/diffmerge: support DiffMerge as a git mergetool

DiffMerge is a non-free (but gratis) tool that supports OS X, Windows and Linux. See http://www.sourcegear.com/diffmerge/ DiffMerge includes a script `/usr/bin/diffmerge` that can be used to launch the graphical compare tool. This change adds mergetool support for DiffMerge and adds 'diffmerge' as an option to the mergetool help. Signed-off-by: Stefan Saasen <ssaasen@atlassian.com> Acked-by: David Aguilar <davvid@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

Stefan Saasen committed Oct 13, 2013 at 09:29 UTC c5f424fd014488bd8a92b97f52bfe47823bc2128
3 files changed +18 -2
contrib/completion/git-completion.bash
+1 -1
@@ -1188,7 +1188,7 @@ _git_diff ()
1188 __git_complete_revlist_file
1189 }
1190
1191 -__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff
1191 +__git_mergetools_common="diffuse diffmerge ecmerge emerge kdiff3 meld opendiff
1192 tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3 codecompare
1193 "
1194
git-mergetool--lib.sh
+2 -1
@@ -250,7 +250,8 @@ list_merge_tool_candidates () {
250 else
251 tools="opendiff kdiff3 tkdiff xxdiff meld $tools"
252 fi
253 - tools="$tools gvimdiff diffuse ecmerge p4merge araxis bc3 codecompare"
253 + tools="$tools gvimdiff diffuse diffmerge ecmerge"
254 + tools="$tools p4merge araxis bc3 codecompare"
255 fi
256 case "${VISUAL:-$EDITOR}" in
257 *vim*)
mergetools/diffmerge new
+15
@@ -0,0 +1,15 @@
1 +diff_cmd () {
2 + "$merge_tool_path" "$LOCAL" "$REMOTE" >/dev/null 2>&1
3 +}
4 +
5 +merge_cmd () {
6 + if $base_present
7 + then
8 + "$merge_tool_path" --merge --result="$MERGED" \
9 + "$LOCAL" "$BASE" "$REMOTE"
10 + else
11 + "$merge_tool_path" --merge \
12 + --result="$MERGED" "$LOCAL" "$REMOTE"
13 + fi
14 + status=$?
15 +}