From: John Keeping Date: Mon, 28 Jan 2013 22:21:47 GMT Subject: Re: [PATCH v2 0/4] Auto-generate mergetool lists Message-ID: <20130128222147.GD7498@serenity.lan> In-Reply-To: <7vk3qxugdg.fsf@alter.siamese.dyndns.org> On Mon, Jan 28, 2013 at 01:50:19PM -0800, Junio C Hamano wrote: > What are the situations where a valid user-defined tools is > unavailable, by the way? The same as a built-in tool: the command isn't available. Currently I'm extracting the command word using: cmd=$(eval -- "set -- $(git config mergetool.$tool.cmd); echo \"$1\"") (it's slightly more complicated due to handling difftool.$tool.cmd as well, but that's essentially it). Then it just uses the same "type $cmd" test as for built-in tools. I don't know if there's a better way to extract the first word, but that's the best I've come up with so far. John