All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Robin Jarry <rjarry@redhat.com>
Cc: dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [PATCH] checkpatches: verify in-reply-to header when possible
Date: Mon, 7 Oct 2024 13:41:39 -0700	[thread overview]
Message-ID: <20241007134139.6ad8f94b@hermes.local> (raw)
In-Reply-To: <20240705153532.563199-2-rjarry@redhat.com>

On Fri,  5 Jul 2024 17:35:33 +0200
Robin Jarry <rjarry@redhat.com> wrote:

> 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=<v1.patch@message.id>.
>  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 <rjarry@redhat.com>
> ---
>  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 () { # <patch-file> <commit>
>  	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 () { # <patch-file> <commit>
>  			--no-stat --stdout -1 $commit > "$tmpinput"
>  		else
>  			cat > "$tmpinput"
> +			check_in_reply_to=true
>  		fi
>  	fi
>  
> @@ -426,6 +429,16 @@ check () { # <patch-file> <commit>
>  	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].*\]' \

Your regex won't work for v10 etc.

  reply	other threads:[~2024-10-07 20:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05 15:35 [PATCH] checkpatches: verify in-reply-to header when possible Robin Jarry
2024-10-07 20:41 ` Stephen Hemminger [this message]
2024-10-07 20:43   ` Robin Jarry
2024-10-11  8:24 ` [PATCH dpdk v2] " Robin Jarry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241007134139.6ad8f94b@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=rjarry@redhat.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.