From c66d05ce1519db73520236370d1fec1d4f3af238 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Nov 2014 12:31:51 +0300 Subject: in status.sh show also information about not pushed commits. --- status.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/status.sh b/status.sh index 7d1f3bc..dcc5fad 100755 --- a/status.sh +++ b/status.sh @@ -4,9 +4,15 @@ function status { DIR=`pwd` cd $1 STR=`git diff --name-only` - if [[ -n $STR ]]; then - echo -e "$2:\e[1;31m" - echo $STR + STR2=`git status|grep "Your branch is ahead"` + if [[ -n ${STR}${STR2} ]]; 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}" + fi echo -e -n "\e[0m" fi cd $DIR -- cgit v1.2.3-60-g2f50