mirror of
https://github.com/jayphelps/git-blame-someone-else.git
synced 2025-05-01 11:06:21 +02:00
Improve regex and print better usage message
This commit is contained in:
parent
36115759d8
commit
6ad3acbec4
1 changed files with 3 additions and 3 deletions
|
@ -1,12 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [ $# -ne 2 ]; then
|
if [ $# -ne 2 ]; then
|
||||||
>&2 echo "Usage: $0 <author> <commit>"
|
>&2 echo "Usage: $(basename $0) <author> <commit>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AUTHOR=$1
|
AUTHOR=$1
|
||||||
AUTHOR_NAME=$(echo $AUTHOR | perl -wlne '/^(.*?)\s*<.*>$/ and print $1')
|
AUTHOR_NAME=$(echo $AUTHOR | perl -wlne '/^([^<]+).*>$/ 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
Reference in a new issue