summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Dan McGee <dpmcgee@gmail.com>2010-09-27 10:19:09 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-09-29 13:09:48 -0700
commit000866909a5d9233c89d8fcc33a8125cc84f24d6 (patch)
tree9e029cca6012e74ca30d8a0b0d5f1c8a2a9cc011
parentmergetool-lib: add a three-way diff view for vim/gvim (diff)
downloadtgif-000866909a5d9233c89d8fcc33a8125cc84f24d6.tar.xz
mergetool-lib: make the three-way diff the default for vim/gvim
The original vimdiff/gvimdiff configuration is now available by using 'vimdiff2' or 'gvimdiff2' as the preferred merge tool. Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--git-mergetool--lib.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index b84ac582f9..77d4aee20e 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -10,10 +10,10 @@ merge_mode() {
translate_merge_tool_path () {
case "$1" in
- vimdiff)
+ vimdiff|vimdiff2)
echo vim
;;
- gvimdiff)
+ gvimdiff|gvimdiff2)
echo gvim
;;
emerge)
@@ -47,7 +47,8 @@ check_unchanged () {
valid_tool () {
case "$1" in
kdiff3 | tkdiff | xxdiff | meld | opendiff | \
- emerge | vimdiff | gvimdiff | ecmerge | diffuse | araxis | p4merge)
+ vimdiff | gvimdiff | vimdiff2 | gvimdiff2 | \
+ emerge | ecmerge | diffuse | araxis | p4merge)
;; # happy
tortoisemerge)
if ! merge_mode; then
@@ -185,6 +186,17 @@ run_merge_tool () {
"$LOCAL" "$REMOTE"
fi
;;
+ vimdiff2|gvimdiff2)
+ if merge_mode; then
+ touch "$BACKUP"
+ "$merge_tool_path" -f -d -c "wincmd l" \
+ "$LOCAL" "$MERGED" "$REMOTE"
+ check_unchanged
+ else
+ "$merge_tool_path" -f -d -c "wincmd l" \
+ "$LOCAL" "$REMOTE"
+ fi
+ ;;
xxdiff)
if merge_mode; then
touch "$BACKUP"