--- /dev/null
+Morgan Deters <mdeters@cs.nyu.edu> <mdeters@cs.nyu.edu>
+Morgan Deters <mdeters@cs.nyu.edu> <mdeters@gmail.com>
+Dejan Jovanovic <dejan@cs.nyu.edu> <dejan@cs.nyu.edu>
+Dejan Jovanovic <dejan@cs.nyu.edu> <dejan.jovanovic@gmail.com>
+Francois Bobot <francois@bobot.eu> <francois@bobot.eu>
+Liana Hadarean <lianah@cs.nyu.edu> <lianahady@gmail.com>
+Andrew Reynolds <andrew.j.reynolds@gmail.com> <andrew.j.reynolds@gmail.com>
+Cesare Tinelli <cesare-tinelli@uiowa.edu> <cesare-tinelli@uiowa.edu>
+Christopher L. Conway <christopherleeconway@gmail.com> <christopherleeconway@gmail.com>
+Clark Barrett <barrett@cs.nyu.edu> <barrett@cs.nyu.edu>
+Kshitij Bansal <kshitij@cs.nyu.edu> <kshitij@cs.nyu.edu>
+Tianyi Liang <tianyi-liang@uiowa.edu> <tianyi-liang@uiowa.edu>
+Tim King <taking@cs.nyu.edu> <taking@cs.nyu.edu>
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
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))
done; \
echo "$original_author"
echo "${major_contributors:-none}"
- echo "${minor_contributors:-none}" )
+ echo "${minor_contributors:-none}" ) | eval "$strip_email"
done