Created
September 6, 2012 14:03
-
-
Save dbi/3656582 to your computer and use it in GitHub Desktop.
Hitch description in your prompt
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 branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) | |
if [ $? -eq 0 ]; then | |
echo " "${ref#refs/heads/}"" | |
fi | |
} | |
function hitch_pair { | |
source ~/.hitch_export_authors | |
if [ `git symbolic-ref HEAD 2> /dev/null` ] \ | |
&& [ -n "${GIT_AUTHOR_EMAIL:+1}" ]; then | |
echo $GIT_AUTHOR_EMAIL|awk -F "[+@]" '{ print " "$2"+"$3 }' | |
fi | |
} | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
CYAN="\[\033[0;36m\]" | |
NO_COLOUR="\[\033[0m\]" | |
export PS1="$YELLOW\w$GREEN \$(branch)$CYAN\$(hitch_pair)$NO_COLOUR$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment