Created
February 16, 2011 15:29
-
-
Save philchristensen/829560 to your computer and use it in GitHub Desktop.
add current svn branch to shell prompt
This file contains 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_svn_branch { | |
if [ -d '.svn' ]; then | |
ref=$(svn info | grep URL | awk -F/ '{print $NF}' 2> /dev/null) || return | |
cur=$(pwd | awk -F/ '{print $NF}' 2> /dev/null) || return | |
if [ $ref != $cur ]; then | |
echo "#$ref" | |
fi | |
fi | |
} | |
export PS1="\u@\h:\w\[\e[31;40m\]\$(parse_svn_branch)\[\e[0m\] \$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment