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

Re: [PATCH v2] post-receive-email: explicitly set Content-Type header

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Sep 20, 2011, 11:10 UTC
Message-ID
<4E7874B9.2060909@viscovery.net>
In-Reply-To
<20110920104256.GA11656@zapped.homeip.net>
Am 9/20/2011 12:42, schrieb Shumkin Alexey:
Show 25 quoted lines
> On Tue, Sep 20, 2011 at 11:32:54AM +0200, Johannes Sixt wrote:
>> Am 9/20/2011 10:07, schrieb Alexey Shumkin:
>>> +# hooks.emailcharset
>>> +#   The charset used in Content-Type header. UTF-8, if not
>>> specified.
>>
>> How can you be sure that the output produced by git log etc. that are
>> used in the script are in the encoding specified by this variable?
>> IOW, wouldn't log.outputencoding be the better choice to use in the
>> Content-Type header?
> Yes, you're right, we cannot be sure in UTF-8 encoding of output
> and using i18n.logoutputencoding would be a better choice
> instead of new config variable.
> 
> But at the present
> 1. post-send-mail uses description file of a repo
> 2. gitweb also uses this file and AFAIK it assumes one to be in UTF-8
>   (I do not know whether it can be changed there but I tested gitweb once long
>     time ago)
> 3. So if i18n.logoutputencoding is not UTF-8 we get a message composed
> 	with mixed encodings. This fact oblidge us to encode headers
> 	(as quoted printable at least) and synchronize body message that contain
> 	repo description (in UTF-8) and diffstat (in i18n.logoutputencoding).
> 	This is a more complicated task for a shell script
> 	than just specifying Content-Type header (may be git-send-email suits here?)

In this case, it may make sense to have a separate setting, but you should call git like this:

   git -c "i18n.logoutputencoding=$emailcharset" show ...
   git -c "i18n.logoutputencoding=$emailcharset" rev-list --pretty ...
-- Hannes
Previous: Shumkin AlexeyNext: Jonathan Nieder
Message 5 of 12 in “post-receive-email: explicitly set Content-Type header”
  1. post-receive-email: explicitly set Content-Type headerAlexey Shumkin, Sep 20, 2011
  2. post-receive-email: explicitly set Content-Type headerAlexey Shumkin, Sep 20, 2011
  3. Johannes SixtSep 20, 2011
  4. Shumkin AlexeySep 20, 2011
  5. Johannes SixtSep 20, 2011
  6. Jonathan NiederOct 7, 2011
  7. Alexey ShumkinOct 7, 2011
  8. Jonathan NiederOct 7, 2011
  9. post-receive-email: explicitly set Content-Type headerAlexey Shumkin, Nov 9, 2011
  10. Junio C HamanoNov 9, 2011
  11. Alexey ShumkinNov 9, 2011
  12. Jakub NarebskiSep 20, 2011

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.