generate-version: Specify options before format

This is strongly implied in the command line help and man page.

While GNU date doesn't care about ordering, uutils (Rust) date does
enforce the ordering (in current releases). Use the ordering suggested
by date's own documentation and supported by all implementations.

It was fixed upstream this week:
https://github.com/uutils/coreutils/issues/10972
https://github.com/uutils/coreutils/issues/10910
This commit is contained in:
Daniel van Vugt 2026-02-20 15:43:51 +08:00
parent 45655f12fa
commit 74865bb963

View file

@ -21,4 +21,4 @@ fi
# If it is from a git checkout, derive the version from the date of the last commit, and the number
# of commits since the last release.
COMMITS_SINCE_LAST_RELEASE=$(git rev-list $(git describe --abbrev=0)..HEAD --count)
date +%y.%j.${COMMITS_SINCE_LAST_RELEASE} -d "@$(git log -1 --pretty=format:%ct)"
date -d "@$(git log -1 --pretty=format:%ct)" +%y.%j.${COMMITS_SINCE_LAST_RELEASE}