git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/3] gitattributes: drop support for GIT_ATTR_NOGLOBAL

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Mar 15, 2011, 09:04 UTC
Message-ID
<20110315090415.GB1576@elie>
In-Reply-To
<20110315090225.GA1576@elie>

test-lib sets $HOME to protect against pollution from user settings, so setting GIT_ATTR_NOGLOBAL would be redundant. Simplify by eliminating support for that environment variable altogether.

GIT_ATTR_NOGLOBAL was introduced in v1.7.4-rc0~208^2 (Add global and system-wide gitattributes, 2010-09-01) as an undocumented feature for use by the test suite. It never ended up being used (neither within git.git nor in other projects).

This patch does not affect GIT_ATTR_NOSYSTEM, which should still be useful.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 attr.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/attr.c b/attr.c
index 6aff695..0e28ba8 100644
--- a/attr.c
+++ b/attr.c
@@ -478,11 +478,6 @@ int git_attr_system(void)
 	return !git_env_bool("GIT_ATTR_NOSYSTEM", 0);
 }
 
-int git_attr_global(void)
-{
-	return !git_env_bool("GIT_ATTR_NOGLOBAL", 0);
-}
-
 static int git_attr_config(const char *var, const char *value, void *dummy)
 {
 	if (!strcmp(var, "core.attributesfile"))
@@ -511,7 +506,7 @@ static void bootstrap_attr_stack(void)
 		}
 
 		git_config(git_attr_config, NULL);
-		if (git_attr_global() && attributes_file) {
+		if (attributes_file) {
 			elem = read_attr_from_file(attributes_file, 1);
 			if (elem) {
 				elem->origin = NULL;
-- 
1.7.4.1
Previous: Jonathan NiederNext: Jonathan Nieder
Message 6 of 15 in “tests: unsetting variables that influence the outcome”
  1. 0/3 tests: unsetting variables that influence the outcomeJonathan Nieder, Mar 15, 2011
  2. 1/3 tests: protect against GIT_ATTR_NOGLOBAL from environmentJonathan Nieder, Mar 15, 2011
  3. 2/3 tests: suppress global and system gitattributesJonathan Nieder, Mar 15, 2011
  4. Jeff KingMar 15, 2011
  5. 2/3 Re: tests: suppress global and system gitattributesJonathan Nieder, Mar 15, 2011
  6. 1/3 gitattributes: drop support for GIT_ATTR_NOGLOBALJonathan Nieder, Mar 15, 2011
  7. 2/3 config: drop support for GIT_CONFIG_NOGLOBALJonathan Nieder, Mar 15, 2011
  8. 3/3 tests: suppress system gitattributesJonathan Nieder, Mar 15, 2011
  9. 3/3 tests: scrub environment of GIT_* variablesJonathan Nieder, Mar 15, 2011
  10. Jeff KingMar 15, 2011
  11. 0/2 tests: stop hard-coding the list of GIT_* vars to scrubJonathan Nieder, Mar 15, 2011
  12. 1/2 tests: stop worrying about obsolete environment variablesJonathan Nieder, Mar 15, 2011
  13. 2/2 tests: scrub environment of GIT_* variablesJonathan Nieder, Mar 15, 2011
  14. Junio C HamanoMar 15, 2011
  15. Jeff KingMar 15, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.