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 egrep -v 'package-lock\.json|\.xlf' |
# generated files that should be excluded from line counting
21 perl
-e 'while(<STDIN>) { if(/(\d+)\t(\d+)/) { $added += $1; $deleted += $2 } }; print $added + $deleted;')
22 (( author2lines
["${mail2author[$mail]}"] += $count ))
23 (( organization2lines
["${mail2organization[$mail]}"] += $count ))
26 echo "Number of lines added and removed, by authors"
27 for author
in "${!author2lines[@]}" ; do
28 printf "%6s %s\n" ${author2lines["$author"]} "$author"
31 echo "Number of lines added and removed, by organization"
32 for organization
in "${!organization2lines[@]}" ; do
33 printf "%6s %s\n" ${organization2lines["$organization"]} "$organization"
36 echo "Commits, by authors"
37 git log
--no-merges --pretty='%aN <%aE>' $range | git
-c mailmap.
file=.peoplemap check-mailmap
--stdin |
sort |
uniq -c |
sort -rn |
nl
39 echo "Commits, by organizations"
40 git log
--no-merges --pretty='%aN <%aE>' $range | git
-c mailmap.
file=.organizationmap check-mailmap
--stdin |
sort |
uniq -c |
sort -rn |
nl
42 echo "Reviews, by authors (one review spans multiple commits)"
43 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
45 echo "Reviews, by organizations (one review spans multiple commits)"
46 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