Re: [PATCH] git-mergetool: Make default smarter by considering user's desktop environment and editor
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 6, 2007, 09:05 UTC
- Message-ID
- <7vabvd5u7t.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <86tztljwgk.fsf@lola.quinscape.zz>
David Kastrup <dak@gnu.org> writes:
Show 25 quoted lines
> Junio C Hamano <junkio@cox.net> writes:
>
>> Josh Triplett <josh@freedesktop.org> writes:
>>
>>> Make git-mergetool prefer meld under GNOME, and kdiff3 under KDE. When
>>> considering emerge and vimdiff, check $VISUAL and $EDITOR to see which the
>>> user might prefer.
>>>
>>> Signed-off-by: Josh Triplett <josh@freedesktop.org>
>>
>> The basic idea is sound. However...
>>
>> (1) I wonder if we can get rid of the horribly long if .. elif
>> chain by using shell function and then iterate a list of them;
>>
>> (2) echo "${VISUAL-$EDITOR}" | grep '^emacs'???
>>
>> Some people may have explicit path (/home/me/bin/emacs),
>> and/or runs a variant of emacs called 'xemacs'. Same for
>> vim.
>
> Actually, a lot of people run as editor a program called "emacsclient"
> or "gnuclient": this one connects to an existing Emacs session and
> passes its arguments to it. And of course, this is what git-mergetool
> should then also do.I do that too, but that is covered by the prefix rule Josh has, so it is Ok.