All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Ohly <patrick.ohly@intel.com>
To: Jose Lamego <jose.a.lamego@linux.intel.com>
Cc: yocto@yoctoproject.org
Subject: Re: [patchwork][PATCH] patchwork/bin/parsemail: Make "[PATCH" prefix mandatory
Date: Mon, 09 Jan 2017 11:49:04 +0100	[thread overview]
Message-ID: <1483958944.2137.22.camel@intel.com> (raw)
In-Reply-To: <1483743785-13872-1-git-send-email-jose.a.lamego@linux.intel.com>

On Fri, 2017-01-06 at 17:03 -0600, Jose Lamego wrote:
> Patchwork may incorrectly identify emails containing patch-like content as
> patches.
> This change makes "[PATCH" prefix in subject mandatory for emails to be
> considered as new patches.
> 
> [YOCTO #10764]
> 
> Signed-off-by: Jose Lamego <jose.a.lamego@linux.intel.com>
> ---
>  patchwork/bin/parsemail.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/patchwork/bin/parsemail.py b/patchwork/bin/parsemail.py
> index 476118d..8d6529c 100755
> --- a/patchwork/bin/parsemail.py
> +++ b/patchwork/bin/parsemail.py
> @@ -399,7 +399,8 @@ def find_content(project, mail):
>      refs = build_references_list(mail)
>      is_root = refs == []
>      is_cover_letter = is_root and x == 0
> -    is_patch = patchbuf is not None
> +    patch_prefix = re.search('\[\s*PATCH', mail.get('Subject'))
> +    is_patch = patchbuf is not None and patch_prefix

This is indeed enough to weed out diffs that were inlined in normal
discussions (example from YOCTO #10764).

But we also have other examples and another bug (YOCTO #10877) where a
reply to a patch caused patchwork to create a new entry:

Subject: Re: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper
target  deployment
...
Ping!

I'm wondering if we can address two bugs with the same fix, something
that requires that the Subject line is starting with a set of tags plus
the [PATCH] tag. For example:

patch_prefix = re.match('(\s*\[[^]]*\]\s*)*\[\s*PATCH', mail.get('Subject'))

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.





  reply	other threads:[~2017-01-09 10:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-06 23:03 [patchwork][PATCH] patchwork/bin/parsemail: Make "[PATCH" prefix mandatory Jose Lamego
2017-01-09 10:49 ` Patrick Ohly [this message]
2017-01-09 22:34   ` Jose Lamego
2017-01-11 17:01     ` [patchwork][PATCH] patchwork/bin/parsemail: Improve new patch filtering Jose Lamego

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=1483958944.2137.22.camel@intel.com \
    --to=patrick.ohly@intel.com \
    --cc=jose.a.lamego@linux.intel.com \
    --cc=yocto@yoctoproject.org \
    /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.