Skip to content

Commit 7f0a02b

Browse files
asheidukgitster
authored andcommitted
doc: clarify "config --bool" behaviour with empty string
`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 09bc098. Signed-off-by: Andreas Heiduk <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3b82744 commit 7f0a02b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Documentation/config.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,15 @@ boolean::
133133
synonyms are accepted for 'true' and 'false'; these are all
134134
case-insensitive.
135135

136-
true;; Boolean true can be spelled as `yes`, `on`, `true`,
137-
or `1`. Also, a variable defined without `= <value>`
136+
true;; Boolean true literals are `yes`, `on`, `true`,
137+
and `1`. Also, a variable defined without `= <value>`
138138
is taken as true.
139139

140-
false;; Boolean false can be spelled as `no`, `off`,
141-
`false`, or `0`.
140+
false;; Boolean false literals are `no`, `off`, `false`,
141+
`0` and the empty string.
142142
+
143143
When converting value to the canonical form using `--bool` type
144-
specifier; 'git config' will ensure that the output is "true" or
144+
specifier, 'git config' will ensure that the output is "true" or
145145
"false" (spelled in lowercase).
146146

147147
integer::

Documentation/git.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,8 @@ example the following invocations are equivalent:
571571
Note that omitting the `=` in `git -c foo.bar ...` is allowed and sets
572572
`foo.bar` to the boolean true value (just like `[foo]bar` would in a
573573
config file). Including the equals but with an empty value (like `git -c
574-
foo.bar= ...`) sets `foo.bar` to the empty string.
574+
foo.bar= ...`) sets `foo.bar` to the empty string which ` git config
575+
--bool` will convert to `false`.
575576

576577
--exec-path[=<path>]::
577578
Path to wherever your core Git programs are installed.

0 commit comments

Comments
 (0)