On 20/01/2023 19:44, Ihor Radchenko wrote:
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

another option is to use --always

git describe --match release\* --abbrev=6 --always HEAD
52f29d

and some make code that prepends it with release_$(ORGVERSION)- if it has not release prefix.

Earlier posted patches attempts to make remote query even if history depth of local copy is enough to include a commit tagged as release. I have found some recipes how to modify "git fetch" to get enough objects for "git describe", but I have never used them, so unsure concerning their reliability. Perhaps they may be used in CI configuration, namely in the script preparing source directory, since fetch is not responsibility of make.

Reply via email to