From aec94fceac5fc0016c569f2144dea625d65702af Mon Sep 17 00:00:00 2001 From: RodrigoHahn Date: Tue, 1 Mar 2016 16:15:34 -0300 Subject: [PATCH] Added ability to choose random victim (plus email!) >D --- git-blame-someone-else | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git-blame-someone-else b/git-blame-someone-else index d76642c..ce257c2 100644 --- a/git-blame-someone-else +++ b/git-blame-someone-else @@ -6,6 +6,10 @@ if [ $# -ne 2 ]; then fi 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_EMAIL=$(echo $AUTHOR | perl -wlne '/^.*\s*<(.*)>$/ and print $1') COMMIT=$(git rev-parse --short $2)