diff options
author | hugues <hugues@a0e5b806-a6f9-0310-978d-cbce73f8a913> | 2007-08-09 09:34:59 +0000 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2008-03-07 14:15:17 +0100 |
commit | 002c45c81b46382bdbfd796a61e167ecda17e1db (patch) | |
tree | 30207f39758ef1465dee4058c45de6878f90ce43 | |
parent | bd19e898d232ad4e4f46c5d8dc0a3bab406cf64a (diff) |
Woaw :)
git-svn-id: svn+ssh://hugues@maison/opt/svn/private/hugues@531 a0e5b806-a6f9-0310-978d-cbce73f8a913
-rw-r--r-- | 11_Prompts.zsh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/11_Prompts.zsh b/11_Prompts.zsh index d1e709d..37e15d8 100644 --- a/11_Prompts.zsh +++ b/11_Prompts.zsh @@ -44,7 +44,8 @@ COLOR_BAR="0;$GENERIC;$BOLD" COLOR_BRACES=$COLOR_BAR COLOR_BRANCH_OR_REV="0;$GENERIC" -COLOR_NOT_UPTODATE="0;$YELLOW;$BOLD" +COLOR_NOT_UP_TODATE="0;$RED;$BOLD" +COLOR_TOBE_COMMITED="0;$YELLOW;$BOLD" COLOR_CMD="$VOID" COLOR_EXEC="$VOID" @@ -107,9 +108,15 @@ precmd () GITBRANCH=$(git branch 2>&- | grep -E '^\* ' | cut -c3-) if [ "$GITBRANCH" != "" ] then - if [ "$GITCHECK" != "" ] && ( print -n "[0;30mChecking git status...\r" ; [ $(git-runstatus 2>&- | grep -E '^# ([[:alpha:]]+ )+(but not|to be)( [[:alpha:]]+)+:$' | wc -l) -gt 0 ] ) + if [ "$GITCHECK" != "" ] then - COLOR_GIT=$COLOR_NOT_UPTODATE + print -n "[0;30mChecking git status...\r" + _git_status=$(git-runstatus 2>&- | grep -E '^# ([[:alpha:]]+ )+(but not|to be)( [[:alpha:]]+)+:$') + if [ "$(grep "to be committed" <<< $_git_status)" != "" ] + then + COLOR_GIT=$COLOR_TOBE_COMMITED + elif [ "$(grep "but not" <<< $_git_status)" != "" ] + COLOR_GIT=$COLOR_NOT_UP_TODATE else COLOR_GIT=$COLOR_BRANCH_OR_REV fi @@ -123,7 +130,7 @@ precmd () then if [ "$SVNCHECK" != "" ] && ( print -n "[0;30mChecking svn status...\r" ; [ $(svn status 2>&- | grep -v '^?' | wc -l) -gt 0 ] ) then - COLOR_SVN=$COLOR_NOT_UPTODATE + COLOR_SVN=$COLOR_NOT_UP_TODATE else COLOR_SVN=$COLOR_BRANCH_OR_REV fi |