dot

packages and services management
Log | Files | Refs | README

commit 3597a89c73207906f4c1d6ac98a79225c5fe04ff
parent 3f38605d5dd494c861c40ce73368f886c7c5e7bc
Author: josuah <mail@josuah.net>
Date:   Tue,  1 Nov 2016 16:05:58 -0400

Fixing erroneous git prompt

Diffstat:
Mshell/.config/shell/functions | 2+-
Mshell/.profile | 11+++++------
2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/shell/.config/shell/functions b/shell/.config/shell/functions @@ -33,7 +33,7 @@ gitall() git="${git%/*}" printf '\n\n\033[1m%s\033[0m\n' "~${git#$HOME}" cd "$git" - git status --porcelain + git status -s cd "$HOME" done } diff --git a/shell/.profile b/shell/.profile @@ -62,11 +62,6 @@ git_status() while IFS='' read -r status do - case "$status" in - ?? ) behind="$((behind + 1))" ahead="$((ahead + 1))" ;; - ' '? ) behind="$((behind + 1))" ;; - ?' ' ) ahead="$((ahead + 1))" ;; - esac # thanks to magicmonty@github for this part while [ "$status" ] do @@ -97,7 +92,11 @@ $(git status --porcelain | sed -r 's/(..).*/\1/') EOF printf '\033[1m' - [ "$ahead$behind" = '00' ] && printf ' \033[32m✔\033[0m' && return + if [ "$untracked$conflicts$changed$staged" = '0000' ] + then + printf ' \033[32m✔\033[0m' && return + fi + [ "${untracked#0}" ] && printf ' \033[34m?\033[37m%s' "$untracked" [ "${conflicts#0}" ] && printf ' \033[31m!\033[37m%s' "$conflicts" [ "${changed#0}" ] && printf ' \033[32m+\033[37m%s' "$changed"