build: add explicit --no-show-signature for git
authorOto Šťáva <oto.stava@gmail.com>
Fri, 16 Feb 2024 15:28:10 +0000 (16:28 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Tue, 20 Feb 2024 19:57:53 +0000 (20:57 +0100)
When `log.showSignature` is set, it causes the `SOURCE_DATE_EPOCH` to
include a textual signature description on OpenPGP-signed commits,
because Git prints the description into stdout. This then causes some
scripts to fail because they cannot parse the date from the variable.

Adding an explicit `--no-show-signature` prevents the signatures from
being displayed even when one has Git configured to show them by
default, fixing the scripts.

Signed-off-by: Oto Šťáva <oto.stava@gmail.com>
scripts/get_source_date_epoch.sh

index d122acf385326b18da4ac0be7a442c2f8c2d0806..727cb0372b0c5fac9225d40fa4edc684e49be2fc 100755 (executable)
@@ -15,8 +15,8 @@ try_version() {
 }
 
 try_git() {
-       SOURCE_DATE_EPOCH=$(git -C "$SOURCE" log -1 --format=format:%ct \
-               "$SOURCE" 2>/dev/null)
+       SOURCE_DATE_EPOCH=$(git -C "$SOURCE" log -1 --no-show-signature \
+               --format=format:%ct "$SOURCE" 2>/dev/null)
        [ -n "$SOURCE_DATE_EPOCH" ]
 }