From 87149b3f8e64adcd9c4025f58c71cc0afbd10571 Mon Sep 17 00:00:00 2001
From: Jannis Harder <me@jix.one>
Date: Mon, 23 May 2022 17:04:07 +0200
Subject: [PATCH] Change way to get commit sha

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 6d901956f..7235c9dc3 100644
--- a/Makefile
+++ b/Makefile
@@ -130,7 +130,7 @@ LDLIBS += -lrt
 endif
 
 YOSYS_VER := 0.17+33
-GIT_REV := $(shell git -C $(YOSYS_SRC) rev-parse --short HEAD 2> /dev/null || echo UNKNOWN)
+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}')
 OBJS = kernel/version_$(GIT_REV).o
 
 bumpversion: