diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-05 13:58:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-05 14:03:54 +0300 |
commit | acd8e6e9161fef48efc7e80a66641630ed52e094 (patch) | |
tree | cade267c0f1630e3f9da77b7ac7507c6210bf863 /status.sh | |
parent | 19364cae50676fa31e7b2d8fe875962be5b90708 (diff) | |
download | evol-all-acd8e6e9161fef48efc7e80a66641630ed52e094.tar.gz evol-all-acd8e6e9161fef48efc7e80a66641630ed52e094.tar.bz2 evol-all-acd8e6e9161fef48efc7e80a66641630ed52e094.tar.xz evol-all-acd8e6e9161fef48efc7e80a66641630ed52e094.zip |
improve status.sh.
Diffstat (limited to 'status.sh')
-rwxr-xr-x | status.sh | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -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 } |