From 5a4441ac6f0a30ffc4f85e35dd36fe2cbe8cb93b Mon Sep 17 00:00:00 2001 From: Jay Phelps Date: Fri, 5 Feb 2016 19:46:30 -0800 Subject: [PATCH] Also change the commiter, not just the author hahaha --- git-blame-someone-else | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/git-blame-someone-else b/git-blame-someone-else index 3a24fd4..41590e0 100644 --- a/git-blame-someone-else +++ b/git-blame-someone-else @@ -1,12 +1,14 @@ #!/usr/bin/env bash AUTHOR=$1 +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) { GIT_SEQUENCE_EDITOR="sed -i -e 's/^pick $COMMIT/edit $COMMIT/'" git rebase -i $COMMIT~1^^ - git commit --amend --no-edit --author="$AUTHOR" + GIT_COMMITTER_NAME="$AUTHOR_NAME" GIT_COMMITTER_EMAIL="$AUTHOR_EMAIL" git commit --amend --no-edit --author="$AUTHOR" git rebase --continue } &> /dev/null -echo "$AUTHOR is now the author of $COMMIT. You're officially an asshole."; \ No newline at end of file +echo "$AUTHOR_NAME is now the author of $COMMIT. You're officially an asshole."; \ No newline at end of file