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

Re: [PATCH] git-mergetool: Make default smarter by considering user's desktop environment and editor

From
Theodore Tso <tytso@mit.edu>
Date
Jun 6, 2007, 21:20 UTC
Message-ID
<20070606212031.GD9708@thunk.org>
In-Reply-To
<86lkexjua3.fsf@lola.quinscape.zz>
This is what I've been experimenting in my tree; what do people think?
if test -z "$merge_tool" ; then
    if test -n "$DISPLAY"; then
	merge_tool_candidates="kdiff3 tkdiff xxdiff meld gvimdiff"
	if test "$GNOME_DESKTOP_SESSION_ID"x != ""x; then
	    merge_tool_candidates="meld $merge_tool_candidates"
	fi
	if test "$KDE_FULL_SESSION"x = "true"x; then
	    merge_tool_candidates="kdiff3 $merge_tool_candidates"
	fi
    fi
    if echo "${VISUAL:-$EDITOR}" | grep 'emacs' > /dev/null 2>&1; then
	merge_tool_candidates="$merge_tool_candidates emerge"
    fi
    if echo "${VISUAL:-$EDITOR}" | grep 'vim' > /dev/null 2>&1; then
	merge_tool_candidates="$merge_tool_candidates vimdiff"
    fi
    merge_tool_candidates="$merge_tool_candidates opendiff emerge vimdiff"
    echo "merge tool candidates: $merge_tool_candidates"
    for i in $merge_tool_candidates; do
	if test $i = emerge ; then
	    cmd=emacs
	else
	    cmd=$i
	fi
	if type $cmd > /dev/null 2>&1; then
	    echo merge_tool chosen is $i
	    merge_tool=$i
	    break
	fi
    done
fi
						- Ted
Previous: David Kastrup
Message 6 of 6 in “git-mergetool: Make default smarter by considering user's desktop environment and editor”
  1. git-mergetool: Make default smarter by considering user's desktop environment and editorJosh Triplett, Jun 6, 2007
  2. Junio C HamanoJun 6, 2007
  3. David KastrupJun 6, 2007
  4. Junio C HamanoJun 6, 2007
  5. David KastrupJun 6, 2007
  6. Theodore TsoJun 6, 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.