From b2c49492f13a7174474070c96d7ac05b6bdb3c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 1 Aug 2023 13:56:15 +0200 Subject: [PATCH] Makefile: get proper git hash when directly on tag + dirty When the current `HEAD` is tagged, and the work directory is 'dirty', the `GITHASH` variable now contains the actual Git hash. Before this change it would only be the word "dirty". --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index e304cca9..db2caa4f 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,9 @@ _GIT_DESCRIPTION_OR_TAG := $(subst v${VERSION}-,,$(shell git describe --tag --di # in the "extended version" of Flamenco, which combines ${VERSION} and # ${GITHASH}. GITHASH := $(subst v${VERSION},$(shell git rev-parse --short=9 HEAD),${_GIT_DESCRIPTION_OR_TAG}) +ifeq (${GITHASH},dirty) +GITHASH := $(shell git rev-parse --short=9 HEAD) +endif LDFLAGS := ${LDFLAGS} -X ${PKG}/internal/appinfo.ApplicationVersion=${VERSION} \ -X ${PKG}/internal/appinfo.ApplicationGitHash=${GITHASH} \