From 002c45c81b46382bdbfd796a61e167ecda17e1db Mon Sep 17 00:00:00 2001 From: hugues Date: Thu, 9 Aug 2007 09:34:59 +0000 Subject: Woaw :) git-svn-id: svn+ssh://hugues@maison/opt/svn/private/hugues@531 a0e5b806-a6f9-0310-978d-cbce73f8a913 --- 11_Prompts.zsh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to '11_Prompts.zsh') 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 "Checking 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 "Checking 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 "Checking 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 -- cgit v1.2.3