summaryrefslogtreecommitdiffstats
path: root/environment.h
diff options
context:
space:
mode:
authorJames Liu <james@jamesliu.io>2024-05-03 09:17:06 +0200
committerJunio C Hamano <gitster@pobox.com>2024-05-03 19:36:59 +0200
commitb79deeb55444f9e01a3f6335d7e0507e23e90190 (patch)
tree44ece5c77a73a7c18a5c5c4939f481b172e44901 /environment.h
parentdoc: add spacing around paginate options (diff)
downloadgit-b79deeb55444f9e01a3f6335d7e0507e23e90190.tar.xz
git-b79deeb55444f9e01a3f6335d7e0507e23e90190.zip
advice: add --no-advice global option
Advice hints must be disabled individually by setting the relevant advice.* variables to false in the Git configuration. For server-side and scripted usages of Git where hints can be a hindrance, it can be cumbersome to maintain configuration to ensure all advice hints are disabled in perpetuity. This is a particular concern in tests, where new or changed hints can result in failed assertions. Add a --no-advice global option to disable all advice hints from being displayed. This is independent of the toggles for individual advice hints. Use an internal environment variable (GIT_ADVICE) to ensure this configuration is propagated to the usage site, even if it executes in a subprocess. Signed-off-by: James Liu <james@jamesliu.io> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'environment.h')
-rw-r--r--environment.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/environment.h b/environment.h
index 05fd94d7be..0b2d457f07 100644
--- a/environment.h
+++ b/environment.h
@@ -58,6 +58,13 @@ const char *getenv_safe(struct strvec *argv, const char *name);
#define GIT_ATTR_SOURCE_ENVIRONMENT "GIT_ATTR_SOURCE"
/*
+ * Environment variable used to propagate the --no-advice global option to the
+ * advice_enabled() helper, even when run in a subprocess.
+ * This is an internal variable that should not be set by the user.
+ */
+#define GIT_ADVICE_ENVIRONMENT "GIT_ADVICE"
+
+/*
* Environment variable used in handshaking the wire protocol.
* Contains a colon ':' separated list of keys with optional values
* 'key[=value]'. Presence of unknown keys and values must be