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

[PATCH 2/4] Split up default "user" config parsing into helper routine

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jun 18, 2008, 22:31 UTC
Message-ID
<alpine.LFD.1.10.0806181530420.2907@woody.linux-foundation.org>
In-Reply-To
<alpine.LFD.1.10.0806181529570.2907@woody.linux-foundation.org>
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Wed, 18 Jun 2008 14:40:35 -0700
Subject: [PATCH 2/4] Split up default "user" config parsing into helper routine

This follows the example of the "core" config, and splits out the default "user" config option parsing into a helper routine.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 config.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/config.c b/config.c
index c3597e0..ee7642b 100644
--- a/config.c
+++ b/config.c
@@ -464,11 +464,8 @@ static int git_default_core_config(const char *var, const char *value)
 	return 0;
 }
 
-int git_default_config(const char *var, const char *value, void *dummy)
+static int git_default_user_config(const char *var, const char *value)
 {
-	if (!prefixcmp(var, "core."))
-		return git_default_core_config(var, value);
-
 	if (!strcmp(var, "user.name")) {
 		if (!value)
 			return config_error_nonbool(var);
@@ -487,6 +484,18 @@ int git_default_config(const char *var, const char *value, void *dummy)
 		return 0;
 	}
 
+	/* Add other config variables here and to Documentation/config.txt. */
+	return 0;
+}
+
+int git_default_config(const char *var, const char *value, void *dummy)
+{
+	if (!prefixcmp(var, "core."))
+		return git_default_core_config(var, value);
+
+	if (!prefixcmp(var, "user."))
+		return git_default_user_config(var, value);
+
 	if (!strcmp(var, "i18n.commitencoding"))
 		return git_config_string(&git_commit_encoding, var, value);
 
-- 
1.5.6.rc3.7.g336d0.dirty
Previous: Linus TorvaldsNext: Linus Torvalds
Message 3 of 16 in “Add 'core.fsyncobjectfiles' config option”
  1. 0/4 Add 'core.fsyncobjectfiles' config optionLinus Torvalds, Jun 18, 2008
  2. 1/4 Split up default "core" config parsing into helper routineLinus Torvalds, Jun 18, 2008
  3. 2/4 Split up default "user" config parsing into helper routineLinus Torvalds, Jun 18, 2008
  4. 3/4 Split up default "i18n" and "branch" config parsing into helper routinesLinus Torvalds, Jun 18, 2008
  5. 4/4 Add config option to enable 'fsync()' of object filesLinus Torvalds, Jun 18, 2008
  6. Jeff KingJun 18, 2008
  7. Linus TorvaldsJun 18, 2008
  8. Jeff KingJun 18, 2008
  9. Linus TorvaldsJun 18, 2008
  10. Jeff KingJun 19, 2008
  11. Linus TorvaldsJun 19, 2008
  12. Linus TorvaldsJun 19, 2008
  13. Daniel BarkalowJun 19, 2008
  14. Junio C HamanoJun 19, 2008
  15. Jeff KingJun 19, 2008
  16. Eric RaibleJun 19, 2008

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.