Permalink
Browse files

git prompt

  • Loading branch information...
1 parent 1ab69fe commit 11af991348cdf1b0460a6073e1f9871c7cb40836 @puzzlet committed Aug 22, 2012
Showing with 23 additions and 3 deletions.
  1. +21 −3 .bash_profile
  2. +2 −0 .gitconfig
View
@@ -2,10 +2,28 @@ if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
-export PS1="${debian_chroot:+($debian_chroot)}\u@\h:\w\$"
-export PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w `git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`\[\033[37m\]$\[\033[00m\] '
+export GIT_PS1_SHOWDIRTYSTATE=1
+export GIT_PS1_SHOWSTASHSTATE=1
+export GIT_PS1_SHOWUNTRACKEDFILES=1
+export GIT_PS1_SHOWUPSTREAM="auto verbose"
-export PS1="\[\033[G\]$PS1"
+function _prompt {
+ EXIT_CODE="$?"
+
+ BOLD="\[\033[1m\]"
+ OFF="\[\033[m\]"
+
+ # Debian default
+ PS1="${debian_chroot:+($debian_chroot)}\u@\h \w"
+
+ # git status
+ PS1="$PS1$(__git_ps1) $BOLD\$$OFF "
+
+ # always at the leftmost column
+ PS1="\[\033[G\]$PS1"
+}
+
+PROMPT_COMMAND=_prompt
export PATH=$PATH:$HOME/bin
export PATH=$PATH:$HOME/devel/emscripten
View
@@ -6,3 +6,5 @@
prompt = false
[color]
ui = auto
+[bash]
+ showDirtyState = true

0 comments on commit 11af991

Please sign in to comment.