Skip to content

Commit

Permalink
mergetool-lib: add a three-way diff view for vim/gvim
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan McGee authored and Junio C Hamano committed Sep 15, 2010
1 parent ae69fd0 commit 829ef38
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions git-mergetool--lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down

0 comments on commit 829ef38

Please sign in to comment.