From 6d167fd7ccb84f07a0bd57d8e188a651e913b158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Wed, 1 Mar 2017 12:37:07 +0100 Subject: pretty: use fmt_output_email_subject() Add the email-style subject prefix (e.g. "Subject: [PATCH] ") directly when it's needed instead of letting log_write_email_headers() prepare it in a static buffer in advance. This simplifies storage ownership and code flow. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- commit.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'commit.h') diff --git a/commit.h b/commit.h index afd14f318c..e818aff07e 100644 --- a/commit.h +++ b/commit.h @@ -142,21 +142,24 @@ static inline int cmit_fmt_is_mail(enum cmit_fmt fmt) return (fmt == CMIT_FMT_EMAIL || fmt == CMIT_FMT_MBOXRD); } +struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */ + struct pretty_print_context { /* * Callers should tweak these to change the behavior of pp_* functions. */ enum cmit_fmt fmt; int abbrev; - const char *subject; const char *after_subject; int preserve_subject; struct date_mode date_mode; unsigned date_mode_explicit:1; + int print_email_subject; int expand_tabs_in_log; int need_8bit_cte; char *notes_message; struct reflog_walk_info *reflog_info; + struct rev_info *rev; const char *output_encoding; struct string_list *mailmap; int color; @@ -175,7 +178,6 @@ struct userformat_want { }; extern int has_non_ascii(const char *text); -struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */ extern const char *logmsg_reencode(const struct commit *commit, char **commit_encoding, const char *output_encoding); -- cgit v1.2.3