mirror of
https://github.com/jayphelps/git-blame-someone-else.git
synced 2025-05-01 11:06:21 +02:00
suchwow
This commit is contained in:
commit
a9b46e4e09
3 changed files with 35 additions and 0 deletions
16
Makefile
Normal file
16
Makefile
Normal 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
7
README.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
# git-blame-someone-else
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
$ git blame-someone-else <author> <commit>
|
||||
```
|
12
git-blame-someone-else
Normal file
12
git-blame-someone-else
Normal 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.";
|
Loading…
Add table
Reference in a new issue