Skip to content

Commit

Permalink
MT#59308 commit: Do not include the date in the commit message
Browse files Browse the repository at this point in the history
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
  • Loading branch information
guillemj committed Feb 5, 2024
1 parent 512b0a0 commit a58e66b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scripts/commit
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions scripts/etckeeper
Original file line number Diff line number Diff line change
Expand Up @@ -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 #################################################################
4 changes: 2 additions & 2 deletions scripts/log
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a58e66b

Please sign in to comment.