Subject: Re: [PATCH v2 0/4] Auto-generate mergetool lists

From: John Keeping <[email-masked]>
Date: Tue, 29 Jan 2013 16:46:20 +0000

On Tue, Jan 29, 2013 at 08:15:15AM -0800, Junio C Hamano wrote:
> With any backend that is non-trivial, it would not be unusual for
> the *tool.cmd to look like:
> 
>      [mergetool]
>      	mytool = sh -c '
>         	... some massaging to prepare the command line
>                 ... to run the real tool backend comes here, and
>      		... then ...
>                 my_real_tool $arg1 $arg2 ...
> 	'
> 
> and you will end up detecting the presence of the shell, which is
> not very useful.
> 
> I think it is perfectly fine to say "you configured it, so it must
> exist; it may fail when we try to run it but it is your problem".
> It is simpler to explain and requires one less eval.

I think you're right.  The even worse case from this point of view is if
you configure it as:

    [mergetool]
        mytool = 'f() {
            ... code to actually run the tool here ...
        }; f $BASE $REMOTE $LOCAL $MERGED'

which results in a false "unavailable" rather than just a useless check.

John