Skip to content

Commit 4c3abd0

Browse files
benpeartgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9ac8125 commit 4c3abd0

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

Documentation/config.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,6 +2753,9 @@ rerere.enabled::
27532753
`$GIT_DIR`, e.g. if "rerere" was previously used in the
27542754
repository.
27552755

2756+
reset.quiet::
2757+
When set to true, 'git reset' will default to the '--quiet' option.
2758+
27562759
include::sendemail-config.txt[]
27572760

27582761
sequence.editor::

Documentation/git-reset.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ OPTIONS
9595

9696
-q::
9797
--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.
99102

100103

101104
EXAMPLES

builtin/reset.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
307307
};
308308

309309
git_config(git_reset_config, NULL);
310+
git_config_get_bool("reset.quiet", &quiet);
310311

311312
argc = parse_options(argc, argv, prefix, options, git_reset_usage,
312313
PARSE_OPT_KEEP_DASHDASH);

0 commit comments

Comments
 (0)