diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/script/credits.sh | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/script/credits.sh')
-rwxr-xr-x | src/script/credits.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/script/credits.sh b/src/script/credits.sh new file mode 100755 index 00000000..415889d5 --- /dev/null +++ b/src/script/credits.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +range="$1" +TMP=/tmp/credits +declare -A mail2author +declare -A mail2organization +remap="s/'/ /g" +git log --pretty='%ae %aN <%aE>' $range | sed -e "$remap" | sort -u > $TMP +while read mail who ; do + author=$(echo $who | git -c mailmap.file=.peoplemap check-mailmap --stdin) + mail2author[$mail]="$author" + organization=$(echo $who | git -c mailmap.file=.organizationmap check-mailmap --stdin) + mail2organization[$mail]="$organization" +done < $TMP +declare -A author2lines +declare -A organization2lines +git log --no-merges --pretty='%ae' $range | sed -e "$remap" | sort -u > $TMP +while read mail ; do + count=$(git log --numstat --author="$mail" --pretty='%h' $range | + egrep -v 'package-lock\.json|\.xlf' | # generated files that should be excluded from line counting + perl -e 'while(<STDIN>) { if(/(\d+)\t(\d+)/) { $added += $1; $deleted += $2 } }; print $added + $deleted;') + (( author2lines["${mail2author[$mail]}"] += $count )) + (( organization2lines["${mail2organization[$mail]}"] += $count )) +done < $TMP +echo +echo "Number of lines added and removed, by authors" +for author in "${!author2lines[@]}" ; do + printf "%6s %s\n" ${author2lines["$author"]} "$author" +done | sort -rn | nl +echo +echo "Number of lines added and removed, by organization" +for organization in "${!organization2lines[@]}" ; do + printf "%6s %s\n" ${organization2lines["$organization"]} "$organization" +done | sort -rn | nl +echo +echo "Commits, by authors" +git log --no-merges --pretty='%aN <%aE>' $range | git -c mailmap.file=.peoplemap check-mailmap --stdin | sort | uniq -c | sort -rn | nl +echo +echo "Commits, by organizations" +git log --no-merges --pretty='%aN <%aE>' $range | git -c mailmap.file=.organizationmap check-mailmap --stdin | sort | uniq -c | sort -rn | nl +echo +echo "Reviews, by authors (one review spans multiple commits)" +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 +echo +echo "Reviews, by organizations (one review spans multiple commits)" +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 |