From: "David Kågedal" <davidk@lysator•liu.se>
To: git@vger•kernel.org
Subject: Re: [PATCH] Reencode committer info to utf-8 before formatting mail header
Date: Mon, 15 Jan 2007 17:54:22 +0100 [thread overview]
Message-ID: <87fyac44e9.fsf@morpheus.local> (raw)
In-Reply-To: 7vmz4nog5b.fsf@assigned-by-dhcp.cox.net
Junio C Hamano <junkio@cox•net> writes:
> Side note. The previous patch does not help if your commit were
> made in non UTF-8 with not too recent git; the code assumes that
> commit messages without the new "encoding" headers are in UTF-8.
This was exactly the problem I was trying to solve.
> We might want to help transitioning people by doing something
> like this on top of the previous patch. Then when dealing with
> an ancient commit (sorry, I am not saying commits older than 3
> weeks are ancient -- but it will be 6 months from now ;-), you
> can override that default by setting an environment variable.
>
> ---
> diff --git a/commit.c b/commit.c
> index 9b2b842..a1b5705 100644
> --- a/commit.c
> +++ b/commit.c
> @@ -692,8 +692,12 @@ static char *logmsg_reencode(const struct commit *commit,
> if (!*output_encoding)
> return NULL;
> encoding = get_header(commit, "encoding");
> - if (!encoding)
> - encoding = utf8;
> + if (!encoding) {
> + if (getenv("GIT_OLD_COMMIT_ENCODING"))
> + encoding = strdup(getenv("GIT_OLD_COMMIT_ENCODING"));
> + else
> + encoding = utf8;
> + }
> if (!strcmp(encoding, output_encoding))
> out = strdup(commit->buffer);
> else
>
>
>
--
David Kågedal
next prev parent reply other threads:[~2007-01-15 22:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-12 13:06 [PATCH] Reencode committer info to utf-8 before formatting mail header David Kågedal
2007-01-12 22:11 ` Junio C Hamano
2007-01-13 1:31 ` Junio C Hamano
2007-01-13 1:43 ` Junio C Hamano
2007-01-13 11:19 ` Johannes Schindelin
2007-01-13 17:57 ` Junio C Hamano
2007-01-15 16:58 ` David Kågedal
2007-01-16 11:41 ` Johannes Schindelin
2007-01-16 12:43 ` David Kågedal
2007-01-13 12:23 ` Robin Rosenberg
2007-01-13 17:54 ` Junio C Hamano
2007-01-15 16:54 ` David Kågedal [this message]
2007-01-13 11:02 ` Alex Riesen
2007-01-14 0:42 ` Horst H. von Brand
2007-01-14 19:25 ` Alex Riesen
2007-01-13 22:18 ` Junio C Hamano
2007-01-15 16:57 ` David Kågedal
2007-01-15 16:53 ` David Kågedal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fyac44e9.fsf@morpheus.local \
--to=davidk@lysator$(echo .)liu.se \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox