diff mbox series

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

Message ID 20230512080339.2186324-7-felipe.contreras@gmail.com (mailing list archive)
State New, archived
Headers show
Series diff: fix -s and --no-patch | expand

Commit Message

Felipe Contreras May 12, 2023, 8:03 a.m. UTC
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 mbox series

Patch

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,