git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] post-receive-email: explicitly set Content-Type header
@ 2011-09-20  7:52 Alexey Shumkin
  2011-09-20  8:07 ` [PATCH v2] " Alexey Shumkin
  0 siblings, 1 reply; 12+ messages in thread
From: Alexey Shumkin @ 2011-09-20  7:52 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, 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 headrer and charset
can be defined with hooks.emailcharset config variable.

Signed-off-by: Alexey Shumkin <zapped@mail.ru>
---
 contrib/hooks/post-receive-email |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index 21989fc..64d7c2f 100755
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -60,6 +60,8 @@
 #   email body. If not specified, there is no limit.
 #   Lines beyond the limit are suppressed and counted, and a final
 #   line is added indicating the number of suppressed lines.
+# hooks.emailcharset
+#   The charset used in Content-Type header. UTF-8, if not specified.
 #
 # Notes
 # -----
@@ -229,6 +231,7 @@ generate_email_header()
 	cat <<-EOF
 	To: $recipients
 	Subject: ${emailprefix}$projectdesc $refname_type $short_refname ${change_type}d. $describe
+	Content-Type: text/plain; charset=$emailcharset
 	X-Git-Refname: $refname
 	X-Git-Reftype: $refname_type
 	X-Git-Oldrev: $oldrev
@@ -723,6 +726,7 @@ envelopesender=$(git config hooks.envelopesender)
 emailprefix=$(git config hooks.emailprefix || echo '[SCM] ')
 custom_showrev=$(git config hooks.showrev)
 maxlines=$(git config hooks.emailmaxlines)
+emailcharset=$(git config hooks.emailcharset || echo 'UTF-8')
 
 # --- Main loop
 # Allow dual mode: run from the command line just like the update hook, or
-- 
1.7.6.3.4.gf71f

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-11-09 15:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20  7:52 [PATCH] post-receive-email: explicitly set Content-Type header Alexey Shumkin
2011-09-20  8:07 ` [PATCH v2] " Alexey Shumkin
2011-09-20  9:32   ` Johannes Sixt
2011-09-20 10:42     ` Shumkin Alexey
2011-09-20 11:10       ` Johannes Sixt
2011-10-07  9:06         ` Jonathan Nieder
2011-10-07 12:52           ` Alexey Shumkin
2011-10-07 20:19             ` Jonathan Nieder
2011-11-09 11:00               ` [PATCH v3] " Alexey Shumkin
2011-11-09 14:11                 ` Junio C Hamano
2011-11-09 15:01                   ` Alexey Shumkin
2011-09-20 12:23       ` [PATCH v2] " Jakub Narebski

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).