diff options
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/get-authors | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/get-authors b/contrib/get-authors index 118ca4466..0fe71dca3 100755 --- a/contrib/get-authors +++ b/contrib/get-authors @@ -11,6 +11,13 @@ gituser="`git config user.name` <`git config user.email`>" +if [ "$1" = "--email" ]; then + strip_email=cat + shift +else + strip_email="sed 's, *<[^>]*@[^>]*>,,g'" +fi + while [ $# -gt 0 ]; do f=$1 shift @@ -18,7 +25,7 @@ while [ $# -gt 0 ]; do major_contributors= minor_contributors= total_lines=`wc -l "$f" | awk '{print$1}'` - original_author=`git log --pretty="format:%aN <%aE>" "$f" | tail -1` + original_author=`git log --use-mailmap --pretty="format:%aN <%aE>" "$f" | tail -1` git blame --incremental "$f" | gawk '/^[0-9a-f]+ [0-9]+ [0-9]+ [0-9]+$/ {nl=$4;} /^author / {$1=""; author=$0;} /^author-mail / {mail=$2} /^filename / {while(nl--) {print author,mail}}' | sed "s,Not Committed Yet <not.committed.yet>,$gituser," | sort | uniq -c | sort -n | ( while read lines author; do pct=$((100*$lines/$total_lines)) @@ -32,5 +39,5 @@ while [ $# -gt 0 ]; do done; \ echo "$original_author" echo "${major_contributors:-none}" - echo "${minor_contributors:-none}" ) + echo "${minor_contributors:-none}" ) | eval "$strip_email" done |