Skip to content

Commit 832f56f

Browse files
committed
doc: centrally document various ways tospell true and false
We do not seem to centrally document exhaustively ways to spell Boolean values. The description in the Environment Variables of git(1) section assumes that the reader is already familiar with how "Boolean valued configuration variables" are specified, without referring to anything, so there is no way for the readers to find out more. The description of `bool` in the section on "--type <type>" in "git config --help" might be the place to do so, but it is not telling us all that much. The description of Boolean valued placeholders in the pretty formats section of "git log --help" enumerates the possible values with "etc." implying there may be other synonyms; shrink the list of samples and instead refer to the canonical and authoritative source of truth, which now is git-config(1). Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5c21db3 commit 832f56f

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

Documentation/git-config.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ See also <<FILES>>.
213213
+
214214
Valid `<type>`'s include:
215215
+
216-
- 'bool': canonicalize values as either "true" or "false".
216+
- 'bool': canonicalize values `true`, `yes`,`on`, and positive
217+
numbers as "true", and values `false`, `no`, `off` and `0` as
218+
"false".
217219
- 'int': canonicalize values as simple decimal numbers. An optional suffix of
218220
'k', 'm', or 'g' will cause the value to be multiplied by 1024, 1048576, or
219221
1073741824 upon input.

Documentation/git.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,9 @@ Environment Variables
472472
---------------------
473473
Various Git commands pay attention to environment variables and change
474474
their behavior. The environment variables marked as "Boolean" take
475-
their values the same way as Boolean valued configuration variables, e.g.
476-
"true", "yes", "on" and positive numbers are taken as "yes".
475+
their values the same way as Boolean valued configuration variables, i.e.,
476+
"true", "yes", "on" and positive numbers are taken as "yes", while "false",
477+
"no", "off", and "0" are taken as "no".
477478

478479
Here are the variables:
479480

Documentation/pretty-formats.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,10 @@ insert an empty string unless we are traversing reflog entries (e.g., by
339339
decoration format if `--decorate` was not already provided on the command
340340
line.
341341

342-
The boolean options accept an optional value `[=<bool-value>]`. The values
343-
`true`, `false`, `on`, `off` etc. are all accepted. See the "boolean"
344-
sub-section in "EXAMPLES" in linkgit:git-config[1]. If a boolean
345-
option is given with no value, it's enabled.
342+
The boolean options accept an optional value `[=<bool-value>]`. The
343+
values taken by `--type=bool` git-config[1], like `yes` and `off`,
344+
are all accepted. Giving a boolean option without `=<value>` is
345+
equivalent to giving it with `=true`.
346346

347347
If you add a `+` (plus sign) after '%' of a placeholder, a line-feed
348348
is inserted immediately before the expansion if and only if the

0 commit comments

Comments
 (0)