This commit is contained in:
Jay Phelps 2016-02-05 17:27:56 -08:00
commit a9b46e4e09
3 changed files with 35 additions and 0 deletions

16
Makefile Normal file
View file

@ -0,0 +1,16 @@
prefix=/usr/local
# files that need mode 755
EXEC_FILES =git-blame-someone-else
all:
@echo "usage: make install"
@echo " make uninstall"
install:
install -m 0755 $(EXEC_FILES) $(prefix)/bin
uninstall:
test -d $(prefix)/bin && \
cd $(prefix)/bin && \
rm -f $(EXEC_FILES)

7
README.md Normal file
View file

@ -0,0 +1,7 @@
# git-blame-someone-else
## Usage
```bash
$ git blame-someone-else <author> <commit>
```

12
git-blame-someone-else Normal file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
AUTHOR=$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 rebase --continue
} &> /dev/null
echo "$AUTHOR is now the author of $COMMIT. You're officially an asshole.";