summaryrefslogtreecommitdiff
path: root/contrib/hooks
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2008-12-11 20:27:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-08-05 17:17:38 (GMT)
commit53a7296e7ebab82d23983fd5506a2bf5ee5d2d0c (patch)
treefe0960f6ab0f8a16d5179b346e5335de72c7c733 /contrib/hooks
parent3109bdb0d157afbd01c412d6f3fb1c86d8b7adde (diff)
downloadgit-53a7296e7ebab82d23983fd5506a2bf5ee5d2d0c.zip
git-53a7296e7ebab82d23983fd5506a2bf5ee5d2d0c.tar.gz
git-53a7296e7ebab82d23983fd5506a2bf5ee5d2d0c.tar.bz2
hooks/post-receive-email: set declared encoding to utf-8
Some email clients (e.g., claws-mail) display the message body incorrectly when the charset is not defined explicitly in a Content-Type header. "git log" generates logs in UTF-8 encoding by default, so add a Content-Type header declaring that encoding to the emails the post-receive-email example hook sends. [jn: also setting the Content-Transfer-Encoding so MTAs know what kind of mangling might be needed when sending to a non 8-bit clean SMTP host] Requested-by: Alexander Gerasiov <gq@debian.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/hooks')
-rwxr-xr-xcontrib/hooks/post-receive-email3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index ba93a0d..8ee410f 100755
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -242,6 +242,9 @@ generate_email_header()
cat <<-EOF
To: $recipients
Subject: ${emailprefix}$projectdesc $refname_type $short_refname ${change_type}d. $describe
+ MIME-Version: 1.0
+ Content-Type: text/plain; charset=utf-8
+ Content-Transfer-Encoding: 8bit
X-Git-Refname: $refname
X-Git-Reftype: $refname_type
X-Git-Oldrev: $oldrev