Created
December 16, 2016 18:17
-
-
Save jdm/5961bb55506d037e95490d2503da50f3 to your computer and use it in GitHub Desktop.
TWiS new contributor detection
This file contains hidden or 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 | |
INITIAL_COMMIT=ce30d45 | |
START_COMMIT=`git log --before="last week" --pretty=format:%H|head -n1` | |
ALL_NAMES=`git log $INITIAL_COMMIT.. --pretty=format:%an|sort|uniq` | |
OLD_NAMES=`git log $INITIAL_COMMIT..$START_COMMIT --pretty=format:%an|sort|uniq` | |
echo "$OLD_NAMES">names_old.txt | |
echo "$ALL_NAMES">names_all.txt | |
diff names_old.txt names_all.txt | |
#rm names_old.txt names_all.txt | |
while read name; do | |
COMMIT=$(git log --author="$name" --pretty=oneline | head -1 | awk '{print $1}'); | |
username=$(git rev-list --all --not $COMMIT^@ --children | grep "^$COMMIT"| xargs git show | grep "Auto" | sed "s/^.*Auto merge of \#[0-9]* - //" | sed "s/\:.*$//") | |
echo "- [$name](https://github.com/$username)" | |
done < <(comm -23 names_all.txt names_old.txt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gsed for osx