summaryrefslogtreecommitdiff
path: root/mergetools
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2014-04-21 00:24:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-04-22 19:49:07 (GMT)
commit7c147b77d34f072c40b912fafba499727921fa6e (patch)
treed74950fe1df88876d77fbe9e4122bd1bddd9878a /mergetools
parent0bc85abb7aa9b24b093253018801a0fb43d01122 (diff)
downloadgit-7c147b77d34f072c40b912fafba499727921fa6e.zip
git-7c147b77d34f072c40b912fafba499727921fa6e.tar.gz
git-7c147b77d34f072c40b912fafba499727921fa6e.tar.bz2
mergetools: add vimdiff3 mode
It's similar to the default, except that the other windows are hidden. This ensures that removed/added colors are still visible on the main merge window, but the other windows not visible. Specially useful with merge.conflictstyle=diff3. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Acked-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'mergetools')
-rw-r--r--mergetools/gvimdiff31
-rw-r--r--mergetools/vimdiff14
-rw-r--r--mergetools/vimdiff31
3 files changed, 14 insertions, 2 deletions
diff --git a/mergetools/gvimdiff3 b/mergetools/gvimdiff3
new file mode 100644
index 0000000..04a5bb0
--- /dev/null
+++ b/mergetools/gvimdiff3
@@ -0,0 +1 @@
+. "$MERGE_TOOLS_DIR/vimdiff"
diff --git a/mergetools/vimdiff b/mergetools/vimdiff
index 39d0327..1ddfbfc 100644
--- a/mergetools/vimdiff
+++ b/mergetools/vimdiff
@@ -20,16 +20,26 @@ merge_cmd () {
"$merge_tool_path" -f -d -c 'wincmd l' \
"$LOCAL" "$MERGED" "$REMOTE"
;;
+ gvimdiff3|vimdiff3)
+ if $base_present
+ then
+ "$merge_tool_path" -f -d -c 'hid | hid | hid' \
+ "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
+ else
+ "$merge_tool_path" -f -d -c 'hid | hid' \
+ "$LOCAL" "$REMOTE" "$MERGED"
+ fi
+ ;;
esac
check_unchanged
}
translate_merge_tool_path() {
case "$1" in
- gvimdiff|gvimdiff2)
+ gvimdiff|gvimdiff2|gvimdiff3)
echo gvim
;;
- vimdiff|vimdiff2)
+ vimdiff|vimdiff2|vimdiff3)
echo vim
;;
esac
diff --git a/mergetools/vimdiff3 b/mergetools/vimdiff3
new file mode 100644
index 0000000..04a5bb0
--- /dev/null
+++ b/mergetools/vimdiff3
@@ -0,0 +1 @@
+. "$MERGE_TOOLS_DIR/vimdiff"