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 78C214559A; Fri, 5 Jul 2024 17:35:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 663AC410D5; Fri, 5 Jul 2024 17:35:43 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 5AA44410D4 for ; Fri, 5 Jul 2024 17:35:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720193740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lm2PjY5QfNcSOLu2Y9Ma87h3WsP7UUm+5FXavJ38JXg=; b=Wv7eWcKLVEmrdIHr328WA83X2Mjk7nzghP/Jy4GdRwiHd1WBX4wAdcpemLrQCTaHuctv3Q Z3dDRXJl7TMC6Hc2CK2jEux1LI4RcsuksOKW905mzBmahXaaAPIChpcx6e8yyQGcB+FaxA ps9Tt6xwBE8T2trfKjsKu5b+XfNW43M= Received: from mx-prod-mc-01.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-539-8f-iWglxPJyW3AKxYGBw7Q-1; Fri, 05 Jul 2024 11:35:39 -0400 X-MC-Unique: 8f-iWglxPJyW3AKxYGBw7Q-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 92661196E0A9; Fri, 5 Jul 2024 15:35:38 +0000 (UTC) Received: from ringo.redhat.com (unknown [10.39.208.10]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 014B81955F40; Fri, 5 Jul 2024 15:35:36 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org, Thomas Monjalon Subject: [PATCH] checkpatches: verify in-reply-to header when possible Date: Fri, 5 Jul 2024 17:35:33 +0200 Message-ID: <20240705153532.563199-2-rjarry@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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 -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 --- devtools/checkpatches.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index bfacd77f398a..cb1c9972a71f 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -405,11 +405,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 @@ -419,6 +421,7 @@ check () { # --no-stat --stdout -1 $commit > "$tmpinput" else cat > "$tmpinput" + check_in_reply_to=true fi fi @@ -426,6 +429,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 -qi 'v[2-9].*\]' \ + && ! 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.45.2