Skip to content

Commit 19ece72

Browse files
committed
Merge branch 'jk/maint-quiet-is-synonym-to-s-in-log' into maint-1.7.11
* jk/maint-quiet-is-synonym-to-s-in-log: log: fix --quiet synonym for -s
2 parents ddbca33 + f9c75d8 commit 19ece72

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

builtin/log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
108108
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN |
109109
PARSE_OPT_KEEP_DASHDASH);
110110

111-
argc = setup_revisions(argc, argv, rev, opt);
112111
if (quiet)
113112
rev->diffopt.output_format |= DIFF_FORMAT_NO_OUTPUT;
113+
argc = setup_revisions(argc, argv, rev, opt);
114114

115115
/* Any arguments at this point are not recognized */
116116
if (argc > 1)

t/t7007-show.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,16 @@ test_expect_success 'showing range' '
108108
test_cmp expect actual.filtered
109109
'
110110

111+
test_expect_success '-s suppresses diff' '
112+
echo main3 >expect &&
113+
git show -s --format=%s main3 >actual &&
114+
test_cmp expect actual
115+
'
116+
117+
test_expect_success '--quiet suppresses diff' '
118+
echo main3 >expect &&
119+
git show --quiet --format=%s main3 >actual &&
120+
test_cmp expect actual
121+
'
122+
111123
test_done

0 commit comments

Comments
 (0)