]> git.ipfire.org Git - thirdparty/git.git/commitdiff
advice: recommend GIT_ADVICE=0 for tools
authorDerrick Stolee <stolee@gmail.com>
Fri, 6 Sep 2024 20:22:35 +0000 (20:22 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Sep 2024 21:15:16 +0000 (14:15 -0700)
The GIT_ADVICE environment variable was added implicitly in b79deeb5544
(advice: add --no-advice global option, 2024-05-03) but was not
documented. Add documentation to show that it is an option for tools
that want to disable these messages. Make note that while the
--no-advice option exists, older Git versions will fail to parse that
option. The environment variable presents a way to change the behavior
of Git versions that understand it without disrupting older versions.

Co-authored-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/advice.txt
Documentation/git.txt

index 0ba89898207f0c2dee2ae569e6e359e3b053bd2f..257db58918179a931ba42f223de30025cb7b9dca 100644 (file)
@@ -2,7 +2,13 @@ advice.*::
        These variables control various optional help messages designed to
        aid new users.  When left unconfigured, Git will give the message
        alongside instructions on how to squelch it.  You can tell Git
-       that you do not need the help message by setting these to `false`:
+       that you have understood the issue and no longer need a specific
+       help message by setting the corresponding variable to `false`.
++
+As they are intended to help human users, these messages are output to
+the standard error. When tools that run Git as a subprocess find them
+disruptive, they can set `GIT_ADVICE=0` in the environment to squelch
+all advice messages.
 +
 --
        addEmbeddedRepo::
index 4489e2297a396b13108ed75a71e665236fb019cb..d15a8697625d6b6c598a2bc774bf243675ab68ea 100644 (file)
@@ -1027,6 +1027,17 @@ standard output.
        adequate and support for it is likely to be removed in the
        foreseeable future (along with the variable).
 
+`GIT_ADVICE`::
+       If set to `0`, then disable all advice messages. These messages are
+       intended to provide hints to human users that may help them get out of
+       problematic situations or take advantage of new features. Users can
+       disable individual messages using the `advice.*` config keys. These
+       messages may be disruptive to tools that execute Git processes, so this
+       variable is available to disable the messages. (The `--no-advice`
+       global option is also available, but old Git versions may fail when
+       this option is not understood. The environment variable will be ignored
+       by Git versions that do not understand it.)
+
 Discussion[[Discussion]]
 ------------------------