]> git.ipfire.org Git - thirdparty/git.git/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 552827935ae16d809a26e937d53ef07710526264..fef680f88674b8e47900ad888ecdacd515ff4374 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 1d697d996220b23d5ac660e809563296ecd1c574..2dac95c71a510b2cead5f39fd0dc5f03816ae5c4 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 c2f8e72cb32d70b27b6b7e62de8ea87e1d07a5f5..ff5f1756d511e7f800725992feb84e4620280227 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);