diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-03-15 00:09:20 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-03-15 00:09:33 -0700 |
commit | 267123b4299ea2c2f090ef169f9fc5039897cd72 (patch) | |
tree | ecbbe5be7cfd059b001af3195d71a0b9cece8c30 /log-tree.c | |
parent | 2a2ad0c0007b9f79768b4564644ac9eaaa7310b6 (diff) | |
parent | 6bf4f1b4c9d78b2061bd5f3bf77bb21112b755be (diff) | |
download | git-267123b4299ea2c2f090ef169f9fc5039897cd72.tar.gz |
Merge branch 'maint'
* maint:
format-patch: generate MIME header as needed even when there is format.header
Diffstat (limited to 'log-tree.c')
-rw-r--r-- | log-tree.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/log-tree.c b/log-tree.c index 608f697cf3..5b2963998c 100644 --- a/log-tree.c +++ b/log-tree.c @@ -138,10 +138,14 @@ static int has_non_ascii(const char *s) } void log_write_email_headers(struct rev_info *opt, const char *name, - const char **subject_p, const char **extra_headers_p) + const char **subject_p, + const char **extra_headers_p, + int *need_8bit_cte_p) { const char *subject = NULL; const char *extra_headers = opt->extra_headers; + + *need_8bit_cte_p = 0; /* unknown */ if (opt->total > 0) { static char buffer[64]; snprintf(buffer, sizeof(buffer), @@ -169,6 +173,7 @@ void log_write_email_headers(struct rev_info *opt, const char *name, if (opt->mime_boundary) { static char subject_buffer[1024]; static char buffer[1024]; + *need_8bit_cte_p = -1; /* NEVER */ snprintf(subject_buffer, sizeof(subject_buffer) - 1, "%s" "MIME-Version: 1.0\n" @@ -212,6 +217,7 @@ void show_log(struct rev_info *opt, const char *sep) int abbrev_commit = opt->abbrev_commit ? opt->abbrev : 40; const char *extra; const char *subject = NULL, *extra_headers = opt->extra_headers; + int need_8bit_cte = 0; opt->loginfo = NULL; if (!opt->verbose_header) { @@ -255,7 +261,8 @@ void show_log(struct rev_info *opt, const char *sep) if (opt->commit_format == CMIT_FMT_EMAIL) { log_write_email_headers(opt, sha1_to_hex(commit->object.sha1), - &subject, &extra_headers); + &subject, &extra_headers, + &need_8bit_cte); } else if (opt->commit_format != CMIT_FMT_USERFORMAT) { fputs(diff_get_color_opt(&opt->diffopt, DIFF_COMMIT), stdout); if (opt->commit_format != CMIT_FMT_ONELINE) @@ -299,9 +306,11 @@ void show_log(struct rev_info *opt, const char *sep) * And then the pretty-printed message itself */ strbuf_init(&msgbuf, 0); + if (need_8bit_cte >= 0) + need_8bit_cte = has_non_ascii(opt->add_signoff); pretty_print_commit(opt->commit_format, commit, &msgbuf, abbrev, subject, extra_headers, opt->date_mode, - has_non_ascii(opt->add_signoff)); + need_8bit_cte); if (opt->add_signoff) append_signoff(&msgbuf, opt->add_signoff); |