public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: Philippe Mathieu-Daude <philmd@redhat.com>, devel@edk2.groups.io
Cc: Bob Feng <bob.c.feng@intel.com>,
	Liming Gao <liming.gao@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Leif Lindholm <leif.lindholm@linaro.org>
Subject: Re: [PATCH 1/6] BaseTools/PatchCheck: Stop parsing commit message after --- separator
Date: Thu, 5 Dec 2019 20:02:44 +0100	[thread overview]
Message-ID: <b6252a43-b24a-7286-2524-903710cf9d21@redhat.com> (raw)
In-Reply-To: <20191205161234.25071-2-philmd@redhat.com>

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 <bob.c.feng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
> ---
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> ---
>  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 <lersek@redhat.com>

Thanks
Laszlo


  reply	other threads:[~2019-12-05 19:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 16:12 [PATCH 0/6] BaseTools: Improve PatchCheck and add GitPostCommitHook Philippe Mathieu-Daudé
2019-12-05 16:12 ` [PATCH 1/6] BaseTools/PatchCheck: Stop parsing commit message after --- separator Philippe Mathieu-Daudé
2019-12-05 19:02   ` Laszlo Ersek [this message]
2019-12-05 16:12 ` [PATCH 2/6] BaseTools/PatchCheck: Add a --quiet option Philippe Mathieu-Daudé
2019-12-05 16:12 ` [PATCH 3/6] BaseTools/Scripts: Add GitPostCommitHook.py Philippe Mathieu-Daudé
2019-12-05 19:24   ` Laszlo Ersek
2019-12-05 16:12 ` [PATCH 4/6] BaseTools/PatchCheck: Extract the run_git() function Philippe Mathieu-Daudé
2019-12-05 16:12 ` [PATCH 5/6] BaseTools/PatchCheck: Add printw() function to print warnings Philippe Mathieu-Daudé
2019-12-05 16:12 ` [PATCH 6/6] BaseTools/PatchCheck: Allow to print colored warnings Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b6252a43-b24a-7286-2524-903710cf9d21@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox