diff: added '-q' option, short option for '--quiet'
PATCH 1/1 diff: added '-q' option, short option for '--quiet'
Signed-off-by Alexander Kuleshov <[email protected]>
--- Documentation/diff-options.txt | 1 + diff.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
Documentation/diff-options.txt +1 -0
@@ -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.c +1 -1
@@ -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 );
Signature · 1 line
2.3.0.rc0.256.gb0e92c0
Quoted 5 lines · Alexander Kuleshov
Signed-off-by Alexander Kuleshov <[email protected]>--- 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".
Quoted 26 lines
Documentation/diff-options.txt +1
-0@@ -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.c +1
-1@@ -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 );