reset: add new reset.quiet config setting

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>

Ben Peart committed Oct 23, 2018 at 15:04 UTC 4c3abd0551d8ff1c280de2bc53d6a7657b053d33
3 files changed +8 -1
Documentation/config.txt
+3
@@ -2753,6 +2753,9 @@ rerere.enabled::
2753 `$GIT_DIR`, e.g. if "rerere" was previously used in the
2754 repository.
2755
2756 +reset.quiet::
2757 + When set to true, 'git reset' will default to the '--quiet' option.
2758 +
2759 include::sendemail-config.txt[]
2760
2761 sequence.editor::
Documentation/git-reset.txt
+4 -1
@@ -95,7 +95,10 @@ OPTIONS
95
96 -q::
97 --quiet::
98 - Be quiet, only report errors.
98 +--no-quiet::
99 + Be quiet, only report errors. The default behavior is set by the
100 + `reset.quiet` config option. `--quiet` and `--no-quiet` will
101 + override the default behavior.
102
103
104 EXAMPLES
builtin/reset.c
+1
@@ -307,6 +307,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
307 };
308
309 git_config(git_reset_config, NULL);
310 + git_config_get_bool("reset.quiet", &quiet);
311
312 argc = parse_options(argc, argv, prefix, options, git_reset_usage,
313 PARSE_OPT_KEEP_DASHDASH);