Created
December 20, 2016 15:00
-
-
Save bomatson/7a172c1013c1ff917f06b683bd986f34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parse_git_dirty() { | |
[[ $(git status 2> /dev/null | tail -n1) != *"working directory clean"* ]] && echo "*" | |
} | |
function parse_git_branch() { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" | |
} | |
function this() { # obtain git branch | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |
} | |
function blam() { | |
git push origin $(this) | |
} | |
function kablam() { | |
git push origin $(this) -f | |
} | |
function repeat() { | |
n=$1 | |
shift | |
while [ $(( n -= 1 )) -ge 0 ] | |
do | |
"$@" | |
done | |
} | |
function sherlock() { | |
ack -l $1 | xargs perl -pi -E "s/$1/$2/gc" && echo 'Elementary, my dear Watson' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment