diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-09-11 14:58:46 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-09-11 14:58:46 -0700 |
commit | 09a373068afdb749f5a84f0c698d69776c257780 (patch) | |
tree | 783f17705e6da6afccf554cd4aa88d4130b6f4db /contrib | |
parent | Merge branch 'sh/pull-rebase-preserve' (diff) | |
parent | hooks/post-receive-email: set declared encoding to utf-8 (diff) | |
download | tgif-09a373068afdb749f5a84f0c698d69776c257780.tar.xz |
Merge branch 'jn/post-receive-utf8'
Update post-receive-email script to make sure the message contents
and pathnames are encoded consistently in UTF-8.
* jn/post-receive-utf8:
hooks/post-receive-email: set declared encoding to utf-8
hooks/post-receive-email: force log messages in UTF-8
hooks/post-receive-email: use plumbing instead of git log/show
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/hooks/post-receive-email | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email index 153115029d..8ee410f843 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 @@ -471,7 +474,7 @@ generate_delete_branch_email() echo " was $oldrev" echo "" echo $LOGBEGIN - git show -s --pretty=oneline $oldrev + git diff-tree -s --always --encoding=UTF-8 --pretty=oneline $oldrev echo $LOGEND } @@ -547,11 +550,11 @@ generate_atag_email() # performed on them if [ -n "$prevtag" ]; then # Show changes since the previous release - git rev-list --pretty=short "$prevtag..$newrev" | git shortlog + git shortlog "$prevtag..$newrev" else # No previous tag, show all the changes since time # began - git rev-list --pretty=short $newrev | git shortlog + git shortlog $newrev fi ;; *) @@ -571,7 +574,7 @@ generate_delete_atag_email() echo " was $oldrev" echo "" echo $LOGBEGIN - git show -s --pretty=oneline $oldrev + git diff-tree -s --always --encoding=UTF-8 --pretty=oneline $oldrev echo $LOGEND } @@ -617,7 +620,7 @@ generate_general_email() echo "" if [ "$newrev_type" = "commit" ]; then echo $LOGBEGIN - git show --no-color --root -s --pretty=medium $newrev + git diff-tree -s --always --encoding=UTF-8 --pretty=medium $newrev echo $LOGEND else # What can we do here? The tag marks an object that is not @@ -636,7 +639,7 @@ generate_delete_general_email() echo " was $oldrev" echo "" echo $LOGBEGIN - git show -s --pretty=oneline $oldrev + git diff-tree -s --always --encoding=UTF-8 --pretty=oneline $oldrev echo $LOGEND } |