patch 'devtools: fix checkpatch header retrieval from stdin' has been queued to stable release 20.11.7
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Nov 28 11:47:36 CET 2022
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 <olivier.matz at 6wind.com>
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 <olivier.matz at 6wind.com>
Reviewed-by: Thomas Monjalon <thomas at monjalon.net>
---
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() { # <title>
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 at 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
More information about the stable
mailing list