From: John Keeping Date: Tue, 29 Jan 2013 16:46:20 GMT Subject: Re: [PATCH v2 0/4] Auto-generate mergetool lists Message-ID: <20130129164619.GA1342@serenity.lan> In-Reply-To: <7vsj5krmng.fsf@alter.siamese.dyndns.org> 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