@matheusbsbs / matheus-bagliano / commits / 9cec65399d
Fork 0

mergetool: Add support for vimdiff.

Signed-off-by: James Bowes <jbowes@dangerouslyinc.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

James Bowes committed Mar 18, 2007 at 22:11 UTC 9cec65399d3575774910b21c1cfd762a5e88a245
3 files changed +7 -5
Documentation/config.txt
+1 -1
@@ -460,7 +460,7 @@ merge.summary::
460 merge.tool::
461 Controls which merge resolution program is used by
462 gitlink:git-mergetool[l]. Valid values are: "kdiff3", "tkdiff",
463 - "meld", "xxdiff", "emerge"
463 + "meld", "xxdiff", "emerge", "vimdiff"
464
465 merge.verbosity::
466 Controls the amount of output shown by the recursive merge
Documentation/git-mergetool.txt
+1 -1
@@ -25,7 +25,7 @@ OPTIONS
25 -t or --tool=<tool>::
26 Use the merge resolution program specified by <tool>.
27 Valid merge tools are:
28 - kdiff3, tkdiff, meld, xxdiff, and emerge.
28 + kdiff3, tkdiff, meld, xxdiff, emerge, and vimdiff.
29
30 If a merge resolution program is not specified, 'git mergetool'
31 will use the configuration variable merge.tool. If the
git-mergetool.sh
+5 -3
@@ -185,9 +185,9 @@ merge_file () {
185 mv -- "$BACKUP" "$path.orig"
186 fi
187 ;;
188 - meld)
188 + meld|vimdiff)
189 touch "$BACKUP"
190 - meld -- "$LOCAL" "$path" "$REMOTE"
190 + $merge_tool -- "$LOCAL" "$path" "$REMOTE"
191 if test "$path" -nt "$BACKUP" ; then
192 status=0;
193 else
@@ -305,6 +305,8 @@ if test -z "$merge_tool" ; then
305 merge_tool=meld
306 elif type emacs >/dev/null 2>&1; then
307 merge_tool=emerge
308 + elif type vimdiff >/dev/null 2>&1; then
309 + merge_tool=vimdiff
310 else
311 echo "No available merge resolution programs available."
312 exit 1
@@ -312,7 +314,7 @@ if test -z "$merge_tool" ; then
314 fi
315
316 case "$merge_tool" in
315 - kdiff3|tkdiff|meld|xxdiff)
317 + kdiff3|tkdiff|meld|xxdiff|vimdiff)
318 if ! type "$merge_tool" > /dev/null 2>&1; then
319 echo "The merge tool $merge_tool is not available"
320 exit 1