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

[PATCH 2/4] Replace "GIT_DIR" with GIT_DIR_ENVIRONMENT.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Dec 31, 2006, 04:29 UTC
Message-ID
<20061231042911.GB5823@spearce.org>
In-Reply-To
<3ffc8ddd9b500c2a34d2bd6ba147dc750d951bcd.1167539318.git.spearce@spearce.org>

We tend to use the nice constant GIT_DIR_ENVIRONMENT when we are referring to the "GIT_DIR" constant, but git.c didn't do so. Now it does.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 git.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/git.c b/git.c
index ec897dc..c82ca45 100644
--- a/git.c
+++ b/git.c
@@ -63,14 +63,14 @@ static int handle_options(const char*** argv, int* argc)
 				fprintf(stderr, "No directory given for --git-dir.\n" );
 				usage(git_usage_string);
 			}
-			setenv("GIT_DIR", (*argv)[1], 1);
+			setenv(GIT_DIR_ENVIRONMENT, (*argv)[1], 1);
 			(*argv)++;
 			(*argc)--;
 		} else if (!strncmp(cmd, "--git-dir=", 10)) {
-			setenv("GIT_DIR", cmd + 10, 1);
+			setenv(GIT_DIR_ENVIRONMENT, cmd + 10, 1);
 		} else if (!strcmp(cmd, "--bare")) {
 			static char git_dir[PATH_MAX+1];
-			setenv("GIT_DIR", getcwd(git_dir, sizeof(git_dir)), 1);
+			setenv(GIT_DIR_ENVIRONMENT, getcwd(git_dir, sizeof(git_dir)), 1);
 		} else {
 			fprintf(stderr, "Unknown option: %s\n", cmd);
 			usage(git_usage_string);
-- 
1.5.0.rc0.g6bb1
Next: Shawn O. Pearce
Message 1 of 17 in “Replace "GIT_DIR" with GIT_DIR_ENVIRONMENT.”
  1. 2/4 Replace "GIT_DIR" with GIT_DIR_ENVIRONMENT.Shawn O. Pearce, Dec 31, 2006
  2. 3/4 Automatically detect a bare git repository.Shawn O. Pearce, Dec 31, 2006
  3. Junio C HamanoDec 31, 2006
  4. Shawn PearceDec 31, 2006
  5. Junio C HamanoDec 31, 2006
  6. Theodore TsoDec 31, 2006
  7. Shawn O. PearceJan 1, 2007
  8. Martin WaitzDec 31, 2006
  9. Shawn O. PearceJan 1, 2007
  10. 4/4 Disallow working directory commands in a bare repository.Shawn O. Pearce, Dec 31, 2006
  11. Junio C HamanoDec 31, 2006
  12. Shawn O. PearceDec 31, 2006
  13. Junio C HamanoDec 31, 2006
  14. Theodore TsoDec 31, 2006
  15. Johannes SchindelinDec 31, 2006
  16. Junio C HamanoDec 31, 2006
  17. Johannes SchindelinJan 2, 2007

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.