git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH] git-shortlog: respect i18n.logOutputEncoding config setting

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Mar 22, 2009, 19:47 UTC
Message-ID
<20090322194708.GP27459@genesis.frugalware.org>
In-Reply-To
<7v7i2h5pfh.fsf@gitster.siamese.dyndns.org>
On Sun, Mar 22, 2009 at 12:26:58PM -0700, Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
> 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.

Previous: Junio C Hamano
Message 4 of 4 in “git-shortlog: respect i18n.logOutputEncoding config setting”
  1. git-shortlog: respect i18n.logOutputEncoding config settingMiklos Vajna, Feb 20, 2009
  2. Miklos VajnaMar 22, 2009
  3. Junio C HamanoMar 22, 2009
  4. Miklos VajnaMar 22, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.