diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-10-26 21:47:11 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-10-26 21:47:11 -0700 |
commit | 0141215c9b1b95b6b9619358ab13e0f56e1cd01c (patch) | |
tree | a3e096b778f2c87cf694126df2a3d36ce600016b | |
parent | 91e811e0e80e55d580ba3601176ac84b28ad4479 (diff) | |
parent | 000866909a5d9233c89d8fcc33a8125cc84f24d6 (diff) | |
download | git-0141215c9b1b95b6b9619358ab13e0f56e1cd01c.tar.gz |
Merge branch 'dm/mergetool-vimdiff'
* dm/mergetool-vimdiff:
mergetool-lib: make the three-way diff the default for vim/gvim
mergetool-lib: add a three-way diff view for vim/gvim
mergetool-lib: combine vimdiff and gvimdiff run blocks
-rw-r--r-- | git-mergetool--lib.sh | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh index b5e1943b1d..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 @@ -169,25 +170,30 @@ run_merge_tool () { "$merge_tool_path" "$LOCAL" "$REMOTE" | cat fi ;; - vimdiff) + vimdiff|gvimdiff) if merge_mode; then touch "$BACKUP" - "$merge_tool_path" -d -c "wincmd l" \ - "$LOCAL" "$MERGED" "$REMOTE" + if $base_present; then + "$merge_tool_path" -f -d -c "wincmd J" \ + "$MERGED" "$LOCAL" "$BASE" "$REMOTE" + else + "$merge_tool_path" -f -d -c "wincmd l" \ + "$LOCAL" "$MERGED" "$REMOTE" + fi check_unchanged else - "$merge_tool_path" -d -c "wincmd l" \ + "$merge_tool_path" -f -d -c "wincmd l" \ "$LOCAL" "$REMOTE" fi ;; - gvimdiff) + vimdiff2|gvimdiff2) if merge_mode; then touch "$BACKUP" - "$merge_tool_path" -d -c "wincmd l" -f \ + "$merge_tool_path" -f -d -c "wincmd l" \ "$LOCAL" "$MERGED" "$REMOTE" check_unchanged else - "$merge_tool_path" -d -c "wincmd l" -f \ + "$merge_tool_path" -f -d -c "wincmd l" \ "$LOCAL" "$REMOTE" fi ;; |