]> Kevux Git Server - rit/commitdiff
reset: add new reset.quiet config setting
authorBen Peart <benpeart@microsoft.com>
Tue, 23 Oct 2018 19:04:22 +0000 (15:04 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 Oct 2018 02:57:07 +0000 (11:57 +0900)
Add a reset.quiet config setting that sets the default value of the --quiet
flag when running the reset command.  This enables users to change the
default behavior to take advantage of the performance advantages of
avoiding the scan for unstaged changes after reset.  Defaults to false.

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt
Documentation/git-reset.txt
builtin/reset.c

index 5528279..fef680f 100644 (file)
@@ -2753,6 +2753,9 @@ rerere.enabled::
        `$GIT_DIR`, e.g. if "rerere" was previously used in the
        repository.
 
+reset.quiet::
+       When set to true, 'git reset' will default to the '--quiet' option.
+
 include::sendemail-config.txt[]
 
 sequence.editor::
index 1d697d9..2dac95c 100644 (file)
@@ -95,7 +95,10 @@ OPTIONS
 
 -q::
 --quiet::
-       Be quiet, only report errors.
+--no-quiet::
+       Be quiet, only report errors. The default behavior is set by the
+       `reset.quiet` config option. `--quiet` and `--no-quiet` will
+       override the default behavior.
 
 
 EXAMPLES
index c2f8e72..ff5f175 100644 (file)
@@ -307,6 +307,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
        };
 
        git_config(git_reset_config, NULL);
+       git_config_get_bool("reset.quiet", &quiet);
 
        argc = parse_options(argc, argv, prefix, options, git_reset_usage,
                                                PARSE_OPT_KEEP_DASHDASH);