Skip to content

Commit 19de221

Browse files
committed
Merge branch 'ds/doc-wholesale-disabling-advice-messages'
The environment GIT_ADVICE has been intentionally kept undocumented to discourage its use by interactive users. Add documentation to help tool writers. * ds/doc-wholesale-disabling-advice-messages: advice: recommend GIT_ADVICE=0 for tools
2 parents 17ae0b8 + fb2b981 commit 19de221

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Documentation/config/advice.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ advice.*::
22
These variables control various optional help messages designed to
33
aid new users. When left unconfigured, Git will give the message
44
alongside instructions on how to squelch it. You can tell Git
5-
that you do not need the help message by setting these to `false`:
5+
that you have understood the issue and no longer need a specific
6+
help message by setting the corresponding variable to `false`.
7+
+
8+
As they are intended to help human users, these messages are output to
9+
the standard error. When tools that run Git as a subprocess find them
10+
disruptive, they can set `GIT_ADVICE=0` in the environment to squelch
11+
all advice messages.
612
+
713
--
814
addEmbeddedRepo::

Documentation/git.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,17 @@ standard output.
10271027
adequate and support for it is likely to be removed in the
10281028
foreseeable future (along with the variable).
10291029

1030+
`GIT_ADVICE`::
1031+
If set to `0`, then disable all advice messages. These messages are
1032+
intended to provide hints to human users that may help them get out of
1033+
problematic situations or take advantage of new features. Users can
1034+
disable individual messages using the `advice.*` config keys. These
1035+
messages may be disruptive to tools that execute Git processes, so this
1036+
variable is available to disable the messages. (The `--no-advice`
1037+
global option is also available, but old Git versions may fail when
1038+
this option is not understood. The environment variable will be ignored
1039+
by Git versions that do not understand it.)
1040+
10301041
Discussion[[Discussion]]
10311042
------------------------
10321043

0 commit comments

Comments
 (0)