[PATCH] doc: clarify "config --bool" behaviour with empty values
To
Git Mailing List
Cc
Andreas Heiduk
From
Andreas Heiduk
Date
2017-08-13 09:48:16 UTC
`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.
 +
 When converting value to the canonical form using `--bool` type
 specifier; 'git config' will ensure that the output is "true" or
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.
-- 
2.13.3