summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2021-01-12 12:26:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-01-12 20:03:18 (GMT)
commitce81b1da230cf04e231ce337c2946c0671ffb303 (patch)
tree1da56ff0ae9cd73277adc220bad64122482fc69c /config.h
parentb0812b6ac0776b6e43e8483d5579ffd11d5c5f42 (diff)
downloadgit-ce81b1da230cf04e231ce337c2946c0671ffb303.zip
git-ce81b1da230cf04e231ce337c2946c0671ffb303.tar.gz
git-ce81b1da230cf04e231ce337c2946c0671ffb303.tar.bz2
config: add new way to pass config via `--config-env`
While it's already possible to pass runtime configuration via `git -c <key>=<value>`, it may be undesirable to use when the value contains sensitive information. E.g. if one wants to set `http.extraHeader` to contain an authentication token, doing so via `-c` would trivially leak those credentials via e.g. ps(1), which typically also shows command arguments. To enable this usecase without leaking credentials, this commit introduces a new switch `--config-env=<key>=<envvar>`. Instead of directly passing a value for the given key, it instead allows the user to specify the name of an environment variable. The value of that variable will then be used as value of the key. Co-authored-by: Jeff King <peff@peff.net> Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.h')
-rw-r--r--config.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/config.h b/config.h
index 91cdfbf..d05651c 100644
--- a/config.h
+++ b/config.h
@@ -138,6 +138,7 @@ int git_config_from_mem(config_fn_t fn,
int git_config_from_blob_oid(config_fn_t fn, const char *name,
const struct object_id *oid, void *data);
void git_config_push_parameter(const char *text);
+void git_config_push_env(const char *spec);
int git_config_from_parameters(config_fn_t fn, void *data);
void read_early_config(config_fn_t cb, void *data);
void read_very_early_config(config_fn_t cb, void *data);