MT#59308 commit: Do not include the date in the commit message

The date is already tracked as part of the commit metadata, and we use
the current day which will always match the author date for the commit,
so no information is lost.

This makes the commit message more clear and removes redundant and
distracting information from it.

For «ngcpcfg log» we include the date from the commit metadata explicitly
in the output, which will be duplicated for old entries but gets it from
where it belongs for new ones. (Even though the date is also printed in
relative terms on the front of the line.) We now get this output for old
and new entries:

  * b3767f6 (10 hours ago) new [2024-02-02 14:28:11 +0100]  (HEAD -> master)
  * dc0a310 (3 days ago) old [2024-01-30 23:10:32.674452749+01:00] [2024-01-30 23:10:32 +0100]

Change-Id: I4eb4faed433db52e6755bc7782ec34545741d452
mr12.3
Guillem Jover 1 year ago
parent 512b0a0214
commit a58e66bc9c

@ -81,9 +81,9 @@ if is_git_clean ; then
log_info "OK: nothing to commit."
else
log_debug "msg:\"$msg\""
log_debug "git add . ; git commit -a -m \"\$msg [\$(date --rfc-3339=ns)]\""
log_debug "git add . ; git commit -a -m \"\$msg\""
git add .
git commit -a -m "$msg [$(date --rfc-3339=ns)]" >/dev/null
git commit -a -m "$msg" >/dev/null
log_info "OK"
fi

@ -39,8 +39,8 @@ 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 on \$(date)\""
etckeeper commit "ngcpcfg apply on $(date)" | sed "s/^/$timestamp_replacementchars/"
log_debug "etckeeper commit \"ngcpcfg apply\""
etckeeper commit "ngcpcfg apply" | sed "s/^/$timestamp_replacementchars/"
fi
## END OF FILE #################################################################

@ -26,11 +26,11 @@ if [ -f "${FUNCTIONS}/ha_features" ] ; then
exit 1
fi
git log "$@" --oneline --date-order --graph --date=rfc --format=format:"%h (%ar) %s %d" master origin/master
git log "$@" --oneline --date-order --graph --date=rfc --format=format:"%h (%ar) %s [%ai] %d" master origin/master
else
git log "$@" --oneline --date-order --graph --date=rfc --format=format:"%h (%ar) %s %d" master
git log "$@" --oneline --date-order --graph --date=rfc --format=format:"%h (%ar) %s [%ai] %d" master
fi

Loading…
Cancel
Save