From patchwork Tue Feb 11 18:05:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B8rn_Mork?= X-Patchwork-Id: 2045803 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=nrB5s8xT; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4YsqDg6QT5z1yhq for ; Wed, 12 Feb 2025 05:08:01 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type:List-Help: Reply-To:List-Archive:List-Unsubscribe:List-Subscribe:From:List-Post:List-Id: Message-ID:MIME-Version:Date:Subject:To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=9C3EMaiTEIQoUgOuh0J6YOPB0EfQpjji9jQrFhkzu0o=; b=nrB5s8xTGEpnAMe3hZd3s/b0Vu nizyup/kzw8FYmc3MVG1JxWUcvONhWptmiwc5Zlw47gtbYvCFuIZWMPtrURyoRbghoVh99IH0ayWI srv+bu7RJ680riouSuJZItpex2DaHLDBMGa8qktMCAWSB2dhiqhcylHQq3jgvydNKJBl1wtdUFw0B +H6NBragEyNMhQufwWD2V8bUn+LT10jJp11w+d8bfrMP6VHyFNV4k/6OEDHq/eG8+e7aUKpbn7/GZ VhXpnEAAjfZs/wq3o/uuESQ+wUvVw0iCB6VlvbmU2qzOaOWu4yDQ9MBt8lDzePCUSdkfla8M5PYel Xfz4uDcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1thudo-00000004n6m-2AF9; Tue, 11 Feb 2025 18:05:48 +0000 To: openwrt-devel@lists.openwrt.org Subject: [PATCH] build: parsing "git log" breaks with gpg signature verification Date: Tue, 11 Feb 2025 19:05:32 +0100 MIME-Version: 1.0 Message-ID: List-Id: OpenWrt Development List List-Post: X-Patchwork-Original-From: =?utf-8?q?Bj=C3=B8rn_Mork_via_openwrt-devel?= From: =?utf-8?q?Bj=C3=B8rn_Mork?= Precedence: list X-Mailman-Version: 2.1.34 X-BeenThere: openwrt-devel@lists.openwrt.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: =?utf-8?q?Bj=C3=B8rn_Mork?= List-Help: Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. Parsing "git log" is fragile. The actual output depends on both global and local configuration files. Enabling "log.showSignature" makes "git log" prefix signed commits with multiple lines of gpg verify output, regardless of the configured log format. Add "--no-show-signature" to "git log" commands to work around this particular issue. Signed-off-by: Bjørn Mork --- include/download.mk | 2 +- rules.mk | 4 ++-- scripts/getver.sh | 2 +- toolchain/Makefile | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/download.mk b/include/download.mk index 7f3430277350..3ed88bb9528d 100644 --- a/include/download.mk +++ b/include/download.mk @@ -228,7 +228,7 @@ define DownloadMethod/rawgit [ \! -d $(SUBDIR) ] && \ git clone $(OPTS) $(URL) $(SUBDIR) && \ (cd $(SUBDIR) && git checkout $(SOURCE_VERSION)) && \ - export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \ + export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --no-show-signature --format='@%ct'` && \ echo "Generating formal git archive (apply .gitattributes rules)" && \ (cd $(SUBDIR) && git config core.abbrev 8 && \ git archive --format=tar HEAD --output=../$(SUBDIR).tar.git) && \ diff --git a/rules.mk b/rules.mk index dbc448e1a432..7a5df4109ef1 100644 --- a/rules.mk +++ b/rules.mk @@ -507,9 +507,9 @@ ext=$(word $(words $(subst ., ,$(1))),$(subst ., ,$(1))) ## define commitcount $(shell \ - if git log -1 >/dev/null 2>/dev/null; then \ + if git log -1 --no-show-signature >/dev/null 2>/dev/null; then \ if [ -n "$(1)" ]; then \ - last_bump="$$(git log --pretty=format:'%h %s' . | \ + last_bump="$$(git log --no-show-signature --pretty=format:'%h %s' . | \ grep -m 1 -e ': [uU]pdate to ' -e ': [bB]ump to ' | \ cut -f 1 -d ' ')"; \ fi; \ diff --git a/scripts/getver.sh b/scripts/getver.sh index 0659d8004a01..23ca0f489b15 100755 --- a/scripts/getver.sh +++ b/scripts/getver.sh @@ -40,7 +40,7 @@ try_git() { REV="${UPSTREAM_REV}+$((REV - UPSTREAM_REV))" fi - REV="${REV:+r$REV-$(git log -n 1 --format="%h" $UPSTREAM_BASE)}" + REV="${REV:+r$REV-$(git log -n 1 --no-show-signature --format="%h" $UPSTREAM_BASE)}" ;; esac diff --git a/toolchain/Makefile b/toolchain/Makefile index 09c16f72a780..67b1540117cd 100644 --- a/toolchain/Makefile +++ b/toolchain/Makefile @@ -65,7 +65,7 @@ endif ifdef CONFIG_BUILDBOT ifneq ($(wildcard $(TOPDIR)/.git),) $(TOOLCHAIN_DIR)/stamp/.ver_check: $(TMP_DIR)/.build - cd "$(TOPDIR)"; git log --format=%h -1 toolchain > $(TMP_DIR)/.ver_check + cd "$(TOPDIR)"; git log --no-show-signature --format=%h -1 toolchain > $(TMP_DIR)/.ver_check cmp -s $(TMP_DIR)/.ver_check $@ || { \ rm -rf $(BUILD_DIR) $(STAGING_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR_TOOLCHAIN); \ mkdir -p $(TOOLCHAIN_DIR)/stamp; \