From: Joachim Schmitz Date: Tue, 29 Jan 2013 11:56:58 GMT Subject: Re: [PATCH v2 0/4] Auto-generate mergetool lists Message-ID: In-Reply-To: <20130128222147.GD7498@serenity.lan> John Keeping wrote: > 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\"") Shouldnt this work? cmd=$((git config "mergetool.$tool.cmd" || git config "difftool.$tool.cmd") | awk '{print $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