Patchwork check-commit: remove confusion between summary line and other headers

login
register
mail settings
Submitter Pierre-Yves David
Date Dec. 3, 2015, 3:38 a.m.
Message ID <1bd759b059d92f2d6917.1449113885@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/11779/
State Accepted
Headers show

Comments

Pierre-Yves David - Dec. 3, 2015, 3:38 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1446848862 18000
#      Fri Nov 06 17:27:42 2015 -0500
# Node ID 1bd759b059d92f2d6917776e65afee992a645625
# Parent  91905c0c47377520eebdedcfa6bcb73b77e24e0c
# EXP-Topic checkcommitheader
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 1bd759b059d9
check-commit: remove confusion between summary line and other headers

The pull url header can easily grow over 80 chars. The check-commit script was
confusing this with a too long summary line. We update the regular expression to
not match other header.
Augie Fackler - Dec. 3, 2015, 2:28 p.m.
On Wed, Dec 02, 2015 at 07:38:05PM -0800, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1446848862 18000
> #      Fri Nov 06 17:27:42 2015 -0500
> # Node ID 1bd759b059d92f2d6917776e65afee992a645625
> # Parent  91905c0c47377520eebdedcfa6bcb73b77e24e0c
> # EXP-Topic checkcommitheader
> # Available At http://hg.netv6.net/marmoute-wip/mercurial/
> #              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 1bd759b059d9
> check-commit: remove confusion between summary line and other headers

Queued this, thanks.

>
> The pull url header can easily grow over 80 chars. The check-commit script was
> confusing this with a too long summary line. We update the regular expression to
> not match other header.
>
> diff --git a/contrib/check-commit b/contrib/check-commit
> --- a/contrib/check-commit
> +++ b/contrib/check-commit
> @@ -25,11 +25,11 @@ errors = [
>      (r"^# .*\n(?!merge with )[^#]\S+[^:] ",
>       "summary line doesn't start with 'topic: '"),
>      (r"^# .*\n[A-Z][a-z]\S+", "don't capitalize summary lines"),
>      (r"^# .*\n[^\n]*: *[A-Z][a-z]\S+", "don't capitalize summary lines"),
>      (r"^# .*\n.*\.\s+$", "don't add trailing period on summary line"),
> -    (r"^# .*\n.{78,}", "summary line too long (limit is 78)"),
> +    (r"^# .*\n[^#].{77,}", "summary line too long (limit is 78)"),
>      (r"^\+\n \n", "adds double empty line"),
>      (r"^ \n\+\n", "adds double empty line"),
>      (r"^\+[ \t]+def [a-z]+_[a-z]", "adds a function with foo_bar naming"),
>  ]
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/contrib/check-commit b/contrib/check-commit
--- a/contrib/check-commit
+++ b/contrib/check-commit
@@ -25,11 +25,11 @@  errors = [
     (r"^# .*\n(?!merge with )[^#]\S+[^:] ",
      "summary line doesn't start with 'topic: '"),
     (r"^# .*\n[A-Z][a-z]\S+", "don't capitalize summary lines"),
     (r"^# .*\n[^\n]*: *[A-Z][a-z]\S+", "don't capitalize summary lines"),
     (r"^# .*\n.*\.\s+$", "don't add trailing period on summary line"),
-    (r"^# .*\n.{78,}", "summary line too long (limit is 78)"),
+    (r"^# .*\n[^#].{77,}", "summary line too long (limit is 78)"),
     (r"^\+\n \n", "adds double empty line"),
     (r"^ \n\+\n", "adds double empty line"),
     (r"^\+[ \t]+def [a-z]+_[a-z]", "adds a function with foo_bar naming"),
 ]