DPDK CI discussions
 help / color / mirror / Atom feed
* [PATCH v1] tools: fix parsing message-id in the headers of email
@ 2023-12-04  2:52 Min Zhou
  2023-12-07 19:07 ` Aaron Conole
  0 siblings, 1 reply; 5+ messages in thread
From: Min Zhou @ 2023-12-04  2:52 UTC (permalink / raw)
  To: ci; +Cc: msantana, aconole, dmarchan, thomas, probb, dceara, zhoumin

Some email has the message-id header named "Message-id", like this:
https://patches.dpdk.org/project/dpdk/patch/20230930010024.34377-1-rdna@apple.com/.
So add the parsing for this kind of email.

Signed-off-by: Min Zhou <zhoumin@loongson.cn>
---
 tools/parse-email.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/parse-email.sh b/tools/parse-email.sh
index 9cb9583..fbe038a 100755
--- a/tools/parse-email.sh
+++ b/tools/parse-email.sh
@@ -35,6 +35,7 @@ subject=$(getheader Subject "$1")
 from=$(getheader From "$1")
 msgid=$(getheader Message-Id "$1")
 [ -n "$msgid" ] || msgid=$(getheader Message-ID "$1")
+[ -n "$msgid" ] || msgid=$(getheader Message-id "$1")
 pwid=$(getheader X-Patchwork-Id "$1")
 listid=$(getheader List-Id "$1")
 reply=$(getheader In-Reply-To "$1")
-- 
2.27.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] tools: fix parsing message-id in the headers of email
  2023-12-04  2:52 [PATCH v1] tools: fix parsing message-id in the headers of email Min Zhou
@ 2023-12-07 19:07 ` Aaron Conole
  2023-12-08  3:53   ` zhoumin
  0 siblings, 1 reply; 5+ messages in thread
From: Aaron Conole @ 2023-12-07 19:07 UTC (permalink / raw)
  To: Min Zhou; +Cc: ci, msantana, dmarchan, thomas, probb, dceara

Min Zhou <zhoumin@loongson.cn> writes:

> Some email has the message-id header named "Message-id", like this:
> https://patches.dpdk.org/project/dpdk/patch/20230930010024.34377-1-rdna@apple.com/.
> So add the parsing for this kind of email.
>
> Signed-off-by: Min Zhou <zhoumin@loongson.cn>
> ---

Hi Min,

I wonder - we will keep having this issue of these header fields being
incorrectly matched based on case issues.

Maybe we should make getheader have the ability to ignore case, or pass
something like Message-[iI][dD] as the header argument.

WDYT?

>  tools/parse-email.sh | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/parse-email.sh b/tools/parse-email.sh
> index 9cb9583..fbe038a 100755
> --- a/tools/parse-email.sh
> +++ b/tools/parse-email.sh
> @@ -35,6 +35,7 @@ subject=$(getheader Subject "$1")
>  from=$(getheader From "$1")
>  msgid=$(getheader Message-Id "$1")
>  [ -n "$msgid" ] || msgid=$(getheader Message-ID "$1")
> +[ -n "$msgid" ] || msgid=$(getheader Message-id "$1")
>  pwid=$(getheader X-Patchwork-Id "$1")
>  listid=$(getheader List-Id "$1")
>  reply=$(getheader In-Reply-To "$1")


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] tools: fix parsing message-id in the headers of email
  2023-12-07 19:07 ` Aaron Conole
@ 2023-12-08  3:53   ` zhoumin
  2023-12-13 12:53     ` Aaron Conole
  0 siblings, 1 reply; 5+ messages in thread
From: zhoumin @ 2023-12-08  3:53 UTC (permalink / raw)
  To: Aaron Conole; +Cc: ci, msantana, dmarchan, thomas, probb, dceara, alialnu

Hi Aaron,

Thanks for your reply.

On Thur, Dec 7, 2023 7:07PM, Aaron Conole wrote:
> Min Zhou <zhoumin@loongson.cn> writes:
>
>> Some email has the message-id header named "Message-id", like this:
>> https://patches.dpdk.org/project/dpdk/patch/20230930010024.34377-1-rdna@apple.com/.
>> So add the parsing for this kind of email.
>>
>> Signed-off-by: Min Zhou <zhoumin@loongson.cn>
>> ---
> Hi Min,
>
> I wonder - we will keep having this issue of these header fields being
> incorrectly matched based on case issues.
>
> Maybe we should make getheader have the ability to ignore case, or pass
> something like Message-[iI][dD] as the header argument.
>
> WDYT?

Yes, making getheader have the ability to ignore case is simple and does 
work for this case as following:

diff --git a/tools/parse-email.sh b/tools/parse-email.sh
index 9ab627b..1e3008a 100755
--- a/tools/parse-email.sh
+++ b/tools/parse-email.sh
@@ -29,7 +29,7 @@ fi

  getheader () # <header_name> <email_file>
  {
-       sed "/^$1: */!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q" "$2" |
+       sed "/^$1: */I!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q" "$2" |
         sed 's,",\\",g'

  }

But, I think we might get a false-positive when matching header field by 
this way. Because we are handling the whole patch file which could have 
same words in somewhere if we ignore the case.

Passing Message-[iI][dD] also works for this case and I tend to use this 
method. What do you think? If you agree with this method I will send the 
V2 patch.


Best regards,

Min


>>   tools/parse-email.sh | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/parse-email.sh b/tools/parse-email.sh
>> index 9cb9583..fbe038a 100755
>> --- a/tools/parse-email.sh
>> +++ b/tools/parse-email.sh
>> @@ -35,6 +35,7 @@ subject=$(getheader Subject "$1")
>>   from=$(getheader From "$1")
>>   msgid=$(getheader Message-Id "$1")
>>   [ -n "$msgid" ] || msgid=$(getheader Message-ID "$1")
>> +[ -n "$msgid" ] || msgid=$(getheader Message-id "$1")
>>   pwid=$(getheader X-Patchwork-Id "$1")
>>   listid=$(getheader List-Id "$1")
>>   reply=$(getheader In-Reply-To "$1")


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] tools: fix parsing message-id in the headers of email
  2023-12-08  3:53   ` zhoumin
@ 2023-12-13 12:53     ` Aaron Conole
  2023-12-14  2:36       ` zhoumin
  0 siblings, 1 reply; 5+ messages in thread
From: Aaron Conole @ 2023-12-13 12:53 UTC (permalink / raw)
  To: zhoumin; +Cc: ci, msantana, dmarchan, thomas, probb, dceara, alialnu

zhoumin <zhoumin@loongson.cn> writes:

> Hi Aaron,
>
> Thanks for your reply.
>
> On Thur, Dec 7, 2023 7:07PM, Aaron Conole wrote:
>> Min Zhou <zhoumin@loongson.cn> writes:
>>
>>> Some email has the message-id header named "Message-id", like this:
>>> https://patches.dpdk.org/project/dpdk/patch/20230930010024.34377-1-rdna@apple.com/.
>>> So add the parsing for this kind of email.
>>>
>>> Signed-off-by: Min Zhou <zhoumin@loongson.cn>
>>> ---
>> Hi Min,
>>
>> I wonder - we will keep having this issue of these header fields being
>> incorrectly matched based on case issues.
>>
>> Maybe we should make getheader have the ability to ignore case, or pass
>> something like Message-[iI][dD] as the header argument.
>>
>> WDYT?
>
> Yes, making getheader have the ability to ignore case is simple and
> does work for this case as following:
>
> diff --git a/tools/parse-email.sh b/tools/parse-email.sh
> index 9ab627b..1e3008a 100755
> --- a/tools/parse-email.sh
> +++ b/tools/parse-email.sh
> @@ -29,7 +29,7 @@ fi
>
>  getheader () # <header_name> <email_file>
>  {
> -       sed "/^$1: */!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q" "$2" |
> +       sed "/^$1: */I!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q" "$2" |
>         sed 's,",\\",g'
>
>  }
>
> But, I think we might get a false-positive when matching header field
> by this way. Because we are handling the whole patch file which could
> have same words in somewhere if we ignore the case.
>
> Passing Message-[iI][dD] also works for this case and I tend to use
> this method. What do you think? If you agree with this method I will
> send the V2 patch.

ACK by me - sounds good.  That means we can just modify the existing
getheader check for message id.

> Best regards,
>
> Min
>
>
>>>   tools/parse-email.sh | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/tools/parse-email.sh b/tools/parse-email.sh
>>> index 9cb9583..fbe038a 100755
>>> --- a/tools/parse-email.sh
>>> +++ b/tools/parse-email.sh
>>> @@ -35,6 +35,7 @@ subject=$(getheader Subject "$1")
>>>   from=$(getheader From "$1")
>>>   msgid=$(getheader Message-Id "$1")
>>>   [ -n "$msgid" ] || msgid=$(getheader Message-ID "$1")
>>> +[ -n "$msgid" ] || msgid=$(getheader Message-id "$1")
>>>   pwid=$(getheader X-Patchwork-Id "$1")
>>>   listid=$(getheader List-Id "$1")
>>>   reply=$(getheader In-Reply-To "$1")


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] tools: fix parsing message-id in the headers of email
  2023-12-13 12:53     ` Aaron Conole
@ 2023-12-14  2:36       ` zhoumin
  0 siblings, 0 replies; 5+ messages in thread
From: zhoumin @ 2023-12-14  2:36 UTC (permalink / raw)
  To: Aaron Conole; +Cc: ci, msantana, dmarchan, thomas, probb, dceara, alialnu


On Wed, Dec 13, 2023 at 12:53PM, Aaron Conole wrote:
> zhoumin <zhoumin@loongson.cn> writes:
>
>> Hi Aaron,
>>
>> Thanks for your reply.
>>
>> On Thur, Dec 7, 2023 7:07PM, Aaron Conole wrote:
>>> Min Zhou <zhoumin@loongson.cn> writes:
>>>
>>>> Some email has the message-id header named "Message-id", like this:
>>>> https://patches.dpdk.org/project/dpdk/patch/20230930010024.34377-1-rdna@apple.com/.
>>>> So add the parsing for this kind of email.
>>>>
>>>> Signed-off-by: Min Zhou <zhoumin@loongson.cn>
>>>> ---
>>> Hi Min,
>>>
>>> I wonder - we will keep having this issue of these header fields being
>>> incorrectly matched based on case issues.
>>>
>>> Maybe we should make getheader have the ability to ignore case, or pass
>>> something like Message-[iI][dD] as the header argument.
>>>
>>> WDYT?
>> Yes, making getheader have the ability to ignore case is simple and
>> does work for this case as following:
>>
>> diff --git a/tools/parse-email.sh b/tools/parse-email.sh
>> index 9ab627b..1e3008a 100755
>> --- a/tools/parse-email.sh
>> +++ b/tools/parse-email.sh
>> @@ -29,7 +29,7 @@ fi
>>
>>   getheader () # <header_name> <email_file>
>>   {
>> -       sed "/^$1: */!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q" "$2" |
>> +       sed "/^$1: */I!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q" "$2" |
>>          sed 's,",\\",g'
>>
>>   }
>>
>> But, I think we might get a false-positive when matching header field
>> by this way. Because we are handling the whole patch file which could
>> have same words in somewhere if we ignore the case.
>>
>> Passing Message-[iI][dD] also works for this case and I tend to use
>> this method. What do you think? If you agree with this method I will
>> send the V2 patch.
> ACK by me - sounds good.  That means we can just modify the existing
> getheader check for message id.

Yes, thanks! I will send the V2 patch.

Best regards,

Min

>> Best regards,
>>
>> Min
>>
>>
>>>>    tools/parse-email.sh | 1 +
>>>>    1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/tools/parse-email.sh b/tools/parse-email.sh
>>>> index 9cb9583..fbe038a 100755
>>>> --- a/tools/parse-email.sh
>>>> +++ b/tools/parse-email.sh
>>>> @@ -35,6 +35,7 @@ subject=$(getheader Subject "$1")
>>>>    from=$(getheader From "$1")
>>>>    msgid=$(getheader Message-Id "$1")
>>>>    [ -n "$msgid" ] || msgid=$(getheader Message-ID "$1")
>>>> +[ -n "$msgid" ] || msgid=$(getheader Message-id "$1")
>>>>    pwid=$(getheader X-Patchwork-Id "$1")
>>>>    listid=$(getheader List-Id "$1")
>>>>    reply=$(getheader In-Reply-To "$1")


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-14  2:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-04  2:52 [PATCH v1] tools: fix parsing message-id in the headers of email Min Zhou
2023-12-07 19:07 ` Aaron Conole
2023-12-08  3:53   ` zhoumin
2023-12-13 12:53     ` Aaron Conole
2023-12-14  2:36       ` zhoumin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).