diff options
Diffstat (limited to 'pretty.c')
-rw-r--r-- | pretty.c | 40 |
1 files changed, 35 insertions, 5 deletions
@@ -474,7 +474,8 @@ void pp_user_info(struct pretty_print_context *pp, } strbuf_addstr(sb, "From: "); - if (needs_rfc2047_encoding(namebuf, namelen)) { + if (pp->encode_email_headers && + needs_rfc2047_encoding(namebuf, namelen)) { add_rfc2047(sb, namebuf, namelen, encoding, RFC2047_ADDRESS); max_length = 76; /* per rfc2047 */ @@ -1311,9 +1312,18 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */ case '?': switch (c->signature_check.result) { case 'G': + switch (c->signature_check.trust_level) { + case TRUST_UNDEFINED: + case TRUST_NEVER: + strbuf_addch(sb, 'U'); + break; + default: + strbuf_addch(sb, 'G'); + break; + } + break; case 'B': case 'E': - case 'U': case 'N': case 'X': case 'Y': @@ -1337,6 +1347,25 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */ if (c->signature_check.primary_key_fingerprint) strbuf_addstr(sb, c->signature_check.primary_key_fingerprint); break; + case 'T': + switch (c->signature_check.trust_level) { + case TRUST_UNDEFINED: + strbuf_addstr(sb, "undefined"); + break; + case TRUST_NEVER: + strbuf_addstr(sb, "never"); + break; + case TRUST_MARGINAL: + strbuf_addstr(sb, "marginal"); + break; + case TRUST_FULLY: + strbuf_addstr(sb, "fully"); + break; + case TRUST_ULTIMATE: + strbuf_addstr(sb, "ultimate"); + break; + } + break; default: return 0; } @@ -1581,9 +1610,9 @@ static size_t format_commit_item(struct strbuf *sb, /* in UTF-8 */ strbuf_setlen(sb, sb->len - 1); } else if (orig_len != sb->len) { if (magic == ADD_LF_BEFORE_NON_EMPTY) - strbuf_insert(sb, orig_len, "\n", 1); + strbuf_insertstr(sb, orig_len, "\n"); else if (magic == ADD_SP_BEFORE_NON_EMPTY) - strbuf_insert(sb, orig_len, " ", 1); + strbuf_insertstr(sb, orig_len, " "); } return consumed + 1; } @@ -1739,7 +1768,8 @@ void pp_title_line(struct pretty_print_context *pp, if (pp->print_email_subject) { if (pp->rev) fmt_output_email_subject(sb, pp->rev); - if (needs_rfc2047_encoding(title.buf, title.len)) + if (pp->encode_email_headers && + needs_rfc2047_encoding(title.buf, title.len)) add_rfc2047(sb, title.buf, title.len, encoding, RFC2047_SUBJECT); else |