mirror of
https://github.com/jayphelps/git-blame-someone-else.git
synced 2025-05-02 19:45:57 +02:00
Now defaults to last commit if not provided
For when you _really_ don't give a damn.
This commit is contained in:
parent
07b4f92f3c
commit
413a2d5313
1 changed files with 8 additions and 1 deletions
|
@ -6,9 +6,16 @@ if [ $# -ne 2 ]; then
|
|||
fi
|
||||
|
||||
AUTHOR=$1
|
||||
|
||||
|
||||
COMMIT_HASH=$2
|
||||
if [ "$2" = "--" ]; then
|
||||
COMMIT_HASH=$(git log -n 1 --pretty=format:"%H")
|
||||
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)
|
||||
COMMIT=$(git rev-parse --short $COMMIT_HASH)
|
||||
|
||||
{
|
||||
GIT_SEQUENCE_EDITOR="sed -i -e 's/^pick $COMMIT/edit $COMMIT/'" git rebase -i $COMMIT~1^^
|
||||
|
|
Loading…
Add table
Reference in a new issue