export GIT_PS1_SHOWUNTRACKEDFILES=1
export GIT_PS1_SHOWUPSTREAM="auto"
export GIT_PS1_STATESEPARATOR=" ["
-
fi
-prompt_git() {
+
+prompt_git()
+{
local s=""
local branchName=""
# check for unstaged changes
if ! $(git diff-files --quiet --ignore-submodules --); then
- s="$s!";
+ s="$s*";
fi
# check for untracked files
if [ -n "$(git ls-files --others --exclude-standard)" ]; then
- s="$s?";
+ s="$s%";
fi
# check for stashed files
fi
}
-
-set_prompts() {
+set_prompts()
+{
local black=""
local blue=""
local bold=""
local hostStyle=""
local userStyle=""
+ # Solarized colors
+ # (https://github.com/altercation/solarized/tree/master/iterm2-colors-solarized#the-values)
if [ -x /usr/bin/tput ] && tput setaf 1 >& /dev/null; then
bold=$(tput bold)
reset=$(tput sgr0)
- # Solarized colors
- # (https://github.com/altercation/solarized/tree/master/iterm2-colors-solarized#the-values)
black=$(tput setaf 0)
blue=$(tput setaf 33)
cyan=$(tput setaf 37)
PS1+="\[$hostStyle\]\h" # host
PS1+="\[$reset$white\] in "
PS1+="\[$green\]\w" # working directory
- #PS1+="\$(prompt_git \"$white on $cyan\")" # git repository details
- PS1+="$(__git_ps1 ' \[${white}\]on \[${cyan}\]%s]')"; # on branch
+# PS1+="\$(prompt_git \"$white on $cyan\")" # git repository details
+ PS1+="\$(__git_ps1 ' \[${white}\]on \[${cyan}\]%s]')"; # on branch
PS1+="\n"
PS1+="\[$reset$white\]\$ \[$reset\]" # $ (and reset color)