Skip to content

Commit c5f424f

Browse files
Stefan Saasenjrn
authored andcommitted
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 <[email protected]> Acked-by: David Aguilar <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]>
1 parent 22bbdde commit c5f424f

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

contrib/completion/git-completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ _git_diff ()
11881188
__git_complete_revlist_file
11891189
}
11901190

1191-
__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff
1191+
__git_mergetools_common="diffuse diffmerge ecmerge emerge kdiff3 meld opendiff
11921192
tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3 codecompare
11931193
"
11941194

git-mergetool--lib.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ list_merge_tool_candidates () {
250250
else
251251
tools="opendiff kdiff3 tkdiff xxdiff meld $tools"
252252
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"
254255
fi
255256
case "${VISUAL:-$EDITOR}" in
256257
*vim*)

mergetools/diffmerge

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
}

0 commit comments

Comments
 (0)