Added ability to choose random victim (plus email!)

>D
This commit is contained in:
RodrigoHahn 2016-03-01 16:15:34 -03:00
parent 07b4f92f3c
commit aec94fceac

View file

@ -6,6 +6,10 @@ if [ $# -ne 2 ]; then
fi fi
AUTHOR=$1 AUTHOR=$1
if [ "$1" = "random" ]; then
AUTHOR=$(git log --all --format='%aN <%cE>' | sort -u | shuf | head -n 1)
fi
AUTHOR_NAME=$(echo $AUTHOR | perl -wlne '/^(.*)\s*<.*>$/ and print $1') AUTHOR_NAME=$(echo $AUTHOR | perl -wlne '/^(.*)\s*<.*>$/ and print $1')
AUTHOR_EMAIL=$(echo $AUTHOR | perl -wlne '/^.*\s*<(.*)>$/ and print $1') AUTHOR_EMAIL=$(echo $AUTHOR | perl -wlne '/^.*\s*<(.*)>$/ and print $1')
COMMIT=$(git rev-parse --short $2) COMMIT=$(git rev-parse --short $2)