summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 64fdc08)
raw | patch | inline | side by side (parent: 64fdc08)
author | Sverre Rabbelier <srabbelier@gmail.com> | |
Wed, 4 Aug 2010 01:59:23 +0000 (20:59 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 4 Aug 2010 19:01:10 +0000 (12:01 -0700) |
This is a shorthand similar to --system but instead uses
the config file of the current repository.
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
the config file of the current repository.
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/config.c | patch | blob | history |
diff --git a/builtin/config.c b/builtin/config.c
index f3d1660d023f7893373436617a9f729ce1d60f4d..79fee767b88a2d826311afb7a3299d67dedd3b94 100644 (file)
--- a/builtin/config.c
+++ b/builtin/config.c
static char key_delim = ' ';
static char term = '\n';
-static int use_global_config, use_system_config;
+static int use_global_config, use_system_config, use_local_config;
static const char *given_config_file;
static int actions, types;
static const char *get_color_slot, *get_colorbool_slot;
OPT_GROUP("Config file location"),
OPT_BOOLEAN(0, "global", &use_global_config, "use global config file"),
OPT_BOOLEAN(0, "system", &use_system_config, "use system config file"),
+ OPT_BOOLEAN(0, "local", &use_local_config, "use repository config file"),
OPT_STRING('f', "file", &given_config_file, "FILE", "use given config file"),
OPT_GROUP("Action"),
OPT_BIT(0, "get", &actions, "get value: name [value-regex]", ACTION_GET),
builtin_config_usage,
PARSE_OPT_STOP_AT_NON_OPTION);
- if (use_global_config + use_system_config + !!given_config_file > 1) {
+ if (use_global_config + use_system_config + use_local_config + !!given_config_file > 1) {
error("only one config file at a time.");
usage_with_options(builtin_config_usage, builtin_config_options);
}
}
else if (use_system_config)
config_exclusive_filename = git_etc_gitconfig();
+ else if (use_local_config)
+ config_exclusive_filename = git_pathdup("config");
else if (given_config_file) {
if (!is_absolute_path(given_config_file) && prefix)
config_exclusive_filename = prefix_filename(prefix,