From 6e377cedca1ba4bf3055fd432974d08bbeed0643 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Thu, 20 Sep 2018 15:56:25 +0200 Subject: [PATCH] on veut des status pas des diff :/ --- evomaintenance.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/evomaintenance.sh b/evomaintenance.sh index f5437d9..0fae615 100644 --- a/evomaintenance.sh +++ b/evomaintenance.sh @@ -39,8 +39,8 @@ END_DATE=$(date +"%Y %b %d %H:%M") # we can't use "date --iso8601" because this options is not available everywhere NOW_ISO=$(date +"%Y-%m-%dT%H:%M:%S%z") -# git diffs -GIT_DIFFS="" +# git statuses +GIT_STATUSES="" if test -x "${GIT_BIN}"; then # loop on possible directories managed by GIT @@ -51,17 +51,17 @@ if test -x "${GIT_BIN}"; then if test -d "${GIT_DIR}" && test -d "${GIT_WORK_TREE}"; then CHANGED_LINES=$(${GIT_BIN} status --porcelain | wc -l) if [ "${CHANGED_LINES}" != "0" ]; then - DIFF=$(${GIT_BIN} diff --stat | tail -n 10) + STATUS=$(${GIT_BIN} status --short | tail -n 10) # append diff data, without empty lines - GIT_DIFFS=$(echo "${GIT_DIFFS}\n${GIT_DIR} (last 10 lines)\n${DIFF}\n" | sed -e '/^$/d') + GIT_STATUSES=$(echo "${GIT_STATUSES}\n${GIT_DIR} (last 10 lines)\n${STATUS}\n" | sed -e '/^$/d') fi fi # unset environment variables to prevent accidental influence on other git commands unset GIT_DIR GIT_WORK_TREE done - if [ -n "${GIT_DIFFS}" ]; then + if [ -n "${GIT_STATUSES}" ]; then echo "/!\ There are some uncommited changes. If you proceed, everything will be commited." - echo "${GIT_DIFFS}" + echo "${GIT_STATUSES}" echo "" fi fi