From: Mike Frysinger Date: Sat, 8 Mar 2014 05:53:33 +0000 (-0500) Subject: git-rewrite-authors: support names better X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=a51e03118d779e39e7877b415ee61440bfcc09dd;p=home.git git-rewrite-authors: support names better --- 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