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.lam...@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.



-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to