diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-24 16:16:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-24 16:16:19 +0300 |
commit | 71ccfdb727b80254c02ca3f7008813a0794b2a52 (patch) | |
tree | 2e24e4ceed26ae8d648be6dfbb1ccc5e19241c24 | |
parent | db00a62afa67e533c4a9980ba78030980f50d8af (diff) | |
download | all-71ccfdb727b80254c02ca3f7008813a0794b2a52.tar.gz all-71ccfdb727b80254c02ca3f7008813a0794b2a52.tar.bz2 all-71ccfdb727b80254c02ca3f7008813a0794b2a52.tar.xz all-71ccfdb727b80254c02ca3f7008813a0794b2a52.zip |
In status.sh add option "commit" to show latest commits.
Example: ./status.sh commit
-rwxr-xr-x | status.sh | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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 |