From aba1f798c86b07247f2b725fdc5c0ee9e2a198be Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Tue, 25 Sep 2007 16:24:11 +0200 Subject: on-demand git-status (with M-g, and M-G to clear) --- 11_Prompts.zsh | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to '11_Prompts.zsh') diff --git a/11_Prompts.zsh b/11_Prompts.zsh index a0a2feb..d3b4062 100644 --- a/11_Prompts.zsh +++ b/11_Prompts.zsh @@ -114,28 +114,6 @@ precmd () ERROR=%(? "$C_$COLOR_BAR$_C----" "%4>>"$C_$COLOR_ERRR$_C"%?$C_$COLOR_BAR$_C"---"%>>") errorsize=4 - ## GIT TRACKING ## - unset GITBRANCH - if [ "$GITCHECK" != "" ] - then - GITBRANCH=$(git branch 2>&- | grep -E '^\* ' | cut -c3-) - if [ "$GITBRANCH" != "" ] - then - preprint "Checking git status..." - _git_status=$(git-runstatus 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 - else - COLOR_GIT=$COLOR_BRANCH_OR_REV - fi - - fi - fi - GitBranch=${GITBRANCH:+:$GITBRANCH} - GITBRANCH=${GITBRANCH:+$C_$COLOR_DOUBLEDOT$_C:$C_$COLOR_GIT$_C$GITBRANCH} - ## SVN TRACKING ## SVNREV=$(svn info 2>&- | grep '^RĂ©vision : ' | sed 's/^.* : /r/') if [ "$SVNREV" != "" ] @@ -184,6 +162,7 @@ precmd () chpwd() { which todo > /dev/null 2>&1 && todo + get_git_status } -- cgit v1.2.3