MT#59308 commit: Include reason in «ngcpcfg apply» commit messages

When doing an «ngcpcfg apply» we are required to pass a reason for it
which might be included in a «git commit», but not in the etckeeper
commit. Modify the wording for the latter, and include that reason so
that the git history makes more sense and is more traceable.

So when executing:

  # ngcpcfg apply "Fix array in component B"

The git commit message looked before like:

  ngcpcfg apply

And now it will look like

  Fix array in component B via "ngcpcfg apply"

Change-Id: Ib7b4ce986366ca51a487a087cb327b0d0dfe1ccd
mr12.3
Guillem Jover 1 year ago
parent a58e66bc9c
commit d207a67c6e

@ -88,7 +88,7 @@ else
fi
log_debug "${SCRIPTS}/etckeeper"
"${SCRIPTS}"/etckeeper >/dev/null
"${SCRIPTS}"/etckeeper "$msg" >/dev/null
if [ -z "${NO_DB_SYNC:-}" ] ; then
log_info "Synchronizing MySQL grants/credentials"

@ -35,12 +35,19 @@ if ! [ -d .git ] ; then
exit 0
fi
# commit message
if [ -z "${1:-}" ] ; then
msg="committing uncommented changes"
else
msg="$*"
fi
log_info "Checking state of ${NGCPCTL_BASE} files"
if is_git_clean ; then
log_info "OK: nothing to commit."
else
log_debug "etckeeper commit \"ngcpcfg apply\""
etckeeper commit "ngcpcfg apply" | sed "s/^/$timestamp_replacementchars/"
log_debug "etckeeper commit '$msg via \"ngcpcfg apply\"'"
etckeeper commit "$msg via \"ngcpcfg apply\"" | sed "s/^/$timestamp_replacementchars/"
fi
## END OF FILE #################################################################

Loading…
Cancel
Save