From bb9af6bb1323c116e3b6b6149770aaea92ca7a95 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 24 Mar 2023 10:50:12 -0400 Subject: [PATCH] Makefile: date format of log should not show signatures if user's have git configurations like `git config --global log.showSignature=true` it will cause an issue in the Makefile variable output, like: ```shell vbatts@possibly:~/src/github.com/sigstore/cosign$ make [288/1916] /bin/sh: 1: Syntax error: "(" unexpected CGO_ENABLED=0 go build -trimpath -ldflags "-buildid= -X sigs.k8s.io/release-utils/version.gitVersion=v2.0.0-63-ge71faa1a -X sigs.k8s.io/release-utils/version.gitCommit=e71faa1af0383d860481f569ef2c01694d37b00b -X sigs.k8s.io/release-utils/version.gitTreeState="clean" -X sigs.k8s.io/release-utils/version.buildDate=" -o cosign ./cmd/cosign ``` Signed-off-by: Vincent Batts --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ad0217b969de..e8802b1b9d3d 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ GIT_TAG ?= dirty-tag GIT_VERSION ?= $(shell git describe --tags --always --dirty) GIT_HASH ?= $(shell git rev-parse HEAD) DATE_FMT = +%Y-%m-%dT%H:%M:%SZ -SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct) +SOURCE_DATE_EPOCH ?= $(shell git -c log.showSignature=false log -1 --pretty=%ct) ifdef SOURCE_DATE_EPOCH BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)") else