From: Sebastian Schuberth <sschuberth@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: git@vger.kernel.org, charles@hashpling.org, judge.packham@gmail.com
Subject: [PATCH 2/3] mergetool--lib: Add Beyond Compare 3 as a tool
Date: Sat, 26 Feb 2011 11:52:17 +0100 [thread overview]
Message-ID: <4D68DB61.4070607@gmail.com> (raw)
In-Reply-To: <4D68DAC4.9060100@gmail.com>
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
Documentation/git-difftool.txt | 2 +-
Documentation/git-mergetool.txt | 2 +-
Documentation/merge-config.txt | 2 +-
contrib/completion/git-completion.bash | 2 +-
git-gui/lib/mergetool.tcl | 7 +++++++
git-mergetool--lib.sh | 22 ++++++++++++++++++++--
6 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/Documentation/git-difftool.txt b/Documentation/git-difftool.txt
index 4c8825d..f087eff 100644
--- a/Documentation/git-difftool.txt
+++ b/Documentation/git-difftool.txt
@@ -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'
diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt
index 4987245..740b3f1 100644
--- a/Documentation/git-mergetool.txt
+++ b/Documentation/git-mergetool.txt
@@ -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'
diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt
index 90587db..33bf74c 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.<tool>.cmd option.
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 893b771..058c2a9 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-gui/lib/mergetool.tcl b/git-gui/lib/mergetool.tcl
index 249e0cf..3c8e73b 100644
--- a/git-gui/lib/mergetool.tcl
+++ b/git-gui/lib/mergetool.tcl
@@ -187,6 +187,13 @@ proc merge_resolve_tool2 {} {
"$LOCAL" "$REMOTE" "$MERGED"]
}
}
+ bc3 {
+ if {$base_stage ne {}} {
+ set cmdline [list "$merge_tool_path" "$LOCAL" "$REMOTE" "$BASE" -mergeoutput="$MERGED"]
+ } else {
+ set cmdline [list "$merge_tool_path" "$LOCAL" "$REMOTE" -mergeoutput="$MERGED"]
+ }
+ }
ecmerge {
if {$base_stage ne {}} {
set cmdline [list "$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" --default --mode=merge3 --to="$MERGED"]
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 9fb82e5..3ac6231 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*)
--
1.7.3.2.msysgit.6.dirty
next prev parent reply other threads:[~2011-02-26 10:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-26 10:49 [PATCH 0/3] Adding Beyond Compare as a merge tool, was: Re: What's cooking in git.git (Feb 2011, #05; Wed, 23) Sebastian Schuberth
2011-02-26 10:51 ` [PATCH 1/3] mergetool--lib: Sort tools alphabetically for easier lookup Sebastian Schuberth
2011-02-26 10:52 ` Sebastian Schuberth [this message]
2011-02-26 10:53 ` [PATCH 3/3] mergetool--lib: Add the proper executable name for ECMerge Sebastian Schuberth
2011-02-27 5:50 ` Chris Packham
2011-02-27 10:37 ` Sebastian Schuberth
2011-02-27 19:25 ` Chris Packham
2011-02-27 9:12 ` [PATCH 0/3] Adding Beyond Compare as a merge tool, was: Re: What's cooking in git.git (Feb 2011, #05; Wed, 23) Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2010-11-18 10:40 [PATCH 0/3] Improvements to mergetool-lib Sebastian Schuberth
2010-11-18 10:43 ` [PATCH 2/3] mergetool--lib: Add Beyond Compare 3 as a tool Sebastian Schuberth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D68DB61.4070607@gmail.com \
--to=sschuberth@gmail.com \
--cc=charles@hashpling.org \
--cc=git@vger.kernel.org \
--cc=judge.packham@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).