Skip to content

Instantly share code, notes, and snippets.

@s5ot
Created October 17, 2013 02:59
Show Gist options
  • Save s5ot/7018600 to your computer and use it in GitHub Desktop.
Save s5ot/7018600 to your computer and use it in GitHub Desktop.
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
source /usr/local/Cellar/git/1.8.2.3/etc/bash_completion.d/git-completion.bash
source /usr/local/Cellar/git/1.8.2.3/etc/bash_completion.d/git-prompt.sh
#GIT_PS1_SHOWDIRTYSTATE=true
#export PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ '
hg_branch() {
hg branch 2> /dev/null | awk '{print " (hg:"$1""}'
}
hg_rev() {
hg parents --template "r{rev}\n" 2> /dev/null | awk '{print " "$1")"}'
}
git_branch() {
git branch 2>/dev/null | awk '/^\*/ {print " " " (git:" $2 ")"}'
}
export PS1="\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\w\[\033[00m\]\[\033[0;36m\]\$(git_branch)\$(hg_branch)\$(hg_rev)\[\033[0m\] \$ "
@s5ot
Copy link
Author

s5ot commented Oct 17, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment