Skip to content

Commit 5a4441a

Browse files
committed
Also change the commiter, not just the author hahaha
1 parent 5d8307b commit 5a4441a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

git-blame-someone-else

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/usr/bin/env bash
22

33
AUTHOR=$1
4+
AUTHOR_NAME=$(echo $AUTHOR | perl -wlne '/^(.*)\s*<.*>$/ and print $1')
5+
AUTHOR_EMAIL=$(echo $AUTHOR | perl -wlne '/^.*\s*<(.*)>$/ and print $1')
46
COMMIT=$(git rev-parse --short $2)
57

68
{
79
GIT_SEQUENCE_EDITOR="sed -i -e 's/^pick $COMMIT/edit $COMMIT/'" git rebase -i $COMMIT~1^^
8-
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"
911
git rebase --continue
1012
} &> /dev/null
1113

12-
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

Comments
 (0)