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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 14, 2017, 22:24 UTC
Message-ID
<xmqqh8x9u6sy.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170814221218.18874-1-asheiduk@gmail.com>
Andreas Heiduk <asheiduk@gmail.com> writes:
Show 9 quoted lines
> `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 | 10 +++++-----
>  Documentation/git.txt    |  3 ++-
>  2 files changed, 7 insertions(+), 6 deletions(-)
This looks good to me.  Will queue.
Show 39 quoted lines
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index d5c9c4cab..478b9431e 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -216,15 +216,15 @@ boolean::
>         synonyms are accepted for 'true' and 'false'; these are all
>         case-insensitive.
>  
> -       true;; Boolean true can be spelled as `yes`, `on`, `true`,
> -		or `1`.  Also, a variable defined without `= <value>`
> +	true;; Boolean true literals are `yes`, `on`, `true`,
> +		and `1`.  Also, a variable defined without `= <value>`
>  		is taken as true.
>  
> -       false;; Boolean false can be spelled as `no`, `off`,
> -		`false`, or `0`.
> +	false;; Boolean false literals are `no`, `off`, `false`,
> +		`0` and the empty string.
>  +
>  When converting value to the canonical form using `--bool` type
> -specifier; 'git config' will ensure that the output is "true" or
> +specifier, 'git config' will ensure that the output is "true" or
>  "false" (spelled in lowercase).
>  
>  integer::
> diff --git a/Documentation/git.txt b/Documentation/git.txt
> index 7dd5e0328..6e3a6767e 100644
> --- a/Documentation/git.txt
> +++ b/Documentation/git.txt
> @@ -75,7 +75,8 @@ example the following invocations are equivalent:
>  Note that omitting the `=` in `git -c foo.bar ...` is allowed and sets
>  `foo.bar` to the boolean true value (just like `[foo]bar` would in a
>  config file). Including the equals but with an empty value (like `git -c
> -foo.bar= ...`) sets `foo.bar` to the empty string.
> +foo.bar= ...`) sets `foo.bar` to the empty string which ` git config
> +--bool` will convert to `false`.
>  
>  --exec-path[=<path>]::
>  	Path to wherever your core Git programs are installed.
Previous: Andreas HeidukNext: Junio C Hamano
Message 5 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.