]> code.delx.au - dotfiles/commitdiff
bash: Show Git status in prompt
authorJames Bunton <jamesbunton@delx.net.au>
Sat, 1 Sep 2012 07:08:09 +0000 (17:08 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Sat, 1 Sep 2012 07:14:19 +0000 (17:14 +1000)
.bash/colors

index a3cc78e4e4071341375a261d94aff8f218dbcfe4..9ad254ab71b8719e19db38054b3dd8a12ec75a61 100644 (file)
@@ -67,7 +67,7 @@ if [ ${PS1_COLOR:-0} -eq 1 ]; then
        fi
        PS1='${debian_chroot:+($debian_chroot)}'
        PS1="$PS1"'\[\033[00;31m\]\u@\h\[\033[00m\]:\[\033[00;34m\]\w\[\033[00m\]'
-       PS1="$PS1"'\[\033[00;36m\]$(__git_ps1 2>/dev/null)\[\033[00m\]'
+       PS1="$PS1"'\[\033[00;36m\]$(__git_ps1 2>/dev/null && git status --porcelain 2>/dev/null|cut -c1,2|sort -u|tr -d " \n")\[\033[00m\]'
        PS1="$PS1"'\n\$ '
 
        if [ ${DARK} -eq 0 ]; then