git punish
is a shortcut for runnig git blame
and posting it's output to git-punish.io to generate a snippet.
Install
You can pull the code from site and place it in appropriate place by running
following lines. You may need to run it with sudo
.
> curl https://git-punish.io/get -o /usr/local/bin/git-punish
> chmod +x /usr/local/bin/git-punish
Alternatively if you feel uncomfortable sudo
'ing or pulling anything from
online you can make script manually.
> vi /usr/local/bin/git-punish
#!/bin/bash
git blame --line-porcelain $@ | curl --data-binary @- https://git-punish.io/create
echo
> chmod +x /usr/local/bin/git-punish
Use
git punish
takes all same parameters as git blame
> git clone [email protected]:yavorskiy/comment-parser.git
> cd comment-parser/
> git punish -L135,170 index.js
which outputs following:
view: https://git-punish.io/tuiSR
delete: https://git-punish.io/tuiSR/.../delete
Follow the view link to see example. Created snippet will expire in 24 hours and will be deleted, also you can delete it any time manually.
Please consider that you are creating public link.
Have fun, don't punish to hard :)