summaryrefslogtreecommitdiff
path: root/git-mergetool--lib.sh
diff options
context:
space:
mode:
authorDan McGee <dpmcgee@gmail.com>2010-09-14 21:21:43 -0500
committerJunio C Hamano <gitster@pobox.com>2010-09-15 10:14:16 -0700
commit829ef383a2b03a614d7d23e575270f2b10a805c1 (patch)
tree6390c03ea434db8432e3b58b7ee9ac5a0b214803 /git-mergetool--lib.sh
parentae69fd0481fa7bb39ee9ee68dc2e009d500e3b1d (diff)
downloadgit-829ef383a2b03a614d7d23e575270f2b10a805c1.tar.gz
mergetool-lib: add a three-way diff view for vim/gvim
When the base version is available, use a three-way, four panel view by default. This shows the (local, base, remote) revisions up top and the merged result by itself in the lower pane. All revisions will still scroll together by default, and the cursor still defaults to the merged result edit pane. Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-mergetool--lib.sh')
-rw-r--r--git-mergetool--lib.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index f9a51ba504..b84ac582f9 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -172,8 +172,13 @@ run_merge_tool () {
vimdiff|gvimdiff)
if merge_mode; then
touch "$BACKUP"
- "$merge_tool_path" -f -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" -f -d -c "wincmd l" \