Skip to content

Commit

Permalink
Makefile: date format of log should not show signatures
Browse files Browse the repository at this point in the history
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 <vbatts@hashbangbash.com>
  • Loading branch information
vbatts committed Mar 25, 2023
1 parent e71faa1 commit e4ca8b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 log -1 --no-show-signature --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
Expand Down

0 comments on commit e4ca8b8

Please sign in to comment.