All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: David Kastrup <dak@gnu.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-mergetool: Make default smarter by considering user's desktop environment and editor
Date: Wed, 6 Jun 2007 17:20:31 -0400	[thread overview]
Message-ID: <20070606212031.GD9708@thunk.org> (raw)
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

      reply	other threads:[~2007-06-06 21:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06  4:28 [PATCH] git-mergetool: Make default smarter by considering user's desktop environment and editor Josh Triplett
2007-06-06  8:08 ` Junio C Hamano
2007-06-06  8:52   ` David Kastrup
2007-06-06  9:05     ` Junio C Hamano
2007-06-06  9:40       ` David Kastrup
2007-06-06 21:20         ` Theodore Tso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070606212031.GD9708@thunk.org \
    --to=tytso@mit.edu \
    --cc=dak@gnu.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.