Created
March 6, 2020 22:16
-
-
Save timlo/05fcf1b2be9d71f3d93f310126628074 to your computer and use it in GitHub Desktop.
Git Random Reviewr
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 | |
# random recent committer | |
function rr() { | |
git status >/dev/null 2>&1 | |
if [[ $? -ne 0 ]]; then | |
echo "Not a git repo" | |
return 128 | |
fi | |
username=`git config user.name` | |
if [[ ! -s .consume-committers ]]; then | |
git shortlog -se --since='-1 month' | awk -F'\t' '{print $2,$3}' | grep -v "$username" | gshuf > .consume-committers | |
fi | |
committers="$(< .consume-committers)" | |
echo "$committers" | ghead --lines=-1 > .consume-committers | |
echo "$committers" | tail -n 1 | |
} | |
rr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment