From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 96ADE45B12; Fri, 11 Oct 2024 10:25:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F4DE4028B; Fri, 11 Oct 2024 10:25:31 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id B1DE7400D5 for ; Fri, 11 Oct 2024 10:25:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728635130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FqWXxhL5HHQfQqMKs2AA8QPGkEkSamKnp7ji/YvS560=; b=d0NYCeT6OEEMcvL88NiKeafXd9HuSe0Hll0C2CpTq92LTRs2USHbnjALYdq2Lkdl49/qwn 68jHEzcTNf864FXhUw/4nshZ1ydlo309EtPkxx9fJMV2kyd+W9QC8+v8Dbj8M4Y8P4DV4h xOfnu8URfXuItYxUyGCivE92hWhDuZI= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-658-t56c1m35PCWD3jbjK9VKcw-1; Fri, 11 Oct 2024 04:25:26 -0400 X-MC-Unique: t56c1m35PCWD3jbjK9VKcw-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DA11B19560B4; Fri, 11 Oct 2024 08:25:24 +0000 (UTC) Received: from ringo.home (unknown [10.39.208.26]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 147551955F42; Fri, 11 Oct 2024 08:25:22 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org, Thomas Monjalon Cc: Stephen Hemminger Subject: [PATCH dpdk v2] checkpatches: verify in-reply-to header when possible Date: Fri, 11 Oct 2024 10:24:41 +0200 Message-ID: <20241011082440.1900292-2-rjarry@redhat.com> In-Reply-To: <20240705153532.563199-2-rjarry@redhat.com> References: <20240705153532.563199-2-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When using checkpatches.sh locally, verify that there is an In-Reply-To header when the patch is a respin (i.e. v2, v3, etc.). This is currently only enforced by the upstream CI but cannot be verified locally. This cannot be verified when checking commit ids since --in-reply-to is a git-format-patch option which is not specified by checkpatches.sh when generating temporary files. Here is an example: $ git format-patch -v6 -1 --stdout | devtools/checkpatches.sh warning: [PATCH v6] graph: expose node context as pointers warning: respins must be --in-reply-to=. 0/1 valid patch $ git format-patch -v12345 -1 --stdout | devtools/checkpatches.sh warning: [PATCH v12345] graph: expose node context as pointers warning: respins must be --in-reply-to=. 0/1 valid patch $ git format-patch -v6 -1 --stdout --in-reply-to=foo | \ devtools/checkpatches.sh 1/1 valid patch Link: https://git.dpdk.org/tools/dpdk-ci/commit/?id=070b31649e48460b3 Signed-off-by: Robin Jarry Acked-by: Stephen Hemminger --- Notes: v2: fix check for v1[0-9]+ devtools/checkpatches.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index 17a05e4986fd..b8ca2f67bbd4 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -414,11 +414,13 @@ status=0 check () { # local ret=0 local subject='' + local check_in_reply_to=false headline_printed=false total=$(($total + 1)) if [ -n "$1" ] ; then tmpinput=$1 + check_in_reply_to=true else tmpinput=$(mktemp -t dpdk.checkpatches.XXXXXX) trap "rm -f '$tmpinput'" INT @@ -428,6 +430,7 @@ check () { # --no-stat --stdout -1 $commit > "$tmpinput" else cat > "$tmpinput" + check_in_reply_to=true fi fi @@ -435,6 +438,16 @@ check () { # subject=$(sed '/^Subject: */!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q' "$tmpinput") ! $verbose || print_headline "$subject" + # check In-Reply-To for version > 1 + if [ "$check_in_reply_to" = true ] \ + && echo "$subject" | grep -Eq '\[[^]]+\[^]]*\]' \ + && ! grep -qi '^In-Reply-To: ' "$tmpinput" + then + echo "warning: $subject" + echo "warning: respins must be --in-reply-to=." + ret=1 + fi + ! $verbose || printf 'Running checkpatch.pl:\n' report=$($DPDK_CHECKPATCH_PATH $options "$tmpinput" 2>/dev/null) if [ $? -ne 0 ] ; then -- 2.46.2