aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2021-03-08 19:38:07 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2021-03-08 19:39:09 +0100
commit7df42757ec4250e0f53fc0521b9ebc5a197f315c (patch)
treecbd404921fdf87e6de3d63adb573ae291c86cb0c
parent3d1307a5c8b093623fcacabc1f08cd3209cb8ce8 (diff)
downloadpw-7df42757ec4250e0f53fc0521b9ebc5a197f315c.tar.gz
pw-apply: Handle UTF-8 author names
Detect and decode UTF-8 author names for cover letters. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rwxr-xr-xpw-apply4
1 files changed, 4 insertions, 0 deletions
diff --git a/pw-apply b/pw-apply
index 9b94e21..92a93d7 100755
--- a/pw-apply
+++ b/pw-apply
@@ -178,6 +178,10 @@ if [ ! -z "$merge" ]; then
git merge --stat --log --no-edit --no-ff $branch
if [ ! -z "$cover" ]; then
author=`grep 'X-Patchwork-Submitter:' cover.i|cut -f2,3 -d' '`
+ if [[ "$author" =~ ^=\?utf-8\?b\?(.*)\?=$ ]]; then
+ # strip away "=?utf-8?b?" prefix and "?=" suffix and base64-decode
+ author=$(echo "${BASH_REMATCH[1]}" | base64 -d)
+ fi
branch_name=`grep '^Subject:' cover.i|cut -d']' -f2|cut -d' ' -f2-10`
text=`grep -A300 'X-Mailing-List:' cover.i |tail --lines=+3|grep -B300 -E "^.*\([0-9]+\):$"|head --lines=-2`
git commit --amend --signoff -F- <<EOF