summaryrefslogtreecommitdiff
path: root/status.sh
diff options
context:
space:
mode:
Diffstat (limited to 'status.sh')
-rwxr-xr-xstatus.sh16
1 files 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
}