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

Re: Minor documentation problems [RFC PATCH]

From
Sean <seanlkml@sympatico.ca>
Date
Nov 2, 2006, 14:30 UTC
Message-ID
<BAYC1-PASMTP042F05A3C71EDC671552FFAEFF0@CEZ.ICE>
In-Reply-To
<Pine.LNX.4.63.0611021448100.1670@wbgn013.biozentrum.uni-wuerzburg.de>

On Thu, 2 Nov 2006 14:54:24 +0100 (CET) Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

> Your patch would be loads shorter and easier to read if you'd just 
> override the GIT_CONFIG environment variable (like --git-dir sets 
> GIT_DIR).
> 
Indeed. Thanks...  How 'bout this:
diff --git a/builtin-repo-config.c b/builtin-repo-config.c
index f60cee1..dcdae81 100644
--- a/builtin-repo-config.c
+++ b/builtin-repo-config.c
@@ -139,7 +139,16 @@ int cmd_repo_config(int argc, const char
 			type = T_BOOL;
 		else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l"))
 			return git_config(show_all_config);
-		else
+		else if (!strcmp(argv[1], "--global")) {
+			char *home = getenv("HOME");
+			if (home) {
+				char *user_config = xstrdup(mkpath("%s/.gitconfig", home));
+				setenv("GIT_CONFIG", user_config, 1);
+				free(user_config);
+			} else {
+				return -1;
+			}
+		} else
 			break;
 		argc--;
 		argv++;
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 7 of 9 in “Minor documentation problems”
  1. Matthieu MoyNov 2, 2006
  2. Petr BaudisNov 2, 2006
  3. Matthieu MoyNov 2, 2006
  4. SeanNov 2, 2006
  5. Matthieu MoyNov 2, 2006
  6. Johannes SchindelinNov 2, 2006
  7. SeanNov 2, 2006
  8. Johannes SchindelinNov 2, 2006
  9. Add --global option to git-repo-config.Sean, Nov 2, 2006

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.