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>
maint
Jerry Zhang 2021-12-13 14:03:26 -08:00 committed by Junio C Hamano
parent e773545c7f
commit c21b8ae857
2 changed files with 7 additions and 2 deletions

View File

@ -16,7 +16,7 @@ SYNOPSIS
[--ignore-space-change | --ignore-whitespace] [--ignore-space-change | --ignore-whitespace]
[--whitespace=(nowarn|warn|fix|error|error-all)] [--whitespace=(nowarn|warn|fix|error|error-all)]
[--exclude=<path>] [--include=<path>] [--directory=<root>] [--exclude=<path>] [--include=<path>] [--directory=<root>]
[--verbose] [--unsafe-paths] [<patch>...] [--verbose | --quiet] [--unsafe-paths] [<patch>...]


DESCRIPTION DESCRIPTION
----------- -----------
@ -228,6 +228,11 @@ behavior:
current patch being applied will be printed. This option will cause current patch being applied will be printed. This option will cause
additional information to be reported. additional information to be reported.


-q::
--quiet::
Suppress stderr output. Messages about patch status and progress
will not be printed.

--recount:: --recount::
Do not trust the line counts in the hunk headers, but infer them Do not trust the line counts in the hunk headers, but infer them
by inspecting the patch (e.g. after editing the patch without by inspecting the patch (e.g. after editing the patch without

View File

@ -5071,7 +5071,7 @@ int apply_parse_options(int argc, const char **argv,
N_("leave the rejected hunks in corresponding *.rej files")), N_("leave the rejected hunks in corresponding *.rej files")),
OPT_BOOL(0, "allow-overlap", &state->allow_overlap, OPT_BOOL(0, "allow-overlap", &state->allow_overlap,
N_("allow overlapping hunks")), N_("allow overlapping hunks")),
OPT__VERBOSE(&state->apply_verbosity, N_("be verbose")), OPT__VERBOSITY(&state->apply_verbosity),
OPT_BIT(0, "inaccurate-eof", options, OPT_BIT(0, "inaccurate-eof", options,
N_("tolerate incorrectly detected missing new-line at the end of file"), N_("tolerate incorrectly detected missing new-line at the end of file"),
APPLY_OPT_INACCURATE_EOF), APPLY_OPT_INACCURATE_EOF),