public
Last active

Written to change the unix name used for a cvs commit to a pretty git name for the user. Implementation borrowed from http://lists.freedesktop.org/archives/portland/2010-October.txt author-conv-file format (same format as git-cvsimport requires):

  • Download Gist
git_fix_author
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#!/bin/bash
 
export $authors_file=author-conv-file
 
git filter-branch -f --env-filter '
 
get_name () {
grep "^$1=" "$authors_file" |
sed "s/^.*=\(.*\) <.*>$/\1/"
}
 
get_email () {
grep "^$1=" "$authors_file" |
sed "s/^.*=.* <\(.*\)>$/\1/"
}
 
GIT_AUTHOR_NAME=$(get_name $GIT_COMMITTER_NAME) &&
GIT_AUTHOR_EMAIL=$(get_email $GIT_COMMITTER_NAME) &&
GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME &&
GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL &&
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL &&
export GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL
' -- --all

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.