aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorN. Engelhardt <nak@yosyshq.com>2023-03-06 16:12:36 +0100
committerGitHub <noreply@github.com>2023-03-06 16:12:36 +0100
commit7c5ae560a838db3f35dec0760df6cd8ebb590b80 (patch)
treeb6f1e5d1cc48985a472cc7d1f907bdf46d3a63d7
parent368f2984cdd8f0fd8046d54af3a2939bda48290a (diff)
parent3f173c21807625da3c8f876396d5fd2f39b26f14 (diff)
downloadyosys-7c5ae560a838db3f35dec0760df6cd8ebb590b80.tar.gz
yosys-7c5ae560a838db3f35dec0760df6cd8ebb590b80.tar.bz2
yosys-7c5ae560a838db3f35dec0760df6cd8ebb590b80.zip
Merge pull request #3684 from YosysHQ/fix-GIT_REV
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index fb818e20e..105042b0a 100644
--- a/Makefile
+++ b/Makefile
@@ -149,7 +149,7 @@ YOSYS_VER := 0.27+0
# back to calling git directly.
TARBALL_GIT_REV := $(shell cat $(YOSYS_SRC)/.gitcommit)
ifeq ($(TARBALL_GIT_REV),$$Format:%h$$)
-GIT_REV := $(shell git ls-remote $(YOSYS_SRC) HEAD -q | $(AWK) 'BEGIN {R = "UNKNOWN"}; ($$2 == "HEAD") {R = substr($$1, 1, 9); exit} END {print R}')
+GIT_REV := $(shell GIT_DIR=$(YOSYS_SRC)/.git git rev-parse --short=9 HEAD || echo UNKNOWN)
else
GIT_REV := $(TARBALL_GIT_REV)
endif