X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=.bin%2Fgit-rewrite-authors;h=601700805230e52478c77c9d3dbdac79ec034e80;hb=fb5d2cb632ad05e57c8b257f5a3c85bb75c8ac31;hp=e136e59876d54c26796bd02294c868c6f3c2649b;hpb=e36215f2be80fccf2158f09279f2ea4d8242da31;p=home.git diff --git a/.bin/git-rewrite-authors b/.bin/git-rewrite-authors index e136e59..6017008 100755 --- a/.bin/git-rewrite-authors +++ b/.bin/git-rewrite-authors @@ -7,6 +7,9 @@ decode() { awk -vid="$1" -vtype="$2" '$1 == id { match($0, /^[^=]*=\s*([^<]*)<([^>]*)>/, a); name = gensub(/\s+$/, "", "g", a[1]); + name = gensub(/^"/, "", "g", name); + name = gensub(/"$/, "", "g", name); + name = gensub(/'\''/, "'\''\\\\'\'''\''", "g", name); email = a[2]; print "export GIT_"type"_NAME='\''" name "'\'';" print "export GIT_"type"_EMAIL='\''" email "'\'';" @@ -22,8 +25,12 @@ for x in cvs-authors authors ; do exit 1 fi done +if [ ! -e "${author_file}" ] ; then + echo "error: could not find ${author_file}" + exit 1 +fi git filter-branch \ - --env-filter ". ${tmp};"' \ - eval `decode "${GIT_AUTHOR_NAME}" AUTHOR`; \ - eval `decode "${GIT_COMMITTER_NAME}" COMMITTER`; \ + --env-filter ". '${tmp}';"' \ + eval "$(decode "${GIT_AUTHOR_NAME}" AUTHOR)"; \ + eval "$(decode "${GIT_COMMITTER_NAME}" COMMITTER)"; \ ' "$@"