diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2024-01-25 22:05:38 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2024-01-25 22:05:38 -0800 |
commit | a2d740afd3eeb0cbd44e799584734f1af05da3f1 (patch) | |
tree | 4fc5d39f8941380e150671d925a481adc51a17ef | |
parent | local/update-02-gpg: fix whitespace in comment (diff) | |
download | githooks-a2d740afd3eeb0cbd44e799584734f1af05da3f1.tar.gz githooks-a2d740afd3eeb0cbd44e799584734f1af05da3f1.tar.bz2 githooks-a2d740afd3eeb0cbd44e799584734f1af05da3f1.zip |
fix: local/post-receive.gentoo-commits should support committer_realname_ascii fallback
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-x | local/post-receive.gentoo-commits | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/local/post-receive.gentoo-commits b/local/post-receive.gentoo-commits index fe2a203..040dda4 100755 --- a/local/post-receive.gentoo-commits +++ b/local/post-receive.gentoo-commits @@ -305,8 +305,11 @@ sub get_data($) { $data{"committer_username"} = $ENV{"git_username"} ? $ENV{"git_username"} : $ENV{"GL_USER"}; $data{"committer_email"} = $ENV{"git_email"} if $ENV{"git_email"} and length($ENV{"git_email"}) > 0; + # Start with ASCII realname, and then override it with the UTF-8 username if needed. + $data{"committer_realname"} = $data{"committer_realname_ascii"} = $ENV{"git_realname_ascii"} if $ENV{"git_realname_ascii"} and length($ENV{"git_realname_ascii"}) > 0; $data{"committer_realname"} = $ENV{"git_realname"} if $ENV{"git_realname"} and length($ENV{"git_realname"}) > 0; - $data{"committer"} = $data{"committer_realname"}." <".$data{"committer_email"}.">" if ($data{"committer_realname"} && $data{"committer_email"}); + # Construct the committer again. + $data{"committer"} = sprintf ("%s <%s>", $data{"committer_realname"}, $data{"committer_email"}) if ($data{"committer_realname"} && $data{"committer_email"}); if ($ENV{"GL_TS"}) { $date->parse_format("%Y-%m-%d\.%H:%M:%S", $ENV{"GL_TS"}); |