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

Re: [PATCH] diff: added '-q' option, short option for '--quiet'

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 14, 2015, 18:52 UTC
Message-ID
<xmqqegqx9ou3.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1421256901-30560-1-git-send-email-kuleshovmail@gmail.com>
Alexander Kuleshov <kuleshovmail@gmail.com> writes:
Show 5 quoted lines
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> ---
>  Documentation/diff-options.txt | 1 +
>  diff.c                         | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)

I think we have deliberately refrained from doing this, as it will make "git diff" inconsistent with the underlying "git diff-fiels".

Show 26 quoted lines
>
> diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
> index 2b15050..9160c90 100644
> --- a/Documentation/diff-options.txt
> +++ b/Documentation/diff-options.txt
> @@ -491,6 +491,7 @@ ifndef::git-log[]
>  	That is, it exits with 1 if there were differences and
>  	0 means no differences.
>  
> +-q
>  --quiet::
>  	Disable all output of the program. Implies `--exit-code`.
>  endif::git-log[]
> diff --git a/diff.c b/diff.c
> index 6ad8970..d778df7 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -3798,7 +3798,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
>  	}
>  	else if (!strcmp(arg, "--exit-code"))
>  		DIFF_OPT_SET(options, EXIT_WITH_STATUS);
> -	else if (!strcmp(arg, "--quiet"))
> +	else if (!strcmp(arg, "--quiet") || !strcmp(arg, "-q"))
>  		DIFF_OPT_SET(options, QUICK);
>  	else if (!strcmp(arg, "--ext-diff"))
>  		DIFF_OPT_SET(options, ALLOW_EXTERNAL);
Previous: Alexander Kuleshov
Message 2 of 2 in “diff: added '-q' option, short option for '--quiet'”
  1. diff: added '-q' option, short option for '--quiet'Alexander Kuleshov, Jan 14, 2015
  2. Junio C HamanoJan 14, 2015

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.