git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH V3 1/2] git-apply: add --quiet flag

From
Jerry Zhang <jerry@skydio.com>
Date
Dec 13, 2021, 22:03 UTC
Message-ID
<20211213220327.16042-1-jerry@skydio.com>
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>
---
V2->V3 
- Reorganized into a patch series to capture
dependencies between 2 git apply changes.
 Documentation/git-apply.txt | 7 ++++++-
 apply.c                     | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt
index aa1ae56a25..a32ad64718 100644
--- a/Documentation/git-apply.txt
+++ b/Documentation/git-apply.txt
@@ -14,11 +14,11 @@ SYNOPSIS
 	  [--allow-binary-replacement | --binary] [--reject] [-z]
 	  [-p<n>] [-C<n>] [--inaccurate-eof] [--recount] [--cached]
 	  [--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
 -----------
 Reads the supplied diff output (i.e. "a patch") and applies it to files.
 When running from a subdirectory in a repository, patched paths
@@ -226,10 +226,15 @@ behavior:
 --verbose::
 	Report progress to stderr. By default, only a message about the
 	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
 	adjusting the hunk headers appropriately).
 
diff --git a/apply.c b/apply.c
index 64b226acd9..9f00f882a2 100644
--- a/apply.c
+++ b/apply.c
@@ -5071,11 +5071,11 @@ int apply_parse_options(int argc, const char **argv,
 			N_("don't expect at least one line of context")),
 		OPT_BOOL(0, "reject", &state->apply_with_reject,
 			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),
 		OPT_BIT(0, "recount", options,
 			N_("do not trust the line counts in the hunk headers"),
-- 
2.32.0.1314.g6ed4fcc4cc
Next: Jerry Zhang
Message 1 of 13 in “git-apply: add --quiet flag”
  1. 1/2 git-apply: add --quiet flagJerry Zhang, Dec 13, 2021
  2. 2/2 git-apply: add --allow-empty flagJerry Zhang, Dec 13, 2021
  3. Junio C HamanoDec 16, 2021
  4. t4204 is not sanitizer clean at allJunio C Hamano, Dec 16, 2021
  5. Ævar Arnfjörð BjarmasonDec 17, 2021
  6. Junio C HamanoDec 17, 2021
  7. Ævar Arnfjörð BjarmasonDec 17, 2021
  8. format-patch: mark rev_info with UNLEAKJunio C Hamano, Dec 16, 2021
  9. Ævar Arnfjörð BjarmasonDec 17, 2021
  10. Junio C HamanoDec 17, 2021
  11. Junio C HamanoDec 17, 2021
  12. Ævar Arnfjörð BjarmasonDec 17, 2021
  13. Junio C HamanoDec 13, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.