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

Re: [PATCH] doc: clarify "config --bool" behaviour with empty values

From
Andreas Heiduk <asheiduk@gmail.com>
Date
Aug 14, 2017, 22:07 UTC
Message-ID
<914098af-00a9-fbc8-cdfe-a65918b2951b@gmail.com>
In-Reply-To
<xmqq60dqvxw1.fsf@gitster.mtv.corp.google.com>
Am 14.08.2017 um 19:53 schrieb Junio C Hamano:
Show 24 quoted lines
> Andreas Heiduk <asheiduk@gmail.com> writes:
> 
>> `git config --bool xxx.yyy` returns `true` for `[xxx]yyy` but
>> `false` for `[xxx]yyy=` or `[xxx]yyy=""`.  This is tested in
>> t1300-repo-config.sh since 09bc098c2.
>>
>> Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
>> ---
>>  Documentation/config.txt | 3 ++-
>>  Documentation/git.txt    | 3 ++-
>>  2 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/config.txt b/Documentation/config.txt
>> index d5c9c4cab..d3261006b 100644
>> --- a/Documentation/config.txt
>> +++ b/Documentation/config.txt
>> @@ -221,7 +221,8 @@ boolean::
>>  		is taken as true.
>>  
>>         false;; Boolean false can be spelled as `no`, `off`,
>> -		`false`, or `0`.
>> +		`false`, `0`, no value (but still with `=`) or the
>> +		empty string.
> 
[...]
 
> However, I think this "no value (but still with '=')" is making it
> more confusing than necessary for two reasons.
[...]
 
> I notice that in this Values section (where the boolean:: is the
> first entry) there is no mention on how to spell a string value.
I assumed this is due to the pretext of the definition list:
	Values of many variables are treated as a simple string, but there
	are variables that take values of specific types and there are rules
	as to how to spell them.

After that I would NOT expect string values to be "specific". Also: If string values are explained here in the "Values" section, the line-breaking and escape sequences syntax should be here too.

So my (minimal) suggestion is:
       false;; Boolean false literals are `no`, `off`,
                `false`, `0` and the empty string.
I'll adapt `true` in the same style and resend a patch.
Previous: Junio C HamanoNext: Andreas Heiduk
Message 3 of 6 in “doc: clarify "config --bool" behaviour with empty values”
  1. doc: clarify "config --bool" behaviour with empty valuesAndreas Heiduk, Aug 13, 2017
  2. Junio C HamanoAug 14, 2017
  3. Andreas HeidukAug 14, 2017
  4. doc: clarify "config --bool" behaviour with empty valuesAndreas Heiduk, Aug 14, 2017
  5. Junio C HamanoAug 14, 2017
  6. Junio C HamanoAug 14, 2017

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.