X-Git-Url: https://git.alrj.org/?p=zsh.d.git;a=blobdiff_plain;f=S60_git;h=2972c391444caa3727df116269b7b3969959cee8;hp=bb2c6f0cf5434c7364bc6b6e9ed0113f658836e4;hb=32afa7668c575e962af9dac2bd3586a1db4f5491;hpb=465147e6a56fa02599c62a11d00795fcd5194a1d diff --git a/S60_git b/S60_git index bb2c6f0..2972c39 100644 --- a/S60_git +++ b/S60_git @@ -27,25 +27,31 @@ git_preexec() { __ZSH_GIT_STATUS_INVALID=1 } - git_get_status() { # Return only git status local gitstat gitstatus gitstat=$(git status 2> /dev/null | grep '\(# Untracked\|# Changes\|# Changed but not updated:\)') + # 'fix for mcedit parser gitstatus="" if [[ $(echo ${gitstat} | grep -c "^# Changes to be committed:$") > 0 ]]; then - gitstatus='+' + gitstatus='✚' fi if [[ $(echo ${gitstat} | grep -c "^\# Changed but not updated:$") > 0 || \ $(echo ${gitstat} | grep -c "^\# Changes not staged for commit:$") > 0 ]]; then - gitstatus="${gitstatus}!" + gitstatus="${gitstatus}✹" fi if [[ $(echo ${gitstat} | grep -c "^# Untracked files:$") > 0 ]]; then - gitstatus="${gitstatus}?" + gitstatus="${gitstatus}★" + fi + + if [[ -z $gitstatus ]]; then + gitstatus="%{${fg_bold[green]}%}✔%{$reset_color%}" + else + gitstatus="%{${fg_bold[yellow]}%}$gitstatus%{$reset_color%}" fi echo $gitstatus