From: Junio C Hamano Date: Fri, 23 Mar 2012 19:48:43 GMT Subject: Re: [PATCH] difftool: print list of valid tools with '--tool-help' Message-ID: <7vzkb7rtd0.fsf@alter.siamese.dyndns.org> In-Reply-To: Tim Henigan writes: > Rather than create a new entry point, I used the existing > 'get_merge_tool_path' that resides in 'git-mergetool--lib' to > determine if a given tool is actually installed on the system. > > The '$DISPLAY' variable is lost in this implementation, but honestly I > don't understand how it was intended to be used. > > Does this look useful? Sounds like a better way to do it. The point of checking DISPLAY in "cando" is to allow for a tool that changes its behaviour when launched in terminal-only vs windowed environment. For example, if somebody tries to spawn a tool that *only* works in windowed environment (e.g. "kompare") in a terminal-only session, it would fail, and the "cando" mechanism was designed to allow a tool detect such a situation and excuse itself from the available tools list. I think get_merge_tool_path could do the same thing (i.e. report "no executable available to run this tool" when appropriate), so I do not think you lost anything.