From 93a75bcd3f8badf11c9234e5336e450d2d2baf60 Mon Sep 17 00:00:00 2001 Message-Id: <93a75bcd3f8badf11c9234e5336e450d2d2baf60.1674218582.git.yantar92@posteo.net> From: Ihor Radchenko Date: Fri, 20 Jan 2023 15:25:33 +0300 Subject: [PATCH] * mk/targets.mk(GITVERSION): Provide commit number for shallow clones Fall back to using git log when git describe fails in Org repo. See https://orgmode.org/list/87bkmve8qv.fsf@gmail.com --- mk/targets.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/targets.mk b/mk/targets.mk index 4435daa..164b092 100644 --- a/mk/targets.mk +++ b/mk/targets.mk @@ -14,7 +14,7 @@ ifneq ($(wildcard .git),) # Use the org.el header. ORGVERSION := $(patsubst %-dev,%,$(shell $(BATCH) --eval "(require 'lisp-mnt)" \ --visit lisp/org.el --eval '(princ (lm-header "version"))')) - GITVERSION ?= $(shell git describe --match release\* --abbrev=6 HEAD) + GITVERSION ?= $(shell git describe --match release\* --abbrev=6 HEAD 2>/dev/null || echo "release_N/A-N/A-$(shell git log --format=%h HEAD^..HEAD)") GITSTATUS ?= $(shell git status -uno --porcelain) else -include mk/version.mk -- 2.39.1