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 C6960A00C3 for ; Mon, 28 Nov 2022 11:47:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A6D8E4067E; Mon, 28 Nov 2022 11:47:43 +0100 (CET) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mails.dpdk.org (Postfix) with ESMTP id 748404067C for ; Mon, 28 Nov 2022 11:47:41 +0100 (CET) Received: by mail-wr1-f48.google.com with SMTP id w15so2885802wrl.9 for ; Mon, 28 Nov 2022 02:47:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Q2eF0pilBQ4LeTvCzWTLjVpP1o81Atag3J+mRTBW5XM=; b=JC0apPs1HUbIm1RFtmmzyjYjCcArr0qh+IUeLez3VkRJEz7Ye8Nlk7juJoT2XuFLpJ 709Mllz1LESBm1vrw/C55aN/dqw7buRm7Vu5eamhInTK5BuR8YlOGURaGmHLMA0+W8I0 jxr+wMFJXdMa6vY/ZpwiU6aE4/s0YzVy7lw4sd2D0NwS8G0/pl2Usz1gSB/22t96hlm7 nOmp/zwsVMUDN/9rgfiquiGhRDwzq+PlhNc0oj199fqEqoEoSkGeqhB1hjkwM7hAAp2i jHmEKK+bibXqA2JSd5ayZ2uHwvyq8VndxULo6xj0LFGmZulrZqTGlATns0qTT9ruEdGC KHqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q2eF0pilBQ4LeTvCzWTLjVpP1o81Atag3J+mRTBW5XM=; b=f2GrBdiaVrqOzCxrdWo8iP9pQMjA7ILat/SWk+4e4Mks9H/aqG8Rbsnn6/10XDCV/7 ArgWcsc2xAyKagcGsCd241EzPzVu9VZYc6iMA7fqVOXmXxmg0r8c91jkb4xPxhs+iir2 IwgvhiBLB0pMuRDI77kKtAPwdr8ZDSiko5vSmMmoemMSs4SlScv0E5EfZ7LIeOOobMrh 8nUY1tQhNwwVoCGk1x3HJWKgQQadFO1HqjyVkhfWMgCSjXQ2UQNBjdN/4pAcENEyrzUx WUReaixSIyclnmMBnHii+S/rW5R0Q+L3emxMBZmxH1kiZoD/gM2TvSOq2qW2U8YYMDYr egEg== X-Gm-Message-State: ANoB5plxkfelr7LJknWC+OmmPJIIGBRkzPQqxhLqeI1nGy8Pq8X2AJ6/ ylbSuOTr+rq/UNULEDr31hY= X-Google-Smtp-Source: AA0mqf4yZc4hWhwyuIiDQ9f1s4SfRnx8OpcR7HwwnbgLHZCkg3NQ4nnYGFIvVGWYt8f+xocf2nALZA== X-Received: by 2002:adf:facd:0:b0:231:482f:ed6b with SMTP id a13-20020adffacd000000b00231482fed6bmr31067439wrs.253.1669632461138; Mon, 28 Nov 2022 02:47:41 -0800 (PST) Received: from localhost ([137.220.119.58]) by smtp.gmail.com with ESMTPSA id x16-20020a5d6b50000000b0022a3a887ceasm10347541wrw.49.2022.11.28.02.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 02:47:40 -0800 (PST) From: luca.boccassi@gmail.com To: Olivier Matz Cc: Thomas Monjalon , dpdk stable Subject: patch 'devtools: fix checkpatch header retrieval from stdin' has been queued to stable release 20.11.7 Date: Mon, 28 Nov 2022 10:47:36 +0000 Message-Id: <20221128104737.1394230-1-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221122220241.926784-17-luca.boccassi@gmail.com> References: <20221122220241.926784-17-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/30/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/2fa54fa0da7bde8487bac3e3a0e688504527cb8e Thanks. Luca Boccassi --- >From 2fa54fa0da7bde8487bac3e3a0e688504527cb8e Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Thu, 29 Sep 2022 14:04:03 +0200 Subject: [PATCH] devtools: fix checkpatch header retrieval from stdin [ upstream commit 9cb8326456317264a7d085978634661c520af706 ] When passing the patch to checkpatches.sh through stdin, the subject is retrieved by reading the input until a "Subject:" entry is found. The rest of the input is piped to checkpatch.pl. Since the "From:" line is before the "Subject:" line, it won't be sent to checkpatch.pl, which won't be able to get the author of the commit. The following error will appear: ERROR:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author '' Do the subject lookup on the temporary file instead of stdin, and send the whole lines to checkpatch.pl. The problem is visible since the introduction of this check in linux checkpatch.pl in version 4.19 (see link below). Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cd2614967d8b Fixes: 8005feef421d ("scripts: add standard input to checkpatch") Signed-off-by: Olivier Matz Reviewed-by: Thomas Monjalon --- devtools/checkpatches.sh | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index db4c7d8301..267780ff7a 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -229,12 +229,12 @@ print_headline() { # total=0 status=0 -check () { # <patch> <commit> <title> +check () { # <patch-file> <commit> local ret=0 + local subject='' headline_printed=false total=$(($total + 1)) - ! $verbose || print_headline "$3" if [ -n "$1" ] ; then tmpinput=$1 else @@ -249,10 +249,14 @@ check () { # <patch> <commit> <title> fi fi + # Subject can be on 2 lines + subject=$(sed '/^Subject: */!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q' "$tmpinput") + ! $verbose || print_headline "$subject" + ! $verbose || printf 'Running checkpatch.pl:\n' report=$($DPDK_CHECKPATCH_PATH $options "$tmpinput" 2>/dev/null) if [ $? -ne 0 ] ; then - $headline_printed || print_headline "$3" + $headline_printed || print_headline "$subject" printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p' ret=1 fi @@ -260,7 +264,7 @@ check () { # <patch> <commit> <title> ! $verbose || printf '\nChecking API additions/removals:\n' report=$($VALIDATE_NEW_API "$tmpinput") if [ $? -ne 0 ] ; then - $headline_printed || print_headline "$3" + $headline_printed || print_headline "$subject" printf '%s\n' "$report" ret=1 fi @@ -268,7 +272,7 @@ check () { # <patch> <commit> <title> ! $verbose || printf '\nChecking forbidden tokens additions:\n' report=$(check_forbidden_additions "$tmpinput") if [ $? -ne 0 ] ; then - $headline_printed || print_headline "$3" + $headline_printed || print_headline "$subject" printf '%s\n' "$report" ret=1 fi @@ -276,7 +280,7 @@ check () { # <patch> <commit> <title> ! $verbose || printf '\nChecking __rte_experimental tags:\n' report=$(check_experimental_tags "$tmpinput") if [ $? -ne 0 ] ; then - $headline_printed || print_headline "$3" + $headline_printed || print_headline "$subject" printf '%s\n' "$report" ret=1 fi @@ -284,7 +288,7 @@ check () { # <patch> <commit> <title> ! $verbose || printf '\nChecking __rte_internal tags:\n' report=$(check_internal_tags "$tmpinput") if [ $? -ne 0 ] ; then - $headline_printed || print_headline "$3" + $headline_printed || print_headline "$subject" printf '%s\n' "$report" ret=1 fi @@ -300,20 +304,10 @@ check () { # <patch> <commit> <title> if [ -n "$1" ] ; then for patch in "$@" ; do - # Subject can be on 2 lines - subject=$(sed '/^Subject: */!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q' "$patch") - check "$patch" '' "$subject" + check "$patch" '' done elif [ ! -t 0 ] ; then # stdin - subject=$(while read header value ; do - if [ "$header" = 'Subject:' ] ; then - IFS= read next - continuation=$(echo "$next" | sed -n 's,^[[:space:]]\+, ,p') - echo $value$continuation - break - fi - done) - check '' '' "$subject" + check '' '' else if [ $number -eq 0 ] ; then commits=$(git rev-list --reverse $range) @@ -321,8 +315,7 @@ else commits=$(git rev-list --reverse --max-count=$number HEAD) fi for commit in $commits ; do - subject=$(git log --format='%s' -1 $commit) - check '' $commit "$subject" + check '' $commit done fi pass=$(($total - $status)) -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-11-28 10:21:06.680250858 +0000 +++ 0001-devtools-fix-checkpatch-header-retrieval-from-stdin.patch 2022-11-28 10:21:06.602968835 +0000 @@ -1 +1 @@ -From 9cb8326456317264a7d085978634661c520af706 Mon Sep 17 00:00:00 2001 +From 2fa54fa0da7bde8487bac3e3a0e688504527cb8e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 9cb8326456317264a7d085978634661c520af706 ] + @@ -24 +25,0 @@ -Cc: stable@dpdk.org @@ -29,2 +30,2 @@ - devtools/checkpatches.sh | 37 +++++++++++++++---------------------- - 1 file changed, 15 insertions(+), 22 deletions(-) + devtools/checkpatches.sh | 35 ++++++++++++++--------------------- + 1 file changed, 14 insertions(+), 21 deletions(-) @@ -33 +34 @@ -index 1f1175c4f1..a07bbc83cb 100755 +index db4c7d8301..267780ff7a 100755 @@ -36 +37 @@ -@@ -284,12 +284,12 @@ print_headline() { # <title> +@@ -229,12 +229,12 @@ print_headline() { # <title> @@ -51 +52 @@ -@@ -304,10 +304,14 @@ check () { # <patch> <commit> <title> +@@ -249,10 +249,14 @@ check () { # <patch> <commit> <title> @@ -67 +68 @@ -@@ -315,7 +319,7 @@ check () { # <patch> <commit> <title> +@@ -260,7 +264,7 @@ check () { # <patch> <commit> <title> @@ -76 +77 @@ -@@ -323,7 +327,7 @@ check () { # <patch> <commit> <title> +@@ -268,7 +272,7 @@ check () { # <patch> <commit> <title> @@ -85 +86 @@ -@@ -331,7 +335,7 @@ check () { # <patch> <commit> <title> +@@ -276,7 +280,7 @@ check () { # <patch> <commit> <title> @@ -94 +95 @@ -@@ -339,7 +343,7 @@ check () { # <patch> <commit> <title> +@@ -284,7 +288,7 @@ check () { # <patch> <commit> <title> @@ -103,10 +104 @@ -@@ -347,7 +351,7 @@ check () { # <patch> <commit> <title> - ! $verbose || printf '\nChecking release notes updates:\n' - report=$(check_release_notes "$tmpinput") - if [ $? -ne 0 ] ; then -- $headline_printed || print_headline "$3" -+ $headline_printed || print_headline "$subject" - printf '%s\n' "$report" - ret=1 - fi -@@ -363,20 +367,10 @@ check () { # <patch> <commit> <title> +@@ -300,20 +304,10 @@ check () { # <patch> <commit> <title> @@ -135 +127 @@ -@@ -384,8 +378,7 @@ else +@@ -321,8 +315,7 @@ else