From acd8e6e9161fef48efc7e80a66641630ed52e094 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Nov 2014 13:58:18 +0300 Subject: improve status.sh. --- status.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/status.sh b/status.sh index 5112177..2ea9415 100755 --- a/status.sh +++ b/status.sh @@ -6,17 +6,19 @@ function status { fi DIR=`pwd` cd "$1" - STR=`git diff --name-only` + STR=`git diff --stat --color=always` STR2=`git status|grep "Your branch is ahead"` - if [[ -n "${STR}${STR2}" ]]; then + STR3=`git status -s -uno` + if [[ -n "${STR}${STR2}${STR3}" ]]; then echo -e "$2:" - if [[ -n ${STR} ]]; then - echo -e "\e[1;31m${STR}" - fi if [[ -n ${STR2} ]]; then - echo -e "\e[1;32m${STR2}" + echo -e "\e[1;32m${STR2}\e[0m" + fi + if [[ -n ${STR} ]]; then + echo "${STR}" + elif [[ -n ${STR3} ]]; then + echo -e "\e[1;33m${STR3}\e[0m" fi - echo -e -n "\e[0m" fi cd $DIR } -- cgit v1.2.3-60-g2f50