Skip to content

Commit c7f6a53

Browse files
peffgitster
authored andcommitted
shortlog: stop setting pp.print_email_subject
When shortlog processes a commit using its internal traversal, it may pretty-print the subject line for the summary view. When we do so, we set the "print_email_subject" flag in the pretty-print context. But this flag does nothing! Since we are using CMIT_FMT_USERFORMAT, we skip most of the usual formatting code entirely. This flag is there due to commit 6d167fd (pretty: use fmt_output_email_subject(), 2017-03-01). But that just switched us away from setting an empty "subject" header field, which was similarly useless. That was added by dd2e794 (Refactor pretty_print_commit arguments into a struct, 2009-10-19). Before using the struct, we had to pass _something_ as the argument, so we passed the empty string (a NULL would have worked equally well). So this setting has never done anything, and we can drop the line. That shortens the code, but more importantly, makes it easier to reason about and refactor the other users of this flag. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3c2a3fd commit c7f6a53

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

builtin/shortlog.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)
245245

246246
ctx.fmt = CMIT_FMT_USERFORMAT;
247247
ctx.abbrev = log->abbrev;
248-
ctx.print_email_subject = 1;
249248
ctx.date_mode = log->date_mode;
250249
ctx.output_encoding = get_log_output_encoding();
251250

0 commit comments

Comments
 (0)