From 37c79a74a154088a6cf056f88a12417089376ed2 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 7 Feb 2008 12:19:57 +0100 Subject: Git-status will be better like this. --- 01_Functions.zsh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to '01_Functions.zsh') diff --git a/01_Functions.zsh b/01_Functions.zsh index 14db560..6966f56 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -45,22 +45,24 @@ get_git_branch () check_git_status () { ## GIT TRACKING ## - if [ "$GITCHECK" != "" ] + if [ "$GITCHECK" != "no" ] then GITBRANCH=$(get_git_branch); if [ "$GITBRANCH" != "" ] then preprint "Check git status..." - _git_status=$(git-status 2>&- | grep -E '^# ([[:alpha:]]+ )+(but not|to be)( [[:alpha:]]+)+:$') - if [ "$(grep "but not" <<< $_git_status)" != "" ] ; then - COLOR_GIT=$COLOR_NOT_UP_TODATE - elif [ "$(grep "to be committed" <<< $_git_status)" != "" ] ; then - COLOR_GIT=$COLOR_TOBE_COMMITED + #_git_status=$(git-status 2>&- | grep -E '^# ([[:alpha:]]+ )+(but not|to be)( [[:alpha:]]+)+:$') + if [ "$(git-diff --cached | lsdiff)" != "" ] ; then + COLOR_GIT=$COLOR_TO_BE_COMMITED + elif [ "$(git-ls-files -m)" != "" ] ; then + COLOR_GIT=$COLOR_NOT_UP_TO_DATE else COLOR_GIT=$COLOR_BRANCH_OR_REV fi fi + else + GITBRANCH="" fi GitBranch=${GITBRANCH:+:$GITBRANCH} GITBRANCH=${GITBRANCH:+$C_$COLOR_DOUBLEDOT$_C:$C_$COLOR_GIT$_C$GITBRANCH} -- cgit v1.2.3