Re: [PATCH v2 0/4] Auto-generate mergetool lists
- From
John Keeping <john@keeping.me.uk>
- Date
- Jan 29, 2013, 16:46 UTC
- 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:
Show 17 quoted lines
> 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