Skip to content

Commit

Permalink
mergetool--lib: Add Beyond Compare 3 as a tool
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Tested-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Sebastian Schuberth authored and Junio C Hamano committed Feb 28, 2011
1 parent aa03f60 commit ffe6dc0
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Documentation/git-difftool.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ OPTIONS
--tool=<tool>::
Use the diff tool specified by <tool>.
Valid merge tools are:
araxis, diffuse, emerge, ecmerge, gvimdiff, kdiff3,
araxis, bc3, diffuse, emerge, ecmerge, gvimdiff, kdiff3,
kompare, meld, opendiff, p4merge, tkdiff, vimdiff and xxdiff.
+
If a diff tool is not specified, 'git difftool'
Expand Down
2 changes: 1 addition & 1 deletion Documentation/git-mergetool.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ OPTIONS
--tool=<tool>::
Use the merge resolution program specified by <tool>.
Valid merge tools are:
araxis, diffuse, ecmerge, emerge, gvimdiff, kdiff3,
araxis, bc3, diffuse, ecmerge, emerge, gvimdiff, kdiff3,
meld, opendiff, p4merge, tkdiff, tortoisemerge, vimdiff and xxdiff.
+
If a merge resolution program is not specified, 'git mergetool'
Expand Down
2 changes: 1 addition & 1 deletion Documentation/merge-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ merge.stat::
merge.tool::
Controls which merge resolution program is used by
linkgit:git-mergetool[1]. Valid built-in values are: "araxis",
"diffuse", "ecmerge", "emerge", "gvimdiff", "kdiff3", "meld",
"bc3", "diffuse", "ecmerge", "emerge", "gvimdiff", "kdiff3", "meld",
"opendiff", "p4merge", "tkdiff", "tortoisemerge", "vimdiff"
and "xxdiff". Any other value is treated is custom merge tool
and there must be a corresponding mergetool.<tool>.cmd option.
Expand Down
2 changes: 1 addition & 1 deletion contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ _git_diff ()
}

__git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff
tkdiff vimdiff gvimdiff xxdiff araxis p4merge
tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc3
"

_git_difftool ()
Expand Down
22 changes: 20 additions & 2 deletions git-mergetool--lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ translate_merge_tool_path () {
araxis)
echo compare
;;
bc3)
echo bcompare
;;
emerge)
echo emacs
;;
Expand Down Expand Up @@ -46,7 +49,7 @@ check_unchanged () {

valid_tool () {
case "$1" in
araxis | diffuse | ecmerge | emerge | gvimdiff | gvimdiff2 | \
araxis | bc3 | diffuse | ecmerge | emerge | gvimdiff | gvimdiff2 | \
kdiff3 | meld | opendiff | p4merge | tkdiff | vimdiff | vimdiff2 | xxdiff)
;; # happy
kompare)
Expand Down Expand Up @@ -106,6 +109,21 @@ run_merge_tool () {
>/dev/null 2>&1
fi
;;
bc3)
if merge_mode; then
touch "$BACKUP"
if $base_present; then
"$merge_tool_path" "$LOCAL" "$REMOTE" "$BASE" \
-mergeoutput="$MERGED"
else
"$merge_tool_path" "$LOCAL" "$REMOTE" \
-mergeoutput="$MERGED"
fi
check_unchanged
else
"$merge_tool_path" "$LOCAL" "$REMOTE"
fi
;;
diffuse)
if merge_mode; then
touch "$BACKUP"
Expand Down Expand Up @@ -342,7 +360,7 @@ guess_merge_tool () {
else
tools="opendiff kdiff3 tkdiff xxdiff meld $tools"
fi
tools="$tools gvimdiff diffuse ecmerge p4merge araxis"
tools="$tools gvimdiff diffuse ecmerge p4merge araxis bc3"
fi
case "${VISUAL:-$EDITOR}" in
*vim*)
Expand Down

0 comments on commit ffe6dc0

Please sign in to comment.