From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web11.1905.1575572574894089660 for ; Thu, 05 Dec 2019 11:02:55 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Z1nAi2fG; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575572574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uNzOKyjjPwfhFtsVysZIJIAQ9sHxDhkt32uH4l4e0OM=; b=Z1nAi2fGXoQi84BgxBVuK1Z7RgCOPYZL1mBk4cSvQQ4YO8T2igad9IYdPVKaTh/DcaikrF sDEMIW+KRgjIxIB028yWzLYC1r2n8RayaS0IdsBsu8LvqOt1/pDWOtJ4t3DeEw8jjCHoad hJ5uWOMMyw+VyzGqDNMly/X5KRCQZS4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-186-TdsXJP0HMOGAtIH7FxmoEA-1; Thu, 05 Dec 2019 14:02:50 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E43F41005502; Thu, 5 Dec 2019 19:02:48 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-62.ams2.redhat.com [10.36.116.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEED160136; Thu, 5 Dec 2019 19:02:44 +0000 (UTC) Subject: Re: [PATCH 1/6] BaseTools/PatchCheck: Stop parsing commit message after --- separator To: Philippe Mathieu-Daude , devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Ard Biesheuvel , Leif Lindholm References: <20191205161234.25071-1-philmd@redhat.com> <20191205161234.25071-2-philmd@redhat.com> From: "Laszlo Ersek" Message-ID: Date: Thu, 5 Dec 2019 20:02:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20191205161234.25071-2-philmd@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: TdsXJP0HMOGAtIH7FxmoEA-1 X-Mimecast-Spam-Score: 0 Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 12/05/19 17:12, Philippe Mathieu-Daude wrote: > git-format-patch uses the '---' separator to mark the end of the > commit message. Anything after the separator is stripped by git-am, > it is pointless to check this part. > > Cc: Bob Feng > Cc: Liming Gao > Signed-off-by: Philippe Mathieu-Daude > --- > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Cc: Leif Lindholm > --- > BaseTools/Scripts/PatchCheck.py | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py > index 2a4e6f603e79..8bcf857a7d15 100755 > --- a/BaseTools/Scripts/PatchCheck.py > +++ b/BaseTools/Scripts/PatchCheck.py > @@ -209,6 +209,10 @@ class CommitMessageCheck: > 'empty.') > > for i in range(2, count): > + if lines[i].strip() == '---': > + # '---' marks the end of the commit message. > + count = i > + break > if (len(lines[i]) >= 76 and > len(lines[i].split()) > 1 and > not lines[i].startswith('git-svn-id:')): > This shortcut seems to prevent two checks (on the affected area): - line length check, - separation of the signature block by an empty line. While preventing the second check in the affected area certainly makes sense, I think preserving the line length check would be nice. For example, "git-notes" places notes in that area, and if someone uses a text editor configuration in which hard line breaks are not inserted, we could end up with a humongous note there. Even though it would not be applied by git-am, I think we should not get such notes posted to the list. (This text editor configuration is not theoretical: earlier we used to get actual commit messages with no hard line breaks.) So... I don't want to complicate this for you needlessly, but you mention in the series blurb that this patch is a bugfix. What is the bug? Hmmm... does the check (mistakenly) fire if the diffstat is very wide? (It can easily be very wide, because our pathnames are long.) Hmmm. Okay, I agree that's a much more practical problem than what I describe above. So: Reviewed-by: Laszlo Ersek Thanks Laszlo