Code

mergetool: Add support for vimdiff.
authorJames Bowes <jbowes@dangerouslyinc.com>
Mon, 19 Mar 2007 02:11:54 +0000 (22:11 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 19 Mar 2007 02:13:48 +0000 (22:13 -0400)
Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Documentation/config.txt
Documentation/git-mergetool.txt
git-mergetool.sh

index 953acaee4c9b692802a4e98861dac8ceec315d54..66886424bb6c30f1829482230ff3da4810461f22 100644 (file)
@@ -460,7 +460,7 @@ merge.summary::
 merge.tool::
        Controls which merge resolution program is used by
        gitlink:git-mergetool[l].  Valid values are: "kdiff3", "tkdiff",
-       "meld", "xxdiff", "emerge"
+       "meld", "xxdiff", "emerge", "vimdiff"
 
 merge.verbosity::
        Controls the amount of output shown by the recursive merge
index ae69a0eb83ea705b2564c5ed8d3f2ff1313ae8fd..5baaaca0b5433ae279b3961d72d0cffa8ca046e3 100644 (file)
@@ -25,7 +25,7 @@ OPTIONS
 -t or --tool=<tool>::
        Use the merge resolution program specified by <tool>.
        Valid merge tools are:
-       kdiff3, tkdiff, meld, xxdiff, and emerge.
+       kdiff3, tkdiff, meld, xxdiff, emerge, and vimdiff.
 
        If a merge resolution program is not specified, 'git mergetool'
        will use the configuration variable merge.tool.  If the
index 52386a5443ac19f1d8cbf7dc32c1237b2665b861..563c5c048f5f434b4208750de9f7b11aced36bfd 100755 (executable)
@@ -185,9 +185,9 @@ merge_file () {
                mv -- "$BACKUP" "$path.orig"
            fi
            ;;
-       meld)
+       meld|vimdiff)
            touch "$BACKUP"
-           meld -- "$LOCAL" "$path" "$REMOTE"
+           $merge_tool -- "$LOCAL" "$path" "$REMOTE"
            if test "$path" -nt "$BACKUP" ; then
                status=0;
            else
@@ -305,6 +305,8 @@ if test -z "$merge_tool" ; then
        merge_tool=meld
     elif type emacs >/dev/null 2>&1; then
        merge_tool=emerge
+    elif type vimdiff >/dev/null 2>&1; then
+       merge_tool=vimdiff
     else
        echo "No available merge resolution programs available."
        exit 1
@@ -312,7 +314,7 @@ if test -z "$merge_tool" ; then
 fi
 
 case "$merge_tool" in
-    kdiff3|tkdiff|meld|xxdiff)
+    kdiff3|tkdiff|meld|xxdiff|vimdiff)
        if ! type "$merge_tool" > /dev/null 2>&1; then
            echo "The merge tool $merge_tool is not available"
            exit 1