From 29491ca5fd8dcc4d60b985548c133756590b4b8a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 15 Sep 2022 09:06:55 -0700 Subject: [PATCH 1/5] environ: document GIT_SSL_NO_VERIFY Even though the name of the environment variable is mentioned in "git config --help" from http.sslVerify, there is no description for it. Add one. Note that this is not a usual Boolean environment variable whose value can be yes/true/on vs no/false/off; the existence of it is enough to trigger the feature named by the variable. Signed-off-by: Junio C Hamano --- Documentation/git.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/git.txt b/Documentation/git.txt index 47a6095ff4..0b562981b7 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -665,6 +665,11 @@ for further details. plink or tortoiseplink. This variable overrides the config setting `ssh.variant` that serves the same purpose. +`GIT_SSL_NO_VERIFY`:: + Setting and exporting this environment variable to any value + tells Git not to verify the SSL certificate when fetching or + pushing over HTTPS. + `GIT_ASKPASS`:: If this environment variable is set, then Git commands which need to acquire passwords or passphrases (e.g. for HTTP or IMAP authentication) From 80f0b3f397d6467cb6f6fc9456b867aaffdc9b8c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 15 Sep 2022 09:06:56 -0700 Subject: [PATCH 2/5] 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 --- Documentation/git.txt | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/Documentation/git.txt b/Documentation/git.txt index 0b562981b7..00ab9d7978 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -441,7 +441,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 ~~~~~~~~~~~~~~~~~~ @@ -513,7 +518,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 @@ -678,7 +683,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`:: @@ -693,10 +698,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`:: @@ -840,11 +845,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 @@ -853,15 +858,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`:: @@ -875,7 +880,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., @@ -894,7 +899,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 @@ -922,7 +927,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 From fd01795beb1bda7aa738b443bcb01cc9df70059a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 15 Sep 2022 09:06:57 -0700 Subject: [PATCH 3/5] environ: GIT_FLUSH should be made a usual Boolean This uses atoi() and checks if the result is not zero to decide what to do. Turning it into the usual Boolean environment variable to use git_env_bool() would not break those who have been using "set to 0, or set to non-zero, that can be parsed with atoi()" values, but will match the expectation of those who expected "true" to mean "yes". Signed-off-by: Junio C Hamano --- Documentation/git.txt | 1 + write-or-die.c | 1 + 2 files changed, 2 insertions(+) diff --git a/Documentation/git.txt b/Documentation/git.txt index 00ab9d7978..8159a4b3a4 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -705,6 +705,7 @@ for further details. waiting for someone with sufficient permissions to fix it. `GIT_FLUSH`:: +// NEEDSWORK: make it into a usual Boolean environment variable If this environment variable is set to "1", then commands such as 'git blame' (in incremental mode), 'git rev-list', 'git log', 'git check-attr' and 'git check-ignore' will diff --git a/write-or-die.c b/write-or-die.c index c4fd91b5b4..aaa0318e82 100644 --- a/write-or-die.c +++ b/write-or-die.c @@ -23,6 +23,7 @@ void maybe_flush_or_die(FILE *f, const char *desc) if (f == stdout) { if (skip_stdout_flush < 0) { + /* NEEDSWORK: make this a normal Boolean */ cp = getenv("GIT_FLUSH"); if (cp) skip_stdout_flush = (atoi(cp) == 0); From b724df6b559d895b035cafa6f7e55216f581f7c1 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 15 Sep 2022 09:06:58 -0700 Subject: [PATCH 4/5] environ: simplify description of GIT_INDEX_FILE Signed-off-by: Junio C Hamano --- Documentation/git.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git.txt b/Documentation/git.txt index 8159a4b3a4..e173c47f38 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -455,7 +455,7 @@ is worth noting that they may be used/overridden by SCMS sitting above Git so take care if using a foreign front-end. `GIT_INDEX_FILE`:: - This environment allows the specification of an alternate + This environment variable specifies an alternate index file. If not specified, the default of `$GIT_DIR/index` is used. From 819fb682225e096096b05c4a3aff16ebcabfcfd4 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 15 Sep 2022 09:06:59 -0700 Subject: [PATCH 5/5] environ: GIT_INDEX_VERSION affects not just a new repository The variable is consulted whenever we write the index file. Signed-off-by: Junio C Hamano --- Documentation/git.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/git.txt b/Documentation/git.txt index e173c47f38..c0b8b627b4 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -460,8 +460,8 @@ Git so take care if using a foreign front-end. is used. `GIT_INDEX_VERSION`:: - This environment variable allows the specification of an index - version for new repositories. It won't affect existing index + This environment variable specifies what index version is used + when writing the index file out. It won't affect existing index files. By default index file version 2 or 3 is used. See linkgit:git-update-index[1] for more information.