summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-03-15 00:10:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-03-15 07:06:06 (GMT)
commit6bf4f1b4c9d78b2061bd5f3bf77bb21112b755be (patch)
tree2a5e51ddb5bed1e3149624a6d860d182fde9ec5d /commit.h
parenta0b54e7b73415f92225ddf29fe655399bafd4938 (diff)
downloadgit-6bf4f1b4c9d78b2061bd5f3bf77bb21112b755be.zip
git-6bf4f1b4c9d78b2061bd5f3bf77bb21112b755be.tar.gz
git-6bf4f1b4c9d78b2061bd5f3bf77bb21112b755be.tar.bz2
format-patch: generate MIME header as needed even when there is format.header
Earlier, the callchain from pretty_print_commit() down to pp_title_line() had an unwarranted assumption that the presense of "after_subject" parameter, means the caller has already output MIME headers for attachments. The parameter's primary purpose is to give extra header lines the caller wants to place after pp_title_line() generates the "Subject: " line. This assumption does not hold when the user used the format.header configuration variable to pass extra headers, and caused a message with non-ASCII character to lack proper MIME headers (e.g. 8-bit CTE header). The earlier logic also failed to suppress duplicated MIME headers when "format-patch -s --attach" is asked for and the signer's name demanded 8-bit clean transport. This patch fixes the logic by introducing a separate need_8bit_cte parameter passed down the callchain. This can have one of these values: -1 : we've already done MIME crap and we do not want to add extra header to say this is 8bit in pp_title_line(); 0 : we haven't done MIME and we have not seen anything that is 8bit yet; 1 : we haven't done MIME and we have seen something that is 8bit; pp_title_line() must add MIME header. It adds two tests by Jeff King who independently diagnosed this issue. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
-rw-r--r--commit.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/commit.h b/commit.h
index 10e2b5d..000528a 100644
--- a/commit.h
+++ b/commit.h
@@ -70,7 +70,7 @@ extern void pretty_print_commit(enum cmit_fmt fmt, const struct commit*,
struct strbuf *,
int abbrev, const char *subject,
const char *after_subject, enum date_mode,
- int non_ascii_present);
+ int need_8bit_cte);
/** Removes the first commit from a list sorted by date, and adds all
* of its parents.