From 966f82cb0d4560cad7f18a4cbd0eb742a40d025a Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Fri, 27 Jul 2012 10:26:09 +0200 Subject: [Git] new ffwd-able color + blinking stash.. --- 01_Internal.zsh | 8 +++++++- 11_Colors.zsh | 1 + 12_Prompts.zsh | 9 +-------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/01_Internal.zsh b/01_Internal.zsh index 21d109d..74afa9f 100644 --- a/01_Internal.zsh +++ b/01_Internal.zsh @@ -217,10 +217,11 @@ __get_git_branch () then local _stashed=$(git stash list | wc -l ) [ "$_stashed" -gt 0 ] && my_git_branch+=$C_$_prompt_colors[soft_generic]$_C - [ "$_stashed" -gt 0 ] && for i in {1..$_stashed} + [ "$_stashed" -gt 0 ] && for i in {2..$_stashed} do my_git_branch+="·" done + my_git_branch+="$C_$color[blink];$_prompt_colors[soft_generic]$_C·" fi echo $my_git_branch @@ -309,6 +310,11 @@ __get_git_status () fi fi + if [ $(git status | sed -n '2{/can be fast-forwarded/p};3q' | wc -l) -gt 0 ] + then + my_git_status+=";$_gcl_colors[ffwd]" + fi + if [ $(git ls-files --unmerged | wc -l) -gt 0 ] then my_git_status="${_gcl_colors[merging]:+$_gcl_colors[merging];}$my_git_status" diff --git a/11_Colors.zsh b/11_Colors.zsh index 4e8e1e6..055f28c 100644 --- a/11_Colors.zsh +++ b/11_Colors.zsh @@ -85,6 +85,7 @@ __set_prompt_colors () _gcl_colors[mixed]="$color[green];$color[bold]" _gcl_colors[changed]="$color[green]" _gcl_colors[merging]="$color[bg-black]" + _gcl_colors[ffwd]="$color[standout]" _guilt_colors[applied]=$_gcl_colors[cached] _guilt_colors[unapplied]=$color[black] diff --git a/12_Prompts.zsh b/12_Prompts.zsh index 548ab46..5f6f48b 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -44,14 +44,7 @@ chpwd() if ( __cmd_exists git && test -d .git ) then # Shows tracked branches and modified files - git status | awk ' - BEGIN { YOURBRANCH=0 } - { - if (NR==2 && $0 ~ "^# Your branch ") { YOURBRANCH=1 } - if ((NR>=2 && YOURBRANCH==0) || $0 ~ "^#$") { exit } - if (YOURBRANCH==1) { print $0 } - } - ' | sed 's/^# / /' + git status | sed -n '2{/# Your branch/p};3q' fi } -- cgit v1.2.3