summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2010-08-23 15:16:00 -0400
committerJunio C Hamano <gitster@pobox.com>2010-08-24 09:53:46 -0700
commit2b64fc894dada0916558fd0bfd19c50631f978cb (patch)
treea3b09386105dc2f853b14a18a9112ddc7962a138 /cache.h
parent64fdc08dac6694d1e754580e7acb82dfa4988bb9 (diff)
downloadgit-2b64fc894dada0916558fd0bfd19c50631f978cb.tar.gz
pass "git -c foo=bar" params through environment
Git uses the "-c foo=bar" parameters to set a config variable for a single git invocation. We currently do this by making a list in the current process and consulting that list in git_config. This works fine for built-ins, but the config changes are silently ignored by subprocesses, including dashed externals and invocations to "git config" from shell scripts. This patch instead puts them in an environment variable which we consult when looking at config (both internally and via calls "git config"). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index c9fa3df7f5..63910b5d21 100644
--- a/cache.h
+++ b/cache.h
@@ -379,6 +379,7 @@ static inline enum object_type object_type(unsigned int mode)
#define GRAFT_ENVIRONMENT "GIT_GRAFT_FILE"
#define TEMPLATE_DIR_ENVIRONMENT "GIT_TEMPLATE_DIR"
#define CONFIG_ENVIRONMENT "GIT_CONFIG"
+#define CONFIG_DATA_ENVIRONMENT "GIT_CONFIG_PARAMETERS"
#define EXEC_PATH_ENVIRONMENT "GIT_EXEC_PATH"
#define CEILING_DIRECTORIES_ENVIRONMENT "GIT_CEILING_DIRECTORIES"
#define NO_REPLACE_OBJECTS_ENVIRONMENT "GIT_NO_REPLACE_OBJECTS"
@@ -970,7 +971,9 @@ extern int update_server_info(int);
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_parse_ulong(const char *, unsigned long *);