Re: BUG: "git checkout" displays Q-escaped commit titles
- From
Jeff King <peff@peff.net>
- Date
- May 2, 2008, 14:05 UTC
- Message-ID
- <20080502140536.GA3518@sigill.intra.peff.net>
- In-Reply-To
- <20080502133903.GA3079@mithlond.arda.local>
On Fri, May 02, 2008 at 04:39:03PM +0300, Teemu Likonen wrote:
> When commit message's first line (i.e. the title) contains non-Ascii > characters "git checkout <commit>" displays this title in Q-escaped form > which looks something like this: =?utf-8?q?=C3=84=C3=A4kk=C3=B6si=C3=A4?=
Definitely a bug. This patch fixes it, but I'm not sure it's the best solution. It seems like pp_title_line should perhaps just be checking for fmt == CMIT_FMT_EMAIL, but I'm not sure if that would break anything else, and I don't have time to investigate further right now.
-- >8 -- checkout: don't rfc2047-encode oneline on detached HEAD
When calling pretty_print_commit, there is an implicit assumption that passing in a non-NULL "subject" variable for oneline or email formats means that the output is part of a subject and therefore "subject" to rfc2047 encoding. This is not the desired effect when reporting the movement of detached HEAD. --- builtin-checkout.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-checkout.c b/builtin-checkout.c index 14b2fe7..10ec137 100644 --- a/builtin-checkout.c +++ b/builtin-checkout.c @@ -142,7 +142,7 @@ static void describe_detached_head(char *msg, struct commit *commit) struct strbuf sb; strbuf_init(&sb, 0); parse_commit(commit); - pretty_print_commit(CMIT_FMT_ONELINE, commit, &sb, 0, "", "", 0, 0); + pretty_print_commit(CMIT_FMT_ONELINE, commit, &sb, 0, NULL, NULL, 0, 0); fprintf(stderr, "%s %s... %s\n", msg, find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV), sb.buf); strbuf_release(&sb);
-- 1.5.5.1.221.ga481