6 declare -A mail2organization
8 git log --pretty='%ae %aN <%aE>' $range | sed -e "$remap" | sort -u > $TMP
9 while read mail who ; do
10 author=$(echo $who | git -c mailmap.file=.peoplemap check-mailmap --stdin)
11 mail2author[$mail]="$author"
12 organization=$(echo $who | git -c mailmap.file=.organizationmap check-mailmap --stdin)
13 mail2organization[$mail]="$organization"
15 declare -A author2lines
16 declare -A organization2lines
17 git log --no-merges --pretty='%ae' $range | sed -e "$remap" | sort -u > $TMP
19 count=$(git log --numstat --author="$mail" --pretty='%h' $range |
20 perl -e 'while(<STDIN>) { if(/(\d+)\t(\d+)/) { $added += $1; $deleted += $2 } }; print $added + $deleted;')
21 (( author2lines["${mail2author[$mail]}"] += $count ))
22 (( organization2lines["${mail2organization[$mail]}"] += $count ))
25 echo "Number of lines added and removed, by authors"
26 for author in "${!author2lines[@]}" ; do
27 printf "%6s %s\n" ${author2lines["$author"]} "$author"
30 echo "Number of lines added and removed, by organization"
31 for organization in "${!organization2lines[@]}" ; do
32 printf "%6s %s\n" ${organization2lines["$organization"]} "$organization"
35 echo "Commits, by authors"
36 git log --no-merges --pretty='%aN <%aE>' $range | git -c mailmap.file=.peoplemap check-mailmap --stdin | sort | uniq -c | sort -rn | nl
38 echo "Commits, by organizations"
39 git log --no-merges --pretty='%aN <%aE>' $range | git -c mailmap.file=.organizationmap check-mailmap --stdin | sort | uniq -c | sort -rn | nl
41 echo "Reviews, by authors (one review spans multiple commits)"
42 git log --pretty=%b $range | perl -n -e 'print "$_\n" if(s/^\s*Reviewed-by:\s*(.*<.*>)\s*$/\1/i)' | git check-mailmap --stdin | git -c mailmap.file=.peoplemap check-mailmap --stdin | sort | uniq -c | sort -rn | nl
44 echo "Reviews, by organizations (one review spans multiple commits)"
45 git log --pretty=%b $range | perl -n -e 'print "$_\n" if(s/^\s*Reviewed-by:\s*(.*<.*>)\s*$/\1/i)' | git check-mailmap --stdin | git -c mailmap.file=.organizationmap check-mailmap --stdin | sort | uniq -c | sort -rn | nl