From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5B9DE4368D; Fri, 8 Dec 2023 04:53:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C801402CD; Fri, 8 Dec 2023 04:53:37 +0100 (CET) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mails.dpdk.org (Postfix) with ESMTP id 0EF9F402AC for ; Fri, 8 Dec 2023 04:53:34 +0100 (CET) Received: from loongson.cn (unknown [10.20.42.74]) by gateway (Coremail) with SMTP id _____8BxuOg8k3JlF94_AA--.26403S3; Fri, 08 Dec 2023 11:53:33 +0800 (CST) Received: from [10.20.42.74] (unknown [10.20.42.74]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Axzy84k3JlXxBYAA--.63987S3; Fri, 08 Dec 2023 11:53:30 +0800 (CST) Subject: Re: [PATCH v1] tools: fix parsing message-id in the headers of email To: Aaron Conole Cc: ci@dpdk.org, msantana@redhat.com, dmarchan@redhat.com, thomas@monjalon.net, probb@iol.unh.edu, dceara@redhat.com, alialnu@nvidia.com References: <20231204025246.14779-1-zhoumin@loongson.cn> From: zhoumin Message-ID: <6814760d-e5b3-5d70-7fd2-58137038dd81@loongson.cn> Date: Fri, 8 Dec 2023 03:53:08 +0000 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID: AQAAf8Axzy84k3JlXxBYAA--.63987S3 X-CM-SenderInfo: 52kr3ztlq6z05rqj20fqof0/1tbiAQATAWVyfSwB2AABsN X-Coremail-Antispam: 1Uk129KBj93XoW7Zw4rWw15WFWfKF1DXr1fGrX_yoW8tr4rpa n5tF15WrWxJFWrCFs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r4UYxBIdaVFxhVjvjDU0xZFpf9x07j8SdgUUU UU= X-BeenThere: ci@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK CI discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ci-bounces@dpdk.org Hi Aaron, Thanks for your reply. On Thur, Dec 7, 2023 7:07PM, Aaron Conole wrote: > Min Zhou 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 >> --- > 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 () #  { -       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")