git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2 v3] mergetool: use path to mergetool in config var mergetool.<tool>.path

From
Steffen Prohaska <prohaska@zib.de>
Date
Oct 18, 2007, 07:52 UTC
Message-ID
<923DDB10-C9E9-4797-9FC1-D31DEEBE75B7@zib.de>
In-Reply-To
<20071018052724.GA27813@spearce.org>
On Oct 18, 2007, at 7:27 AM, Shawn O. Pearce wrote:
Show 24 quoted lines
> Steffen Prohaska <prohaska@zib.de> wrote:
>> This commit adds a mechanism to provide absolute paths to the
>> external programs called by 'git mergetool'.  ...
> ...
>> @@ -297,17 +297,38 @@ do
>>      shift
>>  done
>>
>> +valid_tool() {
>> +	case "$1" in
>> +		kdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff |  
>> gvimdiff)
>> +			;; # happy
>> +		*)
>> +			return 1
>> +			;;
>> +	esac
>> +}
> ...
>> +    test -n "$merge_tool" || valid_tool "$merge_tool" || {
>
> Wouldn't an empty $merge_tool string be caught above in the
> valid_tool function where it falls through and returns 1?
> So isn't test -n here redundant?
Sharp eyes, thanks.
Correct is
test -z "$merge_tool" || valid_tool "$merge_tool" || {

No merge tool or a valid merge tool is allowed at this place. If the tool's already empty there's no need to tell the user that it will be reset to empty.

I'll send a v4 version.
	Steffen
Previous: Shawn O. PearceNext: Steffen Prohaska
Message 5 of 10 in “mergetool”
  1. 0/2 mergetoolSteffen Prohaska, Oct 17, 2007
  2. 1/2 mergetool: use path to mergetool in config var mergetool.<tool>.pathSteffen Prohaska, Oct 17, 2007
  3. 2/2 mergetool: add support for ECMergeSteffen Prohaska, Oct 17, 2007
  4. Shawn O. PearceOct 18, 2007
  5. Steffen ProhaskaOct 18, 2007
  6. 1/2 mergetool: use path to mergetool in config var mergetool.<tool>.pathSteffen Prohaska, Oct 18, 2007
  7. Shawn O. PearceOct 18, 2007
  8. Steffen ProhaskaOct 18, 2007
  9. mergetool: avoid misleading message "Resetting to default..."Steffen Prohaska, Oct 18, 2007
  10. Steffen ProhaskaOct 17, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.