]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-apply: add --quiet flag
authorJerry Zhang <jerry@skydio.com>
Mon, 13 Dec 2021 22:03:26 +0000 (14:03 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Dec 2021 22:30:22 +0000 (14:30 -0800)
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>
Documentation/git-apply.txt
apply.c

index aa1ae56a25e0428cabcfa2539900ef2a09abcb7c..a32ad647182e1ed4a393984aad0b3c4d50be42b0 100644 (file)
@@ -16,7 +16,7 @@ SYNOPSIS
          [--ignore-space-change | --ignore-whitespace]
          [--whitespace=(nowarn|warn|fix|error|error-all)]
          [--exclude=<path>] [--include=<path>] [--directory=<root>]
-         [--verbose] [--unsafe-paths] [<patch>...]
+         [--verbose | --quiet] [--unsafe-paths] [<patch>...]
 
 DESCRIPTION
 -----------
@@ -228,6 +228,11 @@ behavior:
        current patch being applied will be printed. This option will cause
        additional information to be reported.
 
+-q::
+--quiet::
+       Suppress stderr output. Messages about patch status and progress
+       will not be printed.
+
 --recount::
        Do not trust the line counts in the hunk headers, but infer them
        by inspecting the patch (e.g. after editing the patch without
diff --git a/apply.c b/apply.c
index 43a0aebf4eec85fa6b0a69f655c0224aa14f29e5..0392f420664cec4733373d1075fd972d393344a5 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -5071,7 +5071,7 @@ int apply_parse_options(int argc, const char **argv,
                        N_("leave the rejected hunks in corresponding *.rej files")),
                OPT_BOOL(0, "allow-overlap", &state->allow_overlap,
                        N_("allow overlapping hunks")),
-               OPT__VERBOSE(&state->apply_verbosity, N_("be verbose")),
+               OPT__VERBOSITY(&state->apply_verbosity),
                OPT_BIT(0, "inaccurate-eof", options,
                        N_("tolerate incorrectly detected missing new-line at the end of file"),
                        APPLY_OPT_INACCURATE_EOF),