coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] scripts: commit-msg: recognize Git cut_lines


From: Pádraig Brady
Subject: Re: [PATCH] scripts: commit-msg: recognize Git cut_lines
Date: Sun, 20 Nov 2022 18:25:00 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.0

On 20/11/2022 11:25, Arsen Arsenović wrote:
This prevents spurious failures from happening when someone sets
commit.verbose or passes -v to commit.
---
Hi,

When working on my previous patch, I was running into commit-msg mistakenly
triggering on lines that are part of the diff that can be optionally added
to COMMIT_EDITMSG via commit.verbose (which I have set globally, to review
patches as I commit them).

This patch prevents that from happening.

For the source of the cut_line, see wt-status.c:23 (cut_line) in the Git
sources.

Have a good day.

  scripts/git-hooks/commit-msg | 1 +
  1 file changed, 1 insertion(+)

diff --git a/scripts/git-hooks/commit-msg b/scripts/git-hooks/commit-msg
index 8b06559..da094c9 100755
--- a/scripts/git-hooks/commit-msg
+++ b/scripts/git-hooks/commit-msg
@@ -120,6 +120,7 @@ sub check_msg($$)
    my $max_len = 72;
    foreach my $line (@line)
      {
+      last if $line =~ '.*-{24} >8 -{24}$';

Ah a scissors :)
Pushed.

thanks!
Pádraig



reply via email to

[Prev in Thread] Current Thread [Next in Thread]