git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] mergetool: Add support for vimdiff.

From
Theodore Tso <tytso@mit.edu>
Date
Mar 19, 2007, 02:18 UTC
Message-ID
<20070319021827.GB11371@thunk.org>
In-Reply-To
<11742569263141-git-send-email-jbowes@dangerouslyinc.com>
Hi James,
	Thanks for adding vimdiff support!  One minor nit, which I
fixed before applying to my tree:  You didn't update git-mergetool.txt
and config.txt in the Documentation directory to add "vimdiff" to the
list of possible merge resolution tools.
Junio, please pull from:
	git://repo.or.cz/git/mergetool.git
						- Ted
commit 9cec65399d3575774910b21c1cfd762a5e88a245
Author: James Bowes <jbowes@dangerouslyinc.com>
Date:   Sun Mar 18 22:11:54 2007 -0400
    mergetool: Add support for vimdiff.
    
    Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 953acae..6688642 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -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
diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt
index ae69a0e..5baaaca 100644
--- a/Documentation/git-mergetool.txt
+++ b/Documentation/git-mergetool.txt
@@ -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
diff --git a/git-mergetool.sh b/git-mergetool.sh
index 52386a5..563c5c0 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -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
Previous: James Bowes
Message 2 of 2 in “mergetool: Add support for vimdiff.”
  1. mergetool: Add support for vimdiff.James Bowes, Mar 18, 2007
  2. Theodore TsoMar 19, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.