This task emerged from b04ba2bb (parse-options: deprecate OPT_BOOLEAN,

This commit introduces a change for the users, after this patch
you can pass one of the config level flags multiple times:
        $ git config --global --global --list
        error: only one config file at a time.
        usage: ...

Afterwards this will work. This is due to the following check in the code:
        if (use_global_config + use_system_config + use_local_config +
            !!given_config_file + !!given_config_blob > 1) {
                error("only one config file at a time.");

With OPT_BOOL instead of OPT_BOOLEAN the variables use_global_config,
use_system_config, use_local_config will only have the value 0 if the
command line option was not passed or 1 no matter how often the
respective command line option was passed.

Signed-off-by: Stefan Beller <>
 builtin/config.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/config.c b/builtin/config.c
index da12fdb..4ab9e9a 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -50,9 +50,9 @@ static int respect_includes = -1;
 static struct option builtin_config_options[] = {
        OPT_GROUP(N_("Config file location")),
-       OPT_BOOLEAN(0, "global", &use_global_config, N_("use global config 
-       OPT_BOOLEAN(0, "system", &use_system_config, N_("use system config 
-       OPT_BOOLEAN(0, "local", &use_local_config, N_("use repository config 
+       OPT_BOOL(0, "global", &use_global_config, N_("use global config file")),
+       OPT_BOOL(0, "system", &use_system_config, N_("use system config file")),
+       OPT_BOOL(0, "local", &use_local_config, N_("use repository config 
        OPT_STRING('f', "file", &given_config_file, N_("file"), N_("use given 
config file")),
        OPT_STRING(0, "blob", &given_config_blob, N_("blob-id"), N_("read 
config from given blob object")),

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to