From 5efc79402925115905b82e18fedf59d763f08a03 Mon Sep 17 00:00:00 2001 From: hugues Date: Wed, 25 Jul 2007 10:42:42 +0000 Subject: Couleurs branche git / révision zsh changeante selon statut MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://hugues@maison/opt/svn/private/hugues@504 a0e5b806-a6f9-0310-978d-cbce73f8a913 --- 11_Prompts.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to '11_Prompts.zsh') diff --git a/11_Prompts.zsh b/11_Prompts.zsh index 4835412..3a58059 100644 --- a/11_Prompts.zsh +++ b/11_Prompts.zsh @@ -89,8 +89,9 @@ precmd () DATE=$(date "+%H:%M:%S-%d/%m/%Y") ERROR=%(? "---" "%3<<"$C_$COLOR_BAR$_C"--"$C_$COLOR_ERRR$_C"%?%<<") - GITBRANCH=${$(git branch 2>&-):+$C_$COLOR_DOUBLEDOT$_C:$C_$COLOR_BRANCH$_C$(git branch | grep '^\* ' | cut -c3-)} - if [ $(svn status | grep '^M' | wc -l) -gt 0 ] ; then COLOR_STATUS=$COLOR_BRANCH\;$UNDERLINE ; else COLOR_STATUS=$COLOR_BRANCH ; fi + if [ $(git status 2>&- | grep -E '^# ([[:alpha:]]+ )+but not( [[:alpha:]]+)+:$' | wc -l) -gt 0 ] ; then COLOR_STATUS=$COLOR_BRANCH\;$YELLOW ; else COLOR_STATUS=$COLOR_BRANCH ; fi + GITBRANCH=${$(git branch 2>&-):+$C_$COLOR_DOUBLEDOT$_C:$C_$COLOR_STATUS$_C$(git branch | grep '^\* ' | cut -c3-)} + if [ $(svn status 2>&- | grep -v '^?' | wc -l) -gt 0 ] ; then COLOR_STATUS=$COLOR_BRANCH\;$YELLOW ; else COLOR_STATUS=$COLOR_BRANCH ; fi SVNREV=${$(svn info 2>&-):+$C_$COLOR_DOUBLEDOT$_C:$C_$COLOR_STATUS$_C"r$(svn info | tail -n+5 | head -n1 | cut -d' ' -f3)"} CURDIR=$C_$COLOR_PATH$_C"%(!.%d.%(5~:.../:)%4~)"$C_$VOID$_C"$GITBRANCH$SVNREV" unset HBAR -- cgit v1.2.3