Created
April 19, 2012 02:11
-
-
Save JonnyJD/2417888 to your computer and use it in GitHub Desktop.
list new contributors for a git branch (given a previous list)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
aliases=(aheadley Andrew "Two Words" "<mail@example.com>") | |
if [ $# -gt 0 ]; then | |
branch=$1 | |
else | |
branch=master | |
fi | |
echo contributors in $branch: | |
# contributors with name and email | |
# sorted on last part of the name | |
git shortlog -se $branch \ | |
| awk '{ print $(NF-1), $0 }' | sort \ | |
| while read line; | |
do | |
orig_line=`echo $line | awk '{ $1=""; print $0 }'` | |
count=`echo $orig_line | awk '{ print $1 }'` | |
name=`echo $orig_line | awk '{ | |
for (i=2; i<=NF-1; i++) { | |
if (i>2) printf(" ") | |
printf("%s", $i) | |
} | |
}'` | |
email=`echo $orig_line | awk '{ print $NF }'` | |
# don't show known aliases | |
for alias in "${aliases[@]}"; do | |
if [ "$name" = "$alias" ]; then | |
continue 2 | |
fi | |
if [ "$email" = "$alias" ]; then | |
continue 2 | |
fi | |
done | |
grep -q "$email" CONTRIBUTORS.rst | |
if [ $? -ne 0 ]; then | |
printf "%3d %25s %s\n" $count "$name" "$email" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment