summaryrefslogtreecommitdiff
path: root/contrib/get-authors
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@cs.nyu.edu>2013-04-02 13:34:55 -0400
committerMorgan Deters <mdeters@cs.nyu.edu>2013-04-02 14:35:35 -0400
commit6673ce0fdd4bb727208be0cbea59585179758a1c (patch)
treee71670cae87243a60ffa3f80a2b61e83a14aacce /contrib/get-authors
parent9c86503d8391467fad8d64d29a52a92de7cc65eb (diff)
Fix get-authors script to not extract email addresses, canonicalize names, add .mailmap
Diffstat (limited to 'contrib/get-authors')
-rwxr-xr-xcontrib/get-authors11
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
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback