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

[PATCH 1/4] config: make environment parsing routines static

From
Jeff King <peff@peff.net>
Date
May 24, 2011, 22:49 UTC
Message-ID
<20110524224936.GA24527@sigill.intra.peff.net>
In-Reply-To
<20110524224903.GA16265@sigill.intra.peff.net>

Nobody outside of git_config_from_parameters should need to use the GIT_CONFIG_PARAMETERS parsing functions, so let's make them private.

Signed-off-by: Jeff King <peff@peff.net>
---
 cache.h  |    2 --
 config.c |    4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/cache.h b/cache.h
index 28a921d..69e09a1 100644
--- a/cache.h
+++ b/cache.h
@@ -1037,8 +1037,6 @@ typedef int (*config_fn_t)(const char *, const char *, void *);
 extern int git_default_config(const char *, const char *, void *);
 extern int git_config_from_file(config_fn_t fn, const char *, void *);
 extern void git_config_push_parameter(const char *text);
-extern int git_config_parse_parameter(const char *text);
-extern int git_config_parse_environment(void);
 extern int git_config_from_parameters(config_fn_t fn, void *data);
 extern int git_config(config_fn_t fn, void *);
 extern int git_config_early(config_fn_t fn, void *, const char *repo_config);
diff --git a/config.c b/config.c
index 9d36848..46aeb9c 100644
--- a/config.c
+++ b/config.c
@@ -47,7 +47,7 @@ void git_config_push_parameter(const char *text)
 	strbuf_release(&env);
 }
 
-int git_config_parse_parameter(const char *text)
+static int git_config_parse_parameter(const char *text)
 {
 	struct config_item *ct;
 	struct strbuf tmp = STRBUF_INIT;
@@ -74,7 +74,7 @@ int git_config_parse_parameter(const char *text)
 	return 0;
 }
 
-int git_config_parse_environment(void) {
+static int git_config_parse_environment(void) {
 	const char *env = getenv(CONFIG_DATA_ENVIRONMENT);
 	char *envw;
 	const char **argv = NULL;
-- 
1.7.4.5.7.g2e01
Previous: Jeff KingNext: Jeff King
Message 7 of 10 in “handle_options(): do not miscount how many arguments were used”
  1. handle_options(): do not miscount how many arguments were usedJunio C Hamano, May 24, 2011
  2. Allow built-ins to also use -c var=val via aliasJunio C Hamano, May 24, 2011
  3. Jeff KingMay 24, 2011
  4. Jeff KingMay 24, 2011
  5. Jeff KingMay 24, 2011
  6. Jeff KingMay 24, 2011
  7. 1/4 config: make environment parsing routines staticJeff King, May 24, 2011
  8. 2/4 git_config: don't peek at global config_parametersJeff King, May 24, 2011
  9. 3/4 config: always parse GIT_CONFIG_PARAMETERS during git_configJeff King, May 24, 2011
  10. 4/4 handle_options(): do not miscount how many arguments were usedJeff King, May 24, 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.