mirror of
https://github.com/jayphelps/git-blame-someone-else.git
synced 2025-06-18 10:01:39 +02:00
Added ability to choose random victim (plus email!)
>D
This commit is contained in:
parent
07b4f92f3c
commit
aec94fceac
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue