* [PATCH 1/1] BaseTools/PatchCheck.py: Ignore CR and LF characters in subject length
@ 2019-12-19 14:12 Philippe Mathieu-Daudé
2019-12-31 13:23 ` Philippe Mathieu-Daudé
2020-01-02 9:39 ` [edk2-devel] " Jordan Justen
0 siblings, 2 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-19 14:12 UTC (permalink / raw)
To: devel
Cc: Philippe Mathieu-Daude, Liming Gao, Jordan Justen, Yonghong Zhu,
Zhichao Gao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=113
Strip the trailing characters before checking the subject line is
less than 72 characters.
Fixes: e61406708c83f
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
---
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
---
BaseTools/Scripts/PatchCheck.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index 2a4e6f603e79..b72e71963ea8 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -196,7 +196,7 @@ class CommitMessageCheck:
self.error('Empty commit message!')
return
- if count >= 1 and len(lines[0]) >= 72:
+ if count >= 1 and len(lines[0].strip()) >= 72:
self.error('First line of commit message (subject line) ' +
'is too long.')
--
2.21.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] BaseTools/PatchCheck.py: Ignore CR and LF characters in subject length
2019-12-19 14:12 [PATCH 1/1] BaseTools/PatchCheck.py: Ignore CR and LF characters in subject length Philippe Mathieu-Daudé
@ 2019-12-31 13:23 ` Philippe Mathieu-Daudé
2020-01-02 9:39 ` [edk2-devel] " Jordan Justen
1 sibling, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-31 13:23 UTC (permalink / raw)
To: devel; +Cc: Liming Gao, Jordan Justen, Yonghong Zhu, Zhichao Gao
ping?
On 12/19/19 3:12 PM, Philippe Mathieu-Daude wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=113
>
> Strip the trailing characters before checking the subject line is
> less than 72 characters.
>
> Fixes: e61406708c83f
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
> ---
> Cc: Yonghong Zhu <yonghong.zhu@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> ---
> BaseTools/Scripts/PatchCheck.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
> index 2a4e6f603e79..b72e71963ea8 100755
> --- a/BaseTools/Scripts/PatchCheck.py
> +++ b/BaseTools/Scripts/PatchCheck.py
> @@ -196,7 +196,7 @@ class CommitMessageCheck:
> self.error('Empty commit message!')
> return
>
> - if count >= 1 and len(lines[0]) >= 72:
> + if count >= 1 and len(lines[0].strip()) >= 72:
> self.error('First line of commit message (subject line) ' +
> 'is too long.')
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [edk2-devel] [PATCH 1/1] BaseTools/PatchCheck.py: Ignore CR and LF characters in subject length
2019-12-19 14:12 [PATCH 1/1] BaseTools/PatchCheck.py: Ignore CR and LF characters in subject length Philippe Mathieu-Daudé
2019-12-31 13:23 ` Philippe Mathieu-Daudé
@ 2020-01-02 9:39 ` Jordan Justen
2020-01-02 11:18 ` Philippe Mathieu-Daudé
1 sibling, 1 reply; 4+ messages in thread
From: Jordan Justen @ 2020-01-02 9:39 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, devel
Cc: Philippe Mathieu-Daude, Liming Gao, Yonghong Zhu, Zhichao Gao
On 2019-12-19 06:12:56, Philippe Mathieu-Daudé wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=113
>
> Strip the trailing characters before checking the subject line is
> less than 72 characters.
>
> Fixes: e61406708c83f
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
> ---
> Cc: Yonghong Zhu <yonghong.zhu@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> ---
> BaseTools/Scripts/PatchCheck.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
> index 2a4e6f603e79..b72e71963ea8 100755
> --- a/BaseTools/Scripts/PatchCheck.py
> +++ b/BaseTools/Scripts/PatchCheck.py
> @@ -196,7 +196,7 @@ class CommitMessageCheck:
> self.error('Empty commit message!')
> return
>
> - if count >= 1 and len(lines[0]) >= 72:
> + if count >= 1 and len(lines[0].strip()) >= 72:
I think we should use rstrip rather than strip. I tried to test this
with rstrip instead, by updating the commit message to have several
whitespace characters at the beginning.
Unfortunately, I think subject_prefix_re is eating more spaces at the
start of the line than it ought to.
The leading whitespace issue is probably a problem for another day, so
if you change it to rstrip, then:
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
> self.error('First line of commit message (subject line) ' +
> 'is too long.')
>
> --
> 2.21.0
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [edk2-devel] [PATCH 1/1] BaseTools/PatchCheck.py: Ignore CR and LF characters in subject length
2020-01-02 9:39 ` [edk2-devel] " Jordan Justen
@ 2020-01-02 11:18 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-01-02 11:18 UTC (permalink / raw)
To: Jordan Justen, devel; +Cc: Liming Gao, Yonghong Zhu, Zhichao Gao
On 1/2/20 10:39 AM, Jordan Justen wrote:
> On 2019-12-19 06:12:56, Philippe Mathieu-Daudé wrote:
>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=113
>>
>> Strip the trailing characters before checking the subject line is
>> less than 72 characters.
>>
>> Fixes: e61406708c83f
>> Cc: Liming Gao <liming.gao@intel.com>
>> Cc: Jordan Justen <jordan.l.justen@intel.com>
>> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
>> ---
>> Cc: Yonghong Zhu <yonghong.zhu@intel.com>
>> Cc: Zhichao Gao <zhichao.gao@intel.com>
>> ---
>> BaseTools/Scripts/PatchCheck.py | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
>> index 2a4e6f603e79..b72e71963ea8 100755
>> --- a/BaseTools/Scripts/PatchCheck.py
>> +++ b/BaseTools/Scripts/PatchCheck.py
>> @@ -196,7 +196,7 @@ class CommitMessageCheck:
>> self.error('Empty commit message!')
>> return
>>
>> - if count >= 1 and len(lines[0]) >= 72:
>> + if count >= 1 and len(lines[0].strip()) >= 72:
>
> I think we should use rstrip rather than strip. I tried to test this
> with rstrip instead, by updating the commit message to have several
> whitespace characters at the beginning.
>
> Unfortunately, I think subject_prefix_re is eating more spaces at the
> start of the line than it ought to.
Oh I haven't thought of that.
> The leading whitespace issue is probably a problem for another day, so
> if you change it to rstrip, then:
>
> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
OK, thanks Jordan!
>> self.error('First line of commit message (subject line) ' +
>> 'is too long.')
>>
>> --
>> 2.21.0
>>
>>
>>
>>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-01-02 11:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-19 14:12 [PATCH 1/1] BaseTools/PatchCheck.py: Ignore CR and LF characters in subject length Philippe Mathieu-Daudé
2019-12-31 13:23 ` Philippe Mathieu-Daudé
2020-01-02 9:39 ` [edk2-devel] " Jordan Justen
2020-01-02 11:18 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox