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

[PATCH v1 6/7] diff: add --silent as alias of -s

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 12, 2023, 08:03 UTC
Message-ID
<20230512080339.2186324-7-felipe.contreras@gmail.com>
In-Reply-To
<20230512080339.2186324-1-felipe.contreras@gmail.com>

Ever since 2e5e98a40 ([PATCH] Silent flag for show-diff, 2005-04-13) -s meant silent.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 Documentation/diff-options.txt | 1 +
 diff.c                         | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index ba04b8292a..a402b6f9b6 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -34,6 +34,7 @@ ifdef::git-diff[]
 endif::git-diff[]
 
 -s::
+--silent::
 	Suppress diff output. Useful for commands like `git show` that
 	show output by default.
 endif::git-format-patch[]
diff --git a/diff.c b/diff.c
index 45c860496f..d171f155b1 100644
--- a/diff.c
+++ b/diff.c
@@ -5493,7 +5493,7 @@ struct option *add_diff_options(const struct option *opts,
 		OPT_BITOP('p', "patch", &options->output_format,
 			  N_("generate patch"),
 			  DIFF_FORMAT_PATCH, DIFF_FORMAT_DEFAULT | DIFF_FORMAT_NO_OUTPUT),
-		OPT_SET_INT_F('s', NULL, &options->output_format,
+		OPT_SET_INT_F('s', "silent", &options->output_format,
 			  N_("suppress diff output"),
 			  DIFF_FORMAT_NO_OUTPUT, PARSE_OPT_NONEG),
 		OPT_BITOP(0, "no-patch", &options->output_format,
-- 
2.40.0+fc1
Previous: Felipe ContrerasNext: Felipe Contreras
Message 7 of 10 in “diff: fix -s and --no-patch”
  1. 0/7 diff: fix -s and --no-patchFelipe Contreras, May 12, 2023
  2. 1/7 line-log: set patch format explicitly by defaultFelipe Contreras, May 12, 2023
  3. 2/7 diff: introduce DIFF_FORMAT_DEFAULTFelipe Contreras, May 12, 2023
  4. 3/7 diff: make DIFF_FORMAT_NO_OUTPUT 0Felipe Contreras, May 12, 2023
  5. 4/7 test: add various tests for diff formats with -sFelipe Contreras, May 12, 2023
  6. 5/7 diff: split --no-patch from -sFelipe Contreras, May 12, 2023
  7. 6/7 diff: add --silent as alias of -sFelipe Contreras, May 12, 2023
  8. 7/7 diff: remove DIFF_FORMAT_NO_OUTPUTFelipe Contreras, May 12, 2023
  9. Felipe ContrerasMay 12, 2023
  10. Sergey OrganovMay 12, 2023

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.