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

Re: [PATCH] mergetool: Use merge.tool config option.

From
Theodore Tso <tytso@mit.edu>
Date
Mar 19, 2007, 02:32 UTC
Message-ID
<20070319023238.GC11371@thunk.org>
In-Reply-To
<3f80363f0703181811x54acb3f4n689f4fd68f5a5dbe@mail.gmail.com>

It seemed to me that Junio's suggestion made the most amount of sense, but I tinkered with the with the warning message to make it clear that the cause of the warning was a bugus tool in the merge.tool configuration parameter.

This has also been pushed out to git://repo.or.cz/git/mergetool.git
Junio, please pull if you approve...
					- Ted
commit d6678c28e30e836449092a2917d4b0bd6254b06c
Author: Theodore Ts'o <tytso@mit.edu>
Date:   Sun Mar 18 22:30:10 2007 -0400
    mergetool: print an appropriate warning if merge.tool is unknown
    
    Also add support for vimdiff
    
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/git-mergetool.sh b/git-mergetool.sh
index 563c5c0..7942fd0 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -288,10 +288,15 @@ done
 
 if test -z "$merge_tool"; then
     merge_tool=`git-config merge.tool`
-    if test $merge_tool = kdiff3 -o $merge_tool = tkdiff -o \
-	$merge_tool = xxdiff -o $merge_tool = meld ; then
-	unset merge_tool
-    fi
+    case "$merge_tool" in
+	kdiff3 | tkdiff | xxdiff | meld | emerge | vimdiff)
+	    ;; # happy
+	*)
+	    echo >&2 "git config option merge.tool set to unknown tool: $merge_tool"
+	    echo >&2 "Resetting to default..."
+	    unset merge_tool
+	    ;;
+    esac
 fi
 
 if test -z "$merge_tool" ; then
Previous: James BowesNext: Junio C Hamano
Message 4 of 5 in “mergetool: Use merge.tool config option.”
  1. mergetool: Use merge.tool config option.James Bowes, Mar 18, 2007
  2. Junio C HamanoMar 19, 2007
  3. James BowesMar 19, 2007
  4. Theodore TsoMar 19, 2007
  5. Junio C HamanoMar 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.