diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-03-10 13:24:24 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-10 13:24:24 -0800 |
commit | 0a246106802b147ad81626f52c0aaa37398ba918 (patch) | |
tree | b15fe8d0ddbbd14775c6fb430a96a80b2404f213 /builtin | |
parent | Merge branch 'tg/stash-push' (diff) | |
parent | pretty: use fmt_output_email_subject() (diff) | |
download | tgif-0a246106802b147ad81626f52c0aaa37398ba918.tar.xz |
Merge branch 'rs/log-email-subject'
Code clean-up.
* rs/log-email-subject:
pretty: use fmt_output_email_subject()
log-tree: factor out fmt_output_email_subject()
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/log.c | 5 | ||||
-rw-r--r-- | builtin/shortlog.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/builtin/log.c b/builtin/log.c index 55d20cc2d8..281af8c1ec 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -989,8 +989,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout, open_next_file(NULL, rev->numbered_files ? NULL : "cover-letter", rev, quiet)) return; - log_write_email_headers(rev, head, &pp.subject, &pp.after_subject, - &need_8bit_cte); + log_write_email_headers(rev, head, &pp.after_subject, &need_8bit_cte); for (i = 0; !need_8bit_cte && i < nr; i++) { const char *buf = get_commit_buffer(list[i], NULL); @@ -1005,6 +1004,8 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout, msg = body; pp.fmt = CMIT_FMT_EMAIL; pp.date_mode.type = DATE_RFC2822; + pp.rev = rev; + pp.print_email_subject = 1; pp_user_info(&pp, NULL, &sb, committer, encoding); pp_title_line(&pp, &msg, &sb, encoding, need_8bit_cte); pp_remainder(&pp, &msg, &sb, 0); diff --git a/builtin/shortlog.c b/builtin/shortlog.c index c9585d475d..f78bb4818d 100644 --- a/builtin/shortlog.c +++ b/builtin/shortlog.c @@ -148,7 +148,7 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit) ctx.fmt = CMIT_FMT_USERFORMAT; ctx.abbrev = log->abbrev; - ctx.subject = ""; + ctx.print_email_subject = 1; ctx.after_subject = ""; ctx.date_mode.type = DATE_NORMAL; ctx.output_encoding = get_log_output_encoding(); |