git-apply: add --quiet flag

Replace OPT_VERBOSE with OPT_VERBOSITY. This adds a --quiet flag to "git apply" so the user can turn down the verbosity. Signed-off-by: Jerry Zhang <jerry@skydio.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jerry Zhang committed Dec 13, 2021 at 14:03 UTC c21b8ae857d0d58b67ca77384ccc1880d834c2d5
2 files changed +7 -2
Documentation/git-apply.txt
+6 -1
@@ -16,7 +16,7 @@ SYNOPSIS
16 [--ignore-space-change | --ignore-whitespace]
17 [--whitespace=(nowarn|warn|fix|error|error-all)]
18 [--exclude=<path>] [--include=<path>] [--directory=<root>]
19 - [--verbose] [--unsafe-paths] [<patch>...]
19 + [--verbose | --quiet] [--unsafe-paths] [<patch>...]
20
21 DESCRIPTION
22 -----------
@@ -228,6 +228,11 @@ behavior:
228 current patch being applied will be printed. This option will cause
229 additional information to be reported.
230
231 +-q::
232 +--quiet::
233 + Suppress stderr output. Messages about patch status and progress
234 + will not be printed.
235 +
236 --recount::
237 Do not trust the line counts in the hunk headers, but infer them
238 by inspecting the patch (e.g. after editing the patch without
apply.c
+1 -1
@@ -5071,7 +5071,7 @@ int apply_parse_options(int argc, const char **argv,
5071 N_("leave the rejected hunks in corresponding *.rej files")),
5072 OPT_BOOL(0, "allow-overlap", &state->allow_overlap,
5073 N_("allow overlapping hunks")),
5074 - OPT__VERBOSE(&state->apply_verbosity, N_("be verbose")),
5074 + OPT__VERBOSITY(&state->apply_verbosity),
5075 OPT_BIT(0, "inaccurate-eof", options,
5076 N_("tolerate incorrectly detected missing new-line at the end of file"),
5077 APPLY_OPT_INACCURATE_EOF),