]> git.wh0rd.org Git - home.git/commitdiff
git-rewrite-authors: support names better
authorMike Frysinger <vapier@gentoo.org>
Sat, 8 Mar 2014 05:53:33 +0000 (00:53 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sat, 8 Mar 2014 05:53:33 +0000 (00:53 -0500)
.bin/git-rewrite-authors

index ce93381e79f5b5c9494bd93c0331dafb674606f9..e5d4b081e1b813c95e94d5370d6efcc437336c8a 100755 (executable)
@@ -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