From ffe6dc081aa23d56e6306d143d99ca508db38c5e Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Sun, 27 Feb 2011 12:32:46 +0100 Subject: [PATCH] mergetool--lib: Add Beyond Compare 3 as a tool Signed-off-by: Sebastian Schuberth Tested-by: Chris Packham Signed-off-by: Junio C Hamano --- Documentation/git-difftool.txt | 2 +- Documentation/git-mergetool.txt | 2 +- Documentation/merge-config.txt | 2 +- contrib/completion/git-completion.bash | 2 +- git-mergetool--lib.sh | 22 ++++++++++++++++++++-- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Documentation/git-difftool.txt b/Documentation/git-difftool.txt index 4c8825d19..f087eff87 100644 --- a/Documentation/git-difftool.txt +++ b/Documentation/git-difftool.txt @@ -31,7 +31,7 @@ OPTIONS --tool=:: Use the diff tool specified by . 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' diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt index 4987245ac..740b3f1e6 100644 --- a/Documentation/git-mergetool.txt +++ b/Documentation/git-mergetool.txt @@ -26,7 +26,7 @@ OPTIONS --tool=:: Use the merge resolution program specified by . 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' diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt index 90587db16..33bf74c33 100644 --- a/Documentation/merge-config.txt +++ b/Documentation/merge-config.txt @@ -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..cmd option. diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 893b7716c..058c2a92b 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -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 () diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh index efca09f51..eeefb9c29 100644 --- a/git-mergetool--lib.sh +++ b/git-mergetool--lib.sh @@ -13,6 +13,9 @@ translate_merge_tool_path () { araxis) echo compare ;; + bc3) + echo bcompare + ;; emerge) echo emacs ;; @@ -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) @@ -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" @@ -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*) -- 2.26.2