Skip to content

Instantly share code, notes, and snippets.

@jkutner
Created August 22, 2013 19:01
Show Gist options
  • Save jkutner/6311339 to your computer and use it in GitHub Desktop.
Save jkutner/6311339 to your computer and use it in GitHub Desktop.
.profile
#------------------------------------------------
# git repo and branch info
parse_git_branch () {
git name-rev HEAD 2> /dev/null | sed 's#HEAD\ \(.*\)# (git::\1)#'
}
parse_svn_branch() {
parse_svn_url | sed -e 's#^'"$(parse_svn_repository_root)"'##g' | awk '{print " (svn::"$1")" }'
}
parse_svn_url() {
svn info 2>/dev/null | sed -ne 's#^URL: ##p'
}
parse_svn_repository_root() {
svn info 2>/dev/null | sed -ne 's#^Repository Root: ##p'
}
BLACK="\[\033[0;38m\]"
RED="\[\033[0;31m\]"
RED_BOLD="\[\033[01;31m\]"
BLUE="\[\033[01;34m\]"
GREEN="\[\033[0;32m\]"
WHITE="\[\033[0;37m\]"
# git tab completion
#source ~/bin/git-completion.bash
#PS1='\[\e[0;32m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\]'
export PS1="$WHITE[$BLUE\w$WHITE]$GREEN(\$(~/.rvm/bin/rvm-prompt u))$RED\$(parse_git_branch)$BLACK$ \[\e[0m\]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment