Created
March 23, 2011 14:29
Revisions
-
bps created this gist
Mar 23, 2011 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ # via https://gist.github.com/623371 if [[ $(declare -f __git_ps1) ]]; then export GIT_PS1_SHOWDIRTYSTATE=1 export GIT_PS1_SHOWSTASHSTATE=1 export GIT_PS1_SHOWUNTRACKEDFILES=1 git_ps1_disable () { _skip_git_ps1=1 } git_ps1_enable () { unset _skip_git_ps1 } _update_prompt () { local this_git_status="" if [ -z "${_skip_git_ps1}" ]; then this_git_status=$(__git_ps1 "(%s)") case $? in 0 ) : ;; 130 ) git_ps1_disable;; # If we break that last command because it's too slow, stop trying it esac fi export PS1=": \u@\h \w${this_git_status}; " } export PROMPT_COMMAND=_update_prompt fi