From a51e03118d779e39e7877b415ee61440bfcc09dd Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 8 Mar 2014 00:53:33 -0500 Subject: [PATCH] git-rewrite-authors: support names better --- .bin/git-rewrite-authors | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.bin/git-rewrite-authors b/.bin/git-rewrite-authors index ce93381..e5d4b08 100755 --- a/.bin/git-rewrite-authors +++ b/.bin/git-rewrite-authors @@ -4,8 +4,11 @@ tmp=$(mktemp) cat << \EOF > ${tmp} decode() { awk -vid="$1" -vtype="$2" '$1 == id { - print "export GIT_"type"_NAME='\''" $3 " " $4 "'\'';" - print "export GIT_"type"_EMAIL='\''" $5 "'\'';" + match($0, /^[^=]*=\s*([^<]*)<([^>]*)>/, a); + name = gensub(/\s+$/, "", "g", a[1]); + email = a[2]; + print "export GIT_"type"_NAME='\''" name "'\'';" + print "export GIT_"type"_EMAIL='\''" email "'\'';" }' ${author_file} } EOF -- 2.39.5