Skip to content

Instantly share code, notes, and snippets.

@timlo
Created March 6, 2020 22:16
Show Gist options
  • Save timlo/05fcf1b2be9d71f3d93f310126628074 to your computer and use it in GitHub Desktop.
Save timlo/05fcf1b2be9d71f3d93f310126628074 to your computer and use it in GitHub Desktop.
Git Random Reviewr
#!/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