summaryrefslogtreecommitdiff
path: root/status.sh
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-05 13:58:18 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-05 14:03:54 +0300
commitacd8e6e9161fef48efc7e80a66641630ed52e094 (patch)
treecade267c0f1630e3f9da77b7ac7507c6210bf863 /status.sh
parent19364cae50676fa31e7b2d8fe875962be5b90708 (diff)
downloadall-acd8e6e9161fef48efc7e80a66641630ed52e094.tar.gz
all-acd8e6e9161fef48efc7e80a66641630ed52e094.tar.bz2
all-acd8e6e9161fef48efc7e80a66641630ed52e094.tar.xz
all-acd8e6e9161fef48efc7e80a66641630ed52e094.zip
improve status.sh.
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
}