Re: [PATCH v2] post-receive-email: explicitly set Content-Type header
- From
Shumkin Alexey <zapped@mail.ru>
- Date
- Sep 20, 2011, 10:42 UTC
- Message-ID
- <20110920104256.GA11656@zapped.homeip.net>
- In-Reply-To
- <4E785DC6.80105@viscovery.net>
[ resent to mailing list ] On Tue, Sep 20, 2011 at 11:32:54AM +0200, Johannes Sixt wrote:
Show 16 quoted lines
> Am 9/20/2011 10:07, schrieb Alexey Shumkin: > > Some email clients (e.g. claws-mail) incorrectly display > > message body when there is no Content-Type header and charset > > explicitly defined. > > So, set explicitly Content-Type header and charset > > can be defined with hooks.emailcharset config variable. > > Please write full sentences with complete punctuation and capitalization. > Perhaps you meant to say: > > Some email clients (e.g. claws-mail) display the message body > incorrectly when the charset is not defined explicitly in a > Content-Type header. Insert a Content-Type header in the message. > > The charset can be defined with the config variable > hooks.emailcharset.
Thanks for the correction. English is not my native language (although it is not for you, too, I guess :) ). I read it and take on ear fine but I have no enough practice to write on it.
Show 8 quoted lines
> > +# 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?)So that was a quick solution for me :)