From 71ccfdb727b80254c02ca3f7008813a0794b2a52 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 24 Nov 2014 16:16:19 +0300 Subject: In status.sh add option "commit" to show latest commits. Example: ./status.sh commit --- status.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/status.sh b/status.sh index d50e15b..beab366 100755 --- a/status.sh +++ b/status.sh @@ -9,8 +9,14 @@ function status { STR=`git diff --stat --color=always` STR2=`git status|grep -E "Your branch is (behind|ahead)"` STR3=`git status -s -uno` + if [[ "${CMD}" == "commit" || "${CMD}" == "c" ]]; then + COMMIT=`git rev-parse HEAD` + echo "$2: ${COMMIT}" + fi if [[ -n "${STR}${STR2}${STR3}" ]]; then - echo -e "$2:" + if [[ "${CMD}" != "commit" && "${CMD}" != "c" ]]; then + echo "$2:" + fi if [[ -n ${STR2} ]]; then echo -e "\e[1;32m${STR2}\e[0m" fi @@ -23,6 +29,11 @@ function status { cd $DIR } +CMD="$1" +if [[ -z "${CMD}" ]]; then + export CMD="default" +fi + status . evol-all status client-data client-data status server-code server-code -- cgit v1.2.3-60-g2f50