We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d8307b commit 5a4441aCopy full SHA for 5a4441a
git-blame-someone-else
@@ -1,12 +1,14 @@
1
#!/usr/bin/env bash
2
3
AUTHOR=$1
4
+AUTHOR_NAME=$(echo $AUTHOR | perl -wlne '/^(.*)\s*<.*>$/ and print $1')
5
+AUTHOR_EMAIL=$(echo $AUTHOR | perl -wlne '/^.*\s*<(.*)>$/ and print $1')
6
COMMIT=$(git rev-parse --short $2)
7
8
{
9
GIT_SEQUENCE_EDITOR="sed -i -e 's/^pick $COMMIT/edit $COMMIT/'" git rebase -i $COMMIT~1^^
- git commit --amend --no-edit --author="$AUTHOR"
10
+ GIT_COMMITTER_NAME="$AUTHOR_NAME" GIT_COMMITTER_EMAIL="$AUTHOR_EMAIL" git commit --amend --no-edit --author="$AUTHOR"
11
git rebase --continue
12
} &> /dev/null
13
-echo "$AUTHOR is now the author of $COMMIT. You're officially an asshole.";
14
+echo "$AUTHOR_NAME is now the author of $COMMIT. You're officially an asshole.";
0 commit comments