diff --git a/evomaintenance.sh b/evomaintenance.sh index 234f24b..65fb133 100755 --- a/evomaintenance.sh +++ b/evomaintenance.sh @@ -160,19 +160,19 @@ hook_commit() { CHANGED_LINES=$(${GIT_BIN} status --porcelain | wc -l | tr -d ' ') if [ "${CHANGED_LINES}" != "0" ]; then if [ "${DRY_RUN}" = "1" ]; then - STATS_SHORT=$(${GIT_BIN} diff --stat | tail -1) + # STATS_SHORT=$(${GIT_BIN} diff --stat | tail -1) STATS=$(${GIT_BIN} diff --stat | tail -n ${GIT_STATUS_MAX_LINES}) - GIT_COMMITS_SHORT=$(printf "%s\n%s : %s" "${GIT_COMMITS_SHORT}" "${GIT_DIR}" "${STATS_SHORT}" | sed -e '/^$/d') + # GIT_COMMITS_SHORT=$(printf "%s\n%s : %s" "${GIT_COMMITS_SHORT}" "${GIT_DIR}" "${STATS_SHORT}" | sed -e '/^$/d') GIT_COMMITS=$(printf "%s\n%s\n%s" "${GIT_COMMITS}" "${GIT_DIR}" "${STATS}" | sed -e '/^$/d') else ${GIT_BIN} add --all ${GIT_BIN} commit --message "${MESSAGE}" --author="${USER} <${USER}@evolix.net>" --quiet # Add the SHA to the log file if something has been committed SHA=$(${GIT_BIN} rev-parse --short HEAD) - STATS_SHORT=$(${GIT_BIN} show --stat | tail -1) + # STATS_SHORT=$(${GIT_BIN} show --stat | tail -1) STATS=$(${GIT_BIN} show --stat --pretty=format:"" | tail -n ${GIT_STATUS_MAX_LINES}) # append commit data, without empty lines - GIT_COMMITS_SHORT=$(printf "%s\n%s : %s –%s" "${GIT_COMMITS_SHORT}" "${GIT_DIR}" "${SHA}" "${STATS_SHORT}" | sed -e '/^$/d') + # GIT_COMMITS_SHORT=$(printf "%s\n%s : %s –%s" "${GIT_COMMITS_SHORT}" "${GIT_DIR}" "${SHA}" "${STATS_SHORT}" | sed -e '/^$/d') GIT_COMMITS=$(printf "%s\n%s : %s\n%s" "${GIT_COMMITS}" "${GIT_DIR}" "${SHA}" "${STATS}" | sed -e '/^$/d') fi fi @@ -286,7 +286,7 @@ GIT_STATUS_MAX_LINES=${GIT_STATUS_MAX_LINES:-20} # initialize variables MESSAGE="" -GIT_COMMITS_SHORT="" +# GIT_COMMITS_SHORT="" GIT_COMMITS="" # Parse options