Re: Minor documentation problems [RFC PATCH]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2 Nov 2006 14:54:24 +0100 (CET)
Johannes Schindelin <Johannes.Schindelin@xxxxxx> 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++;

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]