Re: [PATCH] difftool: print list of valid tools with '--tool-help'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 23, 2012, 19:48 UTC
- Message-ID
- <7vzkb7rtd0.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CAFouethYEmY7g3Uw0HfFMOKFNcBv=TyAsSyEkBU-cQrhaf6v7g@mail.gmail.com>
Tim Henigan <tim.henigan@gmail.com> writes:
Show 8 quoted lines
> 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.