Skip to content

Commit

Permalink
Merge branch 'jk/maint-quiet-is-synonym-to-s-in-log' into maint-1.7.11
Browse files Browse the repository at this point in the history
* jk/maint-quiet-is-synonym-to-s-in-log:
  log: fix --quiet synonym for -s
  • Loading branch information
Junio C Hamano committed Sep 15, 2012
2 parents ddbca33 + f9c75d8 commit 19ece72
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,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)
Expand Down
12 changes: 12 additions & 0 deletions t/t7007-show.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 19ece72

Please sign in to comment.