From 0e769d0284640ebc6815dcea2c7ffd9512e8310f Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Tue, 14 Nov 2017 12:52:32 -0800 Subject: [PATCH] qcacld-3.0: Include commits since checkout in build tag Currently, only the Change-Id for HEAD is included in the build tag. This can be problematic for builds which include hotfixes (cherry-picks). Include the Change-Ids of every cherry-pick commit since the last non-cherry-pick commit. This allows developers to quickly identify the checkout point used to make the build, as well as any hotfixes applied. Change-Id: Ibe6259c2e0b46c820e0f1d73a12383e01c10abb8 CRs-Fixed: 2143443 --- Kbuild | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Kbuild b/Kbuild index d2e04aeaefcf..61b6e7ea2240 100644 --- a/Kbuild +++ b/Kbuild @@ -2269,12 +2269,22 @@ endif # inject some build related information ifeq ($(CONFIG_BUILD_TAG), y) -CLD_ID = $(shell cd "$(WLAN_ROOT)" && \ - git log -1 | sed -nE 's/.*Change-Id: (I[0-f]{10}).*/\1/p') -CMN_ID = $(shell cd "$(WLAN_COMMON_INC)" && \ - git log -1 | sed -nE 's/.*Change-Id: (I[0-f]{10}).*/\1/p') +CLD_CHECKOUT = $(shell cd "$(WLAN_ROOT)" && \ + git reflog | grep -vm1 cherry-pick | grep -oE ^[0-f]+) +CLD_IDS = $(shell cd "$(WLAN_ROOT)" && \ + git log $(CLD_CHECKOUT)~..HEAD | \ + sed -nE 's/^\s*Change-Id: (I[0-f]{10})[0-f]{30}\s*$$/\1/p' | \ + paste -sd "," -) + +CMN_CHECKOUT = $(shell cd "$(WLAN_COMMON_INC)" && \ + git reflog | grep -vm1 cherry-pick | grep -oE ^[0-f]+) +CMN_IDS = $(shell cd "$(WLAN_COMMON_INC)" && \ + git log $(CMN_CHECKOUT)~..HEAD | \ + sed -nE 's/^\s*Change-Id: (I[0-f]{10})[0-f]{30}\s*$$/\1/p' | \ + paste -sd "," -) + TIMESTAMP = $(shell date -u +'%Y-%m-%dT%H:%M:%SZ') -BUILD_TAG = "$(TIMESTAMP); cld:$(CLD_ID); cmn:$(CMN_ID);" +BUILD_TAG = "$(TIMESTAMP); cld:$(CLD_IDS); cmn:$(CMN_IDS);" CDEFINES += -DBUILD_TAG=\"$(BUILD_TAG)\" endif