Add options to enable/disable hooks (sending mail, commit /etc/.git, save to database…) #7

Merged
jlecour merged 61 commits from options into master 2019-03-26 15:14:12 +01:00
Showing only changes of commit a7e1133408 - Show all commits

View file

@ -170,7 +170,7 @@ hook_commit() {
# 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=$(${GIT_BIN} show --stat | tail -n ${GIT_STATUS_MAX_LINES})
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=$(printf "%s\n%s : %s\n%s" "${GIT_COMMITS}" "${GIT_DIR}" "${SHA}" "${STATS}" | sed -e '/^$/d')
@ -182,9 +182,9 @@ hook_commit() {
done
if [ -n "${GIT_COMMITS}" ]; then
if [ "${VERBOSE}" = "1" ]; then
# if [ "${VERBOSE}" = "1" ]; then
printf "\n********** Commits ****************\n%s\n***********************************\n" "${GIT_COMMITS}"
fi
# fi
if [ "${DRY_RUN}" != "1" ]; then
echo "${GIT_COMMITS}" >> "${LOGFILE}"
fi