From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH 2/5] environ: explain Boolean environment variables
Date: Thu, 15 Sep 2022 09:06:56 -0700 [thread overview]
Message-ID: <20220915160659.126441-3-gitster@pobox.com> (raw)
In-Reply-To: <20220915160659.126441-1-gitster@pobox.com>
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 <gitster@pobox.com>
---
Documentation/git.txt | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 1b7e37e79a..e2f61a1ec8 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -458,7 +458,12 @@ Please see linkgit:gitglossary[7].
Environment Variables
---------------------
-Various Git commands use the following environment variables:
+Various Git commands pay attention to environment variables and change
+their behavior. The environment variables marked as "Boolean" take
+their values the same way as Boolean valued configuration variables, e.g.
+"true", "yes", "on" and positive numbers are taken as "yes".
+
+Here are the variables:
The Git Repository
~~~~~~~~~~~~~~~~~~
@@ -530,7 +535,7 @@ double-quotes and respecting backslash escapes. E.g., the value
When run in a directory that does not have ".git" repository
directory, Git tries to find such a directory in the parent
directories to find the top of the working tree, but by default it
- does not cross filesystem boundaries. This environment variable
+ does not cross filesystem boundaries. This Boolean environment variable
can be set to true to tell Git not to stop at filesystem
boundaries. Like `GIT_CEILING_DIRECTORIES`, this will not affect
an explicit repository directory set via `GIT_DIR` or on the
@@ -695,7 +700,7 @@ for further details.
option in linkgit:git-config[1].
`GIT_TERMINAL_PROMPT`::
- If this environment variable is set to `0`, git will not prompt
+ If this Boolean environment variable is set to false, git will not prompt
on the terminal (e.g., when asking for HTTP authentication).
`GIT_CONFIG_GLOBAL`::
@@ -710,10 +715,10 @@ for further details.
`GIT_CONFIG_NOSYSTEM`::
Whether to skip reading settings from the system-wide
- `$(prefix)/etc/gitconfig` file. This environment variable can
+ `$(prefix)/etc/gitconfig` file. This Boolean environment variable can
be used along with `$HOME` and `$XDG_CONFIG_HOME` to create a
predictable environment for a picky script, or you can set it
- temporarily to avoid using a buggy `/etc/gitconfig` file while
+ to true to temporarily avoid using a buggy `/etc/gitconfig` file while
waiting for someone with sufficient permissions to fix it.
`GIT_FLUSH`::
@@ -857,11 +862,11 @@ for full details.
`GIT_TRACE_REDACT`::
By default, when tracing is activated, Git redacts the values of
cookies, the "Authorization:" header, the "Proxy-Authorization:"
- header and packfile URIs. Set this variable to `0` to prevent this
+ header and packfile URIs. Set this Boolean environment variable to false to prevent this
redaction.
`GIT_LITERAL_PATHSPECS`::
- Setting this variable to `1` will cause Git to treat all
+ Setting this Boolean environment variable to true will cause Git to treat all
pathspecs literally, rather than as glob patterns. For example,
running `GIT_LITERAL_PATHSPECS=1 git log -- '*.c'` will search
for commits that touch the path `*.c`, not any paths that the
@@ -870,15 +875,15 @@ for full details.
`git ls-tree`, `--raw` diff output, etc).
`GIT_GLOB_PATHSPECS`::
- Setting this variable to `1` will cause Git to treat all
+ Setting this Boolean environment variable to true will cause Git to treat all
pathspecs as glob patterns (aka "glob" magic).
`GIT_NOGLOB_PATHSPECS`::
- Setting this variable to `1` will cause Git to treat all
+ Setting this Boolean environment variable to true will cause Git to treat all
pathspecs as literal (aka "literal" magic).
`GIT_ICASE_PATHSPECS`::
- Setting this variable to `1` will cause Git to treat all
+ Setting this Boolean environment variable to true will cause Git to treat all
pathspecs as case-insensitive.
`GIT_REFLOG_ACTION`::
@@ -892,7 +897,7 @@ for full details.
end user, to be recorded in the body of the reflog.
`GIT_REF_PARANOIA`::
- If set to `0`, ignore broken or badly named refs when iterating
+ If this Boolean environment variable is set to false, ignore broken or badly named refs when iterating
over lists of refs. Normally Git will try to include any such
refs, which may cause some operations to fail. This is usually
preferable, as potentially destructive operations (e.g.,
@@ -911,7 +916,7 @@ for full details.
`protocol.allow` in linkgit:git-config[1] for more details.
`GIT_PROTOCOL_FROM_USER`::
- Set to 0 to prevent protocols used by fetch/push/clone which are
+ Set this Boolean environment variable to false to prevent protocols used by fetch/push/clone which are
configured to the `user` state. This is useful to restrict recursive
submodule initialization from an untrusted repository or for programs
which feed potentially-untrusted URLS to git commands. See
@@ -939,7 +944,7 @@ only affects clones and fetches; it is not yet used for pushes (but may
be in the future).
`GIT_OPTIONAL_LOCKS`::
- If set to `0`, Git will complete any requested operation without
+ If this Boolean environment variable is set to false, Git will complete any requested operation without
performing any optional sub-operations that require taking a lock.
For example, this will prevent `git status` from refreshing the
index as a side effect. This is useful for processes running in
--
2.37.3-780-gd940517dcb
next prev parent reply other threads:[~2022-09-15 16:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 1:46 BUG: Value for GIT_SSL_NO_VERIFY has no effect Brijesh Patel
2022-09-15 13:04 ` brian m. carlson
2022-09-15 15:27 ` Junio C Hamano
2022-09-15 16:06 ` [PATCH 0/5] Update docs on GIT_* environment variables Junio C Hamano
2022-09-15 16:06 ` [PATCH 1/5] environ: document GIT_SSL_NO_VERIFY Junio C Hamano
2022-09-15 16:06 ` Junio C Hamano [this message]
2022-09-15 16:06 ` [PATCH 3/5] environ: GIT_FLUSH should be made a usual Boolean Junio C Hamano
2023-01-03 17:18 ` René Scharfe
2023-01-04 6:37 ` Junio C Hamano
2023-01-04 16:36 ` René Scharfe
2023-01-04 7:33 ` Jeff King
2023-01-04 16:36 ` René Scharfe
2023-01-06 9:10 ` Jeff King
2022-09-15 16:06 ` [PATCH 4/5] environ: simplify description of GIT_INDEX_FILE Junio C Hamano
2022-09-16 15:39 ` Todd Zullinger
2022-09-16 16:44 ` Junio C Hamano
2022-09-15 16:06 ` [PATCH 5/5] environ: GIT_INDEX_VERSION affects not just a new repository Junio C Hamano
2022-09-15 16:15 ` BUG: Value for GIT_SSL_NO_VERIFY has no effect brian m. carlson
2022-09-15 18:05 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220915160659.126441-3-gitster@pobox.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).