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

Re: [PATCH 2/3] hooks/post-receive-email: force log messages in UTF-8

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 4, 2013, 18:14 UTC
Message-ID
<20130804181440.GA2894@elie.Belkin>
In-Reply-To
<20130804145448.GA15097@dell-note>
Alexey Shumkin wrote:
> On Fri, Aug 02, 2013 at 04:23:38PM -0700, Jonathan Nieder wrote:
Show 16 quoted lines
>>  1. Log messages use the configured log output encoding, which is
>>     meant to be whatever encoding works best with local terminals
>>     (and does not have much to do with what encoding should be used
>>     for email)
>>
>>  2. Filenames are left as is: on Linux, usually UTF-8, and in the Mingw
>>     port (which uses Unicode filesystem APIs), always UTF-8
>
> I cannot say exactly if it makes sense for THIS patch, but I'd like to
> remind about Cygwin port, which definitely does not use UTF-8 encoding
> (in my case it is Windows-1251) for filenames.
>
>> 
>>  3. The "This is an automated email" preface uses a project description
>>     from .git/description, which is typically in UTF-8 to support
>>     gitweb.

Thanks for clarifying. So in the context you describe, (1) is configurable, (2) is Windows-1251, (3) is unconfigurably UTF-8, and there is no way with current git facilities to force the email to use a single encoding unless (3) happens to contain no special characters.

What is the value of the "[i18n] commitEncoding" setting in your project? What encoding do the raw commit messages (shown with "git log --format=raw") use for their text, and what do they declare with an in-commit 'encoding' header, if any?

Does everyone on this project use Cygwin? That should be fine, but I'd expect there to be problems as soon as someone wants to try the Mingw port ("Git for Windows").

I wonder if there should be an "[i18n] repositoryPathEncoding" configuration item to support this kind of repository. Then git could be aware of the intended encoding of paths, could recode them for display to a terminal, and at least on Linux and Mingw could recode them for use in filenames on disk. "repositoryPathEncoding = none" would mean the current behavior of treating paths as raw sequences of bytes.

What do you think? Jonathan

Previous: Alexey ShumkinNext: Alexey Shumkin
Message 5 of 7 in “post-receive-email: explicitly set Content-Type header”
  1. 0/3 post-receive-email: explicitly set Content-Type headerJonathan Nieder, Aug 2, 2013
  2. 1/3 hooks/post-receive-email: use plumbing instead of git log/showJonathan Nieder, Aug 2, 2013
  3. 2/3 hooks/post-receive-email: force log messages in UTF-8Jonathan Nieder, Aug 2, 2013
  4. Alexey ShumkinAug 4, 2013
  5. Jonathan NiederAug 4, 2013
  6. Alexey ShumkinAug 5, 2013
  7. 3/3 hooks/post-receive-email: set declared encoding to utf-8Jonathan Nieder, Aug 2, 2013

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.