From: Junio C Hamano Date: Mon, 16 Jun 2014 17:07:12 +0000 (-0700) Subject: Merge branch 'as/pretty-truncate' X-Git-Tag: v2.1.0-rc0~125 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/09e13ad5b0f0689418a723289dca7b3c72d538c4?hp=-c Merge branch 'as/pretty-truncate' * as/pretty-truncate: pretty.c: format string with truncate respects logOutputEncoding t4205, t6006: add tests that fail with i18n.logOutputEncoding set t4205 (log-pretty-format): use `tformat` rather than `format` t4041, t4205, t6006, t7102: don't hardcode tested encoding value t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs --- 09e13ad5b0f0689418a723289dca7b3c72d538c4 diff --combined pretty.c index e1e2cad36d,c9cf67ea7c..4f512876ce --- a/pretty.c +++ b/pretty.c @@@ -393,8 -393,8 +393,8 @@@ static void add_rfc2047(struct strbuf * strbuf_addstr(sb, "?="); } -static const char *show_ident_date(const struct ident_split *ident, - enum date_mode mode) +const char *show_ident_date(const struct ident_split *ident, + enum date_mode mode) { unsigned long date = 0; long tz = 0; @@@ -1506,13 -1506,18 +1506,18 @@@ void format_commit_message(const struc context.commit = commit; context.pretty_ctx = pretty_ctx; context.wrap_start = sb->len; + /* + * convert a commit message to UTF-8 first + * as far as 'format_commit_item' assumes it in UTF-8 + */ context.message = logmsg_reencode(commit, &context.commit_encoding, - output_enc); + utf8); strbuf_expand(sb, format, format_commit_item, &context); rewrap_message_tail(sb, &context, 0, 0, 0); + /* then convert a commit message to an actual output encoding */ if (output_enc) { if (same_encoding(utf8, output_enc)) output_enc = NULL;