<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">- Bret<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Michael D Kinney via groups.io <michael.d.kinney=intel.com@groups.io><br>
<b>Sent:</b> Wednesday, July 7, 2021 8:49:00 PM<br>
<b>To:</b> devel@edk2.groups.io <devel@edk2.groups.io><br>
<b>Cc:</b> Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Yuwei <yuwei.chen@intel.com><br>
<b>Subject:</b> [EXTERNAL] [edk2-devel] [Patch 1/3] BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.py</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Mergify adds merge commits to a PR when processing PRs using<br>
the queue feature with auto rebase. Update PatchCheck.py<br>
to ignore commit message issues with these merge commits.<br>
These merge commits are not added to the base branch when<br>
the PR is merged by Mergify.<br>
<br>
Cc: Bob Feng <bob.c.feng@intel.com><br>
Cc: Liming Gao <gaoliming@byosoft.com.cn><br>
Cc: Yuwei Chen <yuwei.chen@intel.com><br>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com><br>
---<br>
BaseTools/Scripts/PatchCheck.py | 18 ++++++++++++------<br>
1 file changed, 12 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py<br>
index 80754e763c5a..63e6223f8ebc 100755<br>
--- a/BaseTools/Scripts/PatchCheck.py<br>
+++ b/BaseTools/Scripts/PatchCheck.py<br>
@@ -1,7 +1,7 @@<br>
## @file<br>
# Check a patch for various format issues<br>
#<br>
-# Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.<BR><br>
+# Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR><br>
# Copyright (C) 2020, Red Hat, Inc.<BR><br>
# Copyright (c) 2020, ARM Ltd. All rights reserved.<BR><br>
#<br>
@@ -89,22 +89,28 @@ class EmailAddressCheck:<br>
class CommitMessageCheck:<br>
"""Checks the contents of a git commit message."""<br>
<br>
- def __init__(self, subject, message):<br>
+ def __init__(self, subject, message, author_email):<br>
self.ok = True<br>
<br>
if subject is None and message is None:<br>
self.error('Commit message is missing!')<br>
return<br>
<br>
+ MergifyMerge = False<br>
+ if "mergify[bot]@users.noreply.github.com" in author_email:<br>
+ if "Merge branch" in subject:<br>
+ MergifyMerge = True<br>
+<br>
self.subject = subject<br>
self.msg = message<br>
<br>
print (subject)<br>
<br>
self.check_contributed_under()<br>
- self.check_signed_off_by()<br>
- self.check_misc_signatures()<br>
- self.check_overall_format()<br>
+ if not MergifyMerge:<br>
+ self.check_signed_off_by()<br>
+ self.check_misc_signatures()<br>
+ self.check_overall_format()<br>
self.report_message_result()<br>
<br>
url = '<a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FCommit-Message-Format&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C44bf20b900a8463872f608d941c36036%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637613129659549071%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ScoSoLs0hgaj7DOtCjE1uevYTX2oAHOqJOHKJYZQ%2BGw%3D&reserved=0">https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FCommit-Message-Format&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C44bf20b900a8463872f608d941c36036%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637613129659549071%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ScoSoLs0hgaj7DOtCjE1uevYTX2oAHOqJOHKJYZQ%2BGw%3D&reserved=0</a>'<br>
@@ -522,7 +528,7 @@ class CheckOnePatch:<br>
email_check = EmailAddressCheck(self.author_email, 'Author')<br>
email_ok = email_check.ok<br>
<br>
- msg_check = CommitMessageCheck(self.commit_subject, self.commit_msg)<br>
+ msg_check = CommitMessageCheck(self.commit_subject, self.commit_msg, self.author_email)<br>
msg_ok = msg_check.ok<br>
<br>
diff_ok = True<br>
-- <br>
2.32.0.windows.1<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
</span></font></div>
</body>
</html>
<div width="1" style="color:white;clear:both">_._,_._,_</div> <hr> Groups.io Links:<p> You receive all messages sent to this group. <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/77580">View/Reply Online (#77580)</a> | | <a target="_blank" href="https://groups.io/mt/84061192/1813853">Mute This Topic</a> | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br> <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> | <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a> [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>