From b4cac090f8a50415c1d5fbbd9c9ec5444309590a Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 16 Aug 2018 09:39:11 -0400 Subject: [PATCH] use git plumbing to determine branch and commit IDs closes #596 Change-Id: I0c5294215a790e1b7d48f61e1e77964a63d42eb7 --- kernel-module/Makefile | 2 +- lib/lib.Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel-module/Makefile b/kernel-module/Makefile index eb2527d89..8a69d17c0 100644 --- a/kernel-module/Makefile +++ b/kernel-module/Makefile @@ -9,7 +9,7 @@ ifeq ($(RTPENGINE_VERSION),) ifneq ($(DPKG_PRSCHNGLG),) DPKG_PRSCHNGLG=$(shell dpkg-parsechangelog -l$(DEB_CHANGELOG) | awk '/^Version: / {print $$2}') endif - GIT_BR_COMMIT=$(shell git branch --no-color --no-column -v 2> /dev/null | awk '/^\*/ {OFS="-"; print "git", $$2, $$3}') + GIT_BR_COMMIT=git-$(shell cd $(M) && git rev-parse --abbrev-ref --symbolic-full-name HEAD)-$(shell cd $(M) && git rev-parse --short HEAD) ifneq ($(DPKG_PRSCHNGLG),) RTPENGINE_VERSION+=$(DPKG_PRSCHNGLG) diff --git a/lib/lib.Makefile b/lib/lib.Makefile index fa15e22e4..77a9b705d 100644 --- a/lib/lib.Makefile +++ b/lib/lib.Makefile @@ -10,7 +10,7 @@ ifeq ($(RTPENGINE_VERSION),) ifneq ($(DPKG_PRSCHNGLG),) DPKG_PRSCHNGLG=$(shell dpkg-parsechangelog -l$(RTPENGINE_ROOT_DIR)/debian/changelog | awk '/^Version: / {print $$2}') endif - GIT_BR_COMMIT=$(shell git branch --no-color --no-column -v 2> /dev/null | awk '/^\*/ {OFS="-"; print "git", $$2, $$3}') + GIT_BR_COMMIT=git-$(shell git rev-parse --abbrev-ref --symbolic-full-name HEAD)-$(shell git rev-parse --short HEAD) ifneq ($(DPKG_PRSCHNGLG),) RTPENGINE_VERSION+=$(DPKG_PRSCHNGLG)