From: Miklos Vajna <vmiklos@frugalware.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC/PATCH] git-shortlog: respect i18n.logOutputEncoding config setting
Date: Sun, 22 Mar 2009 20:47:08 +0100 [thread overview]
Message-ID: <20090322194708.GP27459@genesis.frugalware.org> (raw)
In-Reply-To: <7v7i2h5pfh.fsf@gitster.siamese.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 1382 bytes --]
On Sun, Mar 22, 2009 at 12:26:58PM -0700, Junio C Hamano <gitster@pobox.com> wrote:
> It is unclear what you want to say in these for lines. Do you mean "when
> used to generate logs by itself this patch improves the behaviour by
> making the output consistent with what "git log" does, but it does the
> same mangling when used as a filter without knowing the log encoding and
> potentially screw people over who have been depending on it not to convert
> the encoding"? Or something else?
Not exactly - let me rephrase:
Normally we can do a reencode_string() because we know the encoding of
the commit and we know the wished output encoding. Given that
git-shortlog can be a filter as well, we don't know the encoding of the
input, but we know the wished output encoding. So what we can do is to
_try_ to encode from utf8 to the wished encoding, and if that fails,
just don't convert anything. The result is correct, because:
1) If git-shortlog is a filter, then git-log already does the encoding,
the encoding will fail in git-shortlog so the original input will be
shown.
2) In the other case git-shoftlog can just do the converion.
At least I tested the case with utf8 author names and a latin2 terminal
and both the 'git log rev.. | git shortlog' and the 'git shortlog rev..'
output was correct, while git.git's master shows the correct output only
in the first case.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
prev parent reply other threads:[~2009-03-22 19:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-20 1:12 [RFC/PATCH] git-shortlog: respect i18n.logOutputEncoding config setting Miklos Vajna
2009-03-22 11:34 ` Miklos Vajna
2009-03-22 19:26 ` Junio C Hamano
2009-03-22 19:47 ` Miklos Vajna [this message]
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=20090322194708.GP27459@genesis.frugalware.org \
--to=vmiklos@frugalware.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).