Skip to content

Commit 80f0b3f

Browse files
committed
environ: explain Boolean environment variables
Many environment variables use the git_env_bool() API to parse their values, and allow the usual "true/yes/on are true, false/no/off are false. In addition non-zero numbers are true and zero is false. An empty string is also false." set of values. Mark them as such, and consistently say "true" or "false", instead of random mixes of '1', '0', 'yes', 'true', etc. in their description. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 29491ca commit 80f0b3f

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

Documentation/git.txt

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,12 @@ Please see linkgit:gitglossary[7].
441441

442442
Environment Variables
443443
---------------------
444-
Various Git commands use the following environment variables:
444+
Various Git commands pay attention to environment variables and change
445+
their behavior. The environment variables marked as "Boolean" take
446+
their values the same way as Boolean valued configuration variables, e.g.
447+
"true", "yes", "on" and positive numbers are taken as "yes".
448+
449+
Here are the variables:
445450

446451
The Git Repository
447452
~~~~~~~~~~~~~~~~~~
@@ -513,7 +518,7 @@ double-quotes and respecting backslash escapes. E.g., the value
513518
When run in a directory that does not have ".git" repository
514519
directory, Git tries to find such a directory in the parent
515520
directories to find the top of the working tree, but by default it
516-
does not cross filesystem boundaries. This environment variable
521+
does not cross filesystem boundaries. This Boolean environment variable
517522
can be set to true to tell Git not to stop at filesystem
518523
boundaries. Like `GIT_CEILING_DIRECTORIES`, this will not affect
519524
an explicit repository directory set via `GIT_DIR` or on the
@@ -678,7 +683,7 @@ for further details.
678683
option in linkgit:git-config[1].
679684

680685
`GIT_TERMINAL_PROMPT`::
681-
If this environment variable is set to `0`, git will not prompt
686+
If this Boolean environment variable is set to false, git will not prompt
682687
on the terminal (e.g., when asking for HTTP authentication).
683688

684689
`GIT_CONFIG_GLOBAL`::
@@ -693,10 +698,10 @@ for further details.
693698

694699
`GIT_CONFIG_NOSYSTEM`::
695700
Whether to skip reading settings from the system-wide
696-
`$(prefix)/etc/gitconfig` file. This environment variable can
701+
`$(prefix)/etc/gitconfig` file. This Boolean environment variable can
697702
be used along with `$HOME` and `$XDG_CONFIG_HOME` to create a
698703
predictable environment for a picky script, or you can set it
699-
temporarily to avoid using a buggy `/etc/gitconfig` file while
704+
to true to temporarily avoid using a buggy `/etc/gitconfig` file while
700705
waiting for someone with sufficient permissions to fix it.
701706

702707
`GIT_FLUSH`::
@@ -840,11 +845,11 @@ for full details.
840845
`GIT_TRACE_REDACT`::
841846
By default, when tracing is activated, Git redacts the values of
842847
cookies, the "Authorization:" header, the "Proxy-Authorization:"
843-
header and packfile URIs. Set this variable to `0` to prevent this
848+
header and packfile URIs. Set this Boolean environment variable to false to prevent this
844849
redaction.
845850

846851
`GIT_LITERAL_PATHSPECS`::
847-
Setting this variable to `1` will cause Git to treat all
852+
Setting this Boolean environment variable to true will cause Git to treat all
848853
pathspecs literally, rather than as glob patterns. For example,
849854
running `GIT_LITERAL_PATHSPECS=1 git log -- '*.c'` will search
850855
for commits that touch the path `*.c`, not any paths that the
@@ -853,15 +858,15 @@ for full details.
853858
`git ls-tree`, `--raw` diff output, etc).
854859

855860
`GIT_GLOB_PATHSPECS`::
856-
Setting this variable to `1` will cause Git to treat all
861+
Setting this Boolean environment variable to true will cause Git to treat all
857862
pathspecs as glob patterns (aka "glob" magic).
858863

859864
`GIT_NOGLOB_PATHSPECS`::
860-
Setting this variable to `1` will cause Git to treat all
865+
Setting this Boolean environment variable to true will cause Git to treat all
861866
pathspecs as literal (aka "literal" magic).
862867

863868
`GIT_ICASE_PATHSPECS`::
864-
Setting this variable to `1` will cause Git to treat all
869+
Setting this Boolean environment variable to true will cause Git to treat all
865870
pathspecs as case-insensitive.
866871

867872
`GIT_REFLOG_ACTION`::
@@ -875,7 +880,7 @@ for full details.
875880
end user, to be recorded in the body of the reflog.
876881

877882
`GIT_REF_PARANOIA`::
878-
If set to `0`, ignore broken or badly named refs when iterating
883+
If this Boolean environment variable is set to false, ignore broken or badly named refs when iterating
879884
over lists of refs. Normally Git will try to include any such
880885
refs, which may cause some operations to fail. This is usually
881886
preferable, as potentially destructive operations (e.g.,
@@ -894,7 +899,7 @@ for full details.
894899
`protocol.allow` in linkgit:git-config[1] for more details.
895900

896901
`GIT_PROTOCOL_FROM_USER`::
897-
Set to 0 to prevent protocols used by fetch/push/clone which are
902+
Set this Boolean environment variable to false to prevent protocols used by fetch/push/clone which are
898903
configured to the `user` state. This is useful to restrict recursive
899904
submodule initialization from an untrusted repository or for programs
900905
which feed potentially-untrusted URLS to git commands. See
@@ -922,7 +927,7 @@ only affects clones and fetches; it is not yet used for pushes (but may
922927
be in the future).
923928

924929
`GIT_OPTIONAL_LOCKS`::
925-
If set to `0`, Git will complete any requested operation without
930+
If this Boolean environment variable is set to false, Git will complete any requested operation without
926931
performing any optional sub-operations that require taking a lock.
927932
For example, this will prevent `git status` from refreshing the
928933
index as a side effect. This is useful for processes running in

0 commit comments

Comments
 (0)