diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-09-10 15:42:48 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-10 15:42:48 -0700 |
commit | 1c0712dea8fd927faa49fe494f507d18f0d41264 (patch) | |
tree | 364ec91c8754a32dfd3b93232281b44f3d111186 | |
parent | Merge branch 'ph/credential-gnome-keyring' (diff) | |
parent | log: fix --quiet synonym for -s (diff) | |
download | tgif-1c0712dea8fd927faa49fe494f507d18f0d41264.tar.xz |
Merge branch 'jk/maint-quiet-is-synonym-to-s-in-log'
We tried to bend backwards to allow "--quiet" to be a synonym as
"-s" when given as e.g. "git show --quiet", but did not quite
succeed.
* jk/maint-quiet-is-synonym-to-s-in-log:
log: fix --quiet synonym for -s
-rw-r--r-- | builtin/log.c | 2 | ||||
-rwxr-xr-x | t/t7007-show.sh | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c index d76f359440..e4e15dd55a 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -109,9 +109,9 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix, PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN | PARSE_OPT_KEEP_DASHDASH); - argc = setup_revisions(argc, argv, rev, opt); if (quiet) rev->diffopt.output_format |= DIFF_FORMAT_NO_OUTPUT; + argc = setup_revisions(argc, argv, rev, opt); /* Any arguments at this point are not recognized */ if (argc > 1) diff --git a/t/t7007-show.sh b/t/t7007-show.sh index a40cd3630c..e41fa00b80 100755 --- a/t/t7007-show.sh +++ b/t/t7007-show.sh @@ -108,4 +108,16 @@ test_expect_success 'showing range' ' test_cmp expect actual.filtered ' +test_expect_success '-s suppresses diff' ' + echo main3 >expect && + git show -s --format=%s main3 >actual && + test_cmp expect actual +' + +test_expect_success '--quiet suppresses diff' ' + echo main3 >expect && + git show --quiet --format=%s main3 >actual && + test_cmp expect actual +' + test_done |