* mk/targets.mk(GITVERSION): Provide commit number for shallow clones

Fall back to using git describe --always when git describe fails in
Org repo.

See https://orgmode.org/list/87bkmve8qv.fsf@gmail.com
This commit is contained in:
Ihor Radchenko 2023-01-20 15:25:33 +03:00
parent 9e9669a271
commit 6d37d2a8e7
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 1 additions and 1 deletions

View File

@ -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 describe --match release\* --abbrev=6 --always HEAD)")
GITSTATUS ?= $(shell git status -uno --porcelain)
else
-include mk/version.mk