Skip to content

Commit ded944f

Browse files
committed
Merge branch 'jc/environ-docs' into maint-2.38
Documentation on various Boolean GIT_* environment variables have been clarified. * jc/environ-docs: environ: GIT_INDEX_VERSION affects not just a new repository environ: simplify description of GIT_INDEX_FILE environ: GIT_FLUSH should be made a usual Boolean environ: explain Boolean environment variables environ: document GIT_SSL_NO_VERIFY
2 parents 86fa968 + 819fb68 commit ded944f

File tree

2 files changed

+28
-16
lines changed

2 files changed

+28
-16
lines changed

Documentation/git.txt

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,12 @@ Please see linkgit:gitglossary[7].
458458

459459
Environment Variables
460460
---------------------
461-
Various Git commands use the following environment variables:
461+
Various Git commands pay attention to environment variables and change
462+
their behavior. The environment variables marked as "Boolean" take
463+
their values the same way as Boolean valued configuration variables, e.g.
464+
"true", "yes", "on" and positive numbers are taken as "yes".
465+
466+
Here are the variables:
462467

463468
The Git Repository
464469
~~~~~~~~~~~~~~~~~~
@@ -467,13 +472,13 @@ is worth noting that they may be used/overridden by SCMS sitting above
467472
Git so take care if using a foreign front-end.
468473

469474
`GIT_INDEX_FILE`::
470-
This environment allows the specification of an alternate
475+
This environment variable specifies an alternate
471476
index file. If not specified, the default of `$GIT_DIR/index`
472477
is used.
473478

474479
`GIT_INDEX_VERSION`::
475-
This environment variable allows the specification of an index
476-
version for new repositories. It won't affect existing index
480+
This environment variable specifies what index version is used
481+
when writing the index file out. It won't affect existing index
477482
files. By default index file version 2 or 3 is used. See
478483
linkgit:git-update-index[1] for more information.
479484

@@ -530,7 +535,7 @@ double-quotes and respecting backslash escapes. E.g., the value
530535
When run in a directory that does not have ".git" repository
531536
directory, Git tries to find such a directory in the parent
532537
directories to find the top of the working tree, but by default it
533-
does not cross filesystem boundaries. This environment variable
538+
does not cross filesystem boundaries. This Boolean environment variable
534539
can be set to true to tell Git not to stop at filesystem
535540
boundaries. Like `GIT_CEILING_DIRECTORIES`, this will not affect
536541
an explicit repository directory set via `GIT_DIR` or on the
@@ -682,6 +687,11 @@ for further details.
682687
plink or tortoiseplink. This variable overrides the config setting
683688
`ssh.variant` that serves the same purpose.
684689

690+
`GIT_SSL_NO_VERIFY`::
691+
Setting and exporting this environment variable to any value
692+
tells Git not to verify the SSL certificate when fetching or
693+
pushing over HTTPS.
694+
685695
`GIT_ASKPASS`::
686696
If this environment variable is set, then Git commands which need to
687697
acquire passwords or passphrases (e.g. for HTTP or IMAP authentication)
@@ -690,7 +700,7 @@ for further details.
690700
option in linkgit:git-config[1].
691701

692702
`GIT_TERMINAL_PROMPT`::
693-
If this environment variable is set to `0`, git will not prompt
703+
If this Boolean environment variable is set to false, git will not prompt
694704
on the terminal (e.g., when asking for HTTP authentication).
695705

696706
`GIT_CONFIG_GLOBAL`::
@@ -705,13 +715,14 @@ for further details.
705715

706716
`GIT_CONFIG_NOSYSTEM`::
707717
Whether to skip reading settings from the system-wide
708-
`$(prefix)/etc/gitconfig` file. This environment variable can
718+
`$(prefix)/etc/gitconfig` file. This Boolean environment variable can
709719
be used along with `$HOME` and `$XDG_CONFIG_HOME` to create a
710720
predictable environment for a picky script, or you can set it
711-
temporarily to avoid using a buggy `/etc/gitconfig` file while
721+
to true to temporarily avoid using a buggy `/etc/gitconfig` file while
712722
waiting for someone with sufficient permissions to fix it.
713723

714724
`GIT_FLUSH`::
725+
// NEEDSWORK: make it into a usual Boolean environment variable
715726
If this environment variable is set to "1", then commands such
716727
as 'git blame' (in incremental mode), 'git rev-list', 'git log',
717728
'git check-attr' and 'git check-ignore' will
@@ -852,11 +863,11 @@ for full details.
852863
`GIT_TRACE_REDACT`::
853864
By default, when tracing is activated, Git redacts the values of
854865
cookies, the "Authorization:" header, the "Proxy-Authorization:"
855-
header and packfile URIs. Set this variable to `0` to prevent this
866+
header and packfile URIs. Set this Boolean environment variable to false to prevent this
856867
redaction.
857868

858869
`GIT_LITERAL_PATHSPECS`::
859-
Setting this variable to `1` will cause Git to treat all
870+
Setting this Boolean environment variable to true will cause Git to treat all
860871
pathspecs literally, rather than as glob patterns. For example,
861872
running `GIT_LITERAL_PATHSPECS=1 git log -- '*.c'` will search
862873
for commits that touch the path `*.c`, not any paths that the
@@ -865,15 +876,15 @@ for full details.
865876
`git ls-tree`, `--raw` diff output, etc).
866877

867878
`GIT_GLOB_PATHSPECS`::
868-
Setting this variable to `1` will cause Git to treat all
879+
Setting this Boolean environment variable to true will cause Git to treat all
869880
pathspecs as glob patterns (aka "glob" magic).
870881

871882
`GIT_NOGLOB_PATHSPECS`::
872-
Setting this variable to `1` will cause Git to treat all
883+
Setting this Boolean environment variable to true will cause Git to treat all
873884
pathspecs as literal (aka "literal" magic).
874885

875886
`GIT_ICASE_PATHSPECS`::
876-
Setting this variable to `1` will cause Git to treat all
887+
Setting this Boolean environment variable to true will cause Git to treat all
877888
pathspecs as case-insensitive.
878889

879890
`GIT_REFLOG_ACTION`::
@@ -887,7 +898,7 @@ for full details.
887898
end user, to be recorded in the body of the reflog.
888899

889900
`GIT_REF_PARANOIA`::
890-
If set to `0`, ignore broken or badly named refs when iterating
901+
If this Boolean environment variable is set to false, ignore broken or badly named refs when iterating
891902
over lists of refs. Normally Git will try to include any such
892903
refs, which may cause some operations to fail. This is usually
893904
preferable, as potentially destructive operations (e.g.,
@@ -906,7 +917,7 @@ for full details.
906917
`protocol.allow` in linkgit:git-config[1] for more details.
907918

908919
`GIT_PROTOCOL_FROM_USER`::
909-
Set to 0 to prevent protocols used by fetch/push/clone which are
920+
Set this Boolean environment variable to false to prevent protocols used by fetch/push/clone which are
910921
configured to the `user` state. This is useful to restrict recursive
911922
submodule initialization from an untrusted repository or for programs
912923
which feed potentially-untrusted URLS to git commands. See
@@ -934,7 +945,7 @@ only affects clones and fetches; it is not yet used for pushes (but may
934945
be in the future).
935946

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

write-or-die.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ void maybe_flush_or_die(FILE *f, const char *desc)
2323

2424
if (f == stdout) {
2525
if (skip_stdout_flush < 0) {
26+
/* NEEDSWORK: make this a normal Boolean */
2627
cp = getenv("GIT_FLUSH");
2728
if (cp)
2829
skip_stdout_flush = (atoi(cp) == 0);

0 commit comments

Comments
 (0)