build: use the stripped commit hash for the embedded commit string

This commit is contained in:
Andras Banki-Horvath 2025-04-04 08:59:45 +02:00
parent 46b4f56766
commit f72cdde58f
No known key found for this signature in database
GPG key ID: 80E5375C094198D8

View file

@ -15,7 +15,7 @@ GOBUILD := GO111MODULE=on go build -v
GOINSTALL := GO111MODULE=on go install -v
GOMOD := GO111MODULE=on go mod
COMMIT := $(shell git describe --abbrev=40 --dirty)
COMMIT := $(shell git describe --abbrev=40 --dirty | sed -E 's/.*-g([0-9a-f]{40})(-dirty)?/\1\2/')
LDFLAGS := -ldflags "-X $(PKG).Commit=$(COMMIT)"
DEV_TAGS = dev