Patchwork check-commit: try to curb bad commit summary keywords

login
register
mail settings
Submitter Matt Mackall
Date Dec. 10, 2015, 7:25 p.m.
Message ID <cd8bf16121aa811d2784.1449775535@ruin.waste.org>
Download mbox | patch
Permalink /patch/11959/
State Superseded
Commit e0465035def9e6eeaebf684df3e7f258f0d96663
Delegated to: Pierre-Yves David
Headers show

Comments

Matt Mackall - Dec. 10, 2015, 7:25 p.m.
# HG changeset patch
# User Matt Mackall <mpm@selenic.com>
# Date 1449773783 21600
#      Thu Dec 10 12:56:23 2015 -0600
# Node ID cd8bf16121aa811d2784e61298a7eac061df5b55
# Parent  aef5b606d3ee3db5504d694df0a3e3aaa7b7e07b
check-commit: try to curb bad commit summary keywords

The goal of commit summary keywords is to help us sort, categorize,
and filter our voluminous commits for our release notes in a way
that's helpful and meaningful to end users. Lately, there have been a
huge number of "keywords" that are neither words nor particularly key.

This patch tries to discourage that by narrowing the allowed
characters to alphanumeric. In particular, it doesn't allow "."
(method, function names, and file extensions) and "/" (filenames). It
also gives a short reminder of what a keyword ought to be.
Pierre-Yves David - Dec. 10, 2015, 8:20 p.m.
On 12/10/2015 07:25 PM, Matt Mackall wrote:
> # HG changeset patch
> # User Matt Mackall <mpm@selenic.com>
> # Date 1449773783 21600
> #      Thu Dec 10 12:56:23 2015 -0600
> # Node ID cd8bf16121aa811d2784e61298a7eac061df5b55
> # Parent  aef5b606d3ee3db5504d694df0a3e3aaa7b7e07b
> check-commit: try to curb bad commit summary keywords

Can I ask you for a test?
Matt Mackall - Dec. 10, 2015, 10:33 p.m.
On Thu, 2015-12-10 at 20:20 +0000, Pierre-Yves David wrote:
> 
> On 12/10/2015 07:25 PM, Matt Mackall wrote:
> > # HG changeset patch
> > # User Matt Mackall <mpm@selenic.com>
> > # Date 1449773783 21600
> > #      Thu Dec 10 12:56:23 2015 -0600
> > # Node ID cd8bf16121aa811d2784e61298a7eac061df5b55
> > # Parent  aef5b606d3ee3db5504d694df0a3e3aaa7b7e07b
> > check-commit: try to curb bad commit summary keywords
> 
> Can I ask you for a test?

As of Dec 2, you may be the only person who cannot:

http://markmail.org/message/dtfufbd3a5r66kvb

-- 
Mathematics is the supreme nostalgia of our time.
timeless - Dec. 11, 2015, 7:15 a.m.
What is the keyword for `p4` commits? :)

On Thu, Dec 10, 2015 at 2:25 PM, Matt Mackall <mpm@selenic.com> wrote:
> # HG changeset patch
> # User Matt Mackall <mpm@selenic.com>
> # Date 1449773783 21600
> #      Thu Dec 10 12:56:23 2015 -0600
> # Node ID cd8bf16121aa811d2784e61298a7eac061df5b55
> # Parent  aef5b606d3ee3db5504d694df0a3e3aaa7b7e07b
> check-commit: try to curb bad commit summary keywords
>
> The goal of commit summary keywords is to help us sort, categorize,
> and filter our voluminous commits for our release notes in a way
> that's helpful and meaningful to end users. Lately, there have been a
> huge number of "keywords" that are neither words nor particularly key.
>
> This patch tries to discourage that by narrowing the allowed
> characters to alphanumeric. In particular, it doesn't allow "."
> (method, function names, and file extensions) and "/" (filenames). It
> also gives a short reminder of what a keyword ought to be.
>
> diff -r aef5b606d3ee -r cd8bf16121aa contrib/check-commit
> --- a/contrib/check-commit      Sun Dec 06 22:22:09 2015 -0800
> +++ b/contrib/check-commit      Thu Dec 10 12:56:23 2015 -0600
> @@ -26,6 +26,8 @@
>       "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]*\n\S*[^A-Za-z-]\S*: ",
> +     "keywords should be the most user-relevant single-word command or topic"),
>      (r"^# .*\n.*\.\s+$", "don't add trailing period on summary line"),
>      (r"^# .*\n[^#].{77,}", "summary line too long (limit is 78)"),
>      (r"^\+\n \n", "adds double empty line"),
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
Augie Fackler - Dec. 11, 2015, 3:56 p.m.
On Thu, Dec 10, 2015 at 01:25:35PM -0600, Matt Mackall wrote:
> # HG changeset patch
> # User Matt Mackall <mpm@selenic.com>
> # Date 1449773783 21600
> #      Thu Dec 10 12:56:23 2015 -0600
> # Node ID cd8bf16121aa811d2784e61298a7eac061df5b55
> # Parent  aef5b606d3ee3db5504d694df0a3e3aaa7b7e07b
> check-commit: try to curb bad commit summary keywords
>
> The goal of commit summary keywords is to help us sort, categorize,
> and filter our voluminous commits for our release notes in a way
> that's helpful and meaningful to end users. Lately, there have been a
> huge number of "keywords" that are neither words nor particularly key.
>
> This patch tries to discourage that by narrowing the allowed
> characters to alphanumeric. In particular, it doesn't allow "."
> (method, function names, and file extensions) and "/" (filenames). It
> also gives a short reminder of what a keyword ought to be.
>
> diff -r aef5b606d3ee -r cd8bf16121aa contrib/check-commit
> --- a/contrib/check-commit	Sun Dec 06 22:22:09 2015 -0800
> +++ b/contrib/check-commit	Thu Dec 10 12:56:23 2015 -0600
> @@ -26,6 +26,8 @@
>       "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]*\n\S*[^A-Za-z-]\S*: ",
> +     "keywords should be the most user-relevant single-word command or topic"),

This at minimum needs to allow things like bundle2, p4, etc.

Also, some sort of a test might be nice, though I won't insist on it.

>      (r"^# .*\n.*\.\s+$", "don't add trailing period on summary line"),
>      (r"^# .*\n[^#].{77,}", "summary line too long (limit is 78)"),
>      (r"^\+\n \n", "adds double empty line"),
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
Matt Mackall - Dec. 11, 2015, 5:13 p.m.
On Fri, 2015-12-11 at 02:15 -0500, timeless wrote:
> What is the keyword for `p4` commits? :)

If you're trying to draw my attention to the fact that the description
says alphanumeric and the regex only has alpha, you're being oblique.

-- 
Mathematics is the supreme nostalgia of our time.

Patch

diff -r aef5b606d3ee -r cd8bf16121aa contrib/check-commit
--- a/contrib/check-commit	Sun Dec 06 22:22:09 2015 -0800
+++ b/contrib/check-commit	Thu Dec 10 12:56:23 2015 -0600
@@ -26,6 +26,8 @@ 
      "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]*\n\S*[^A-Za-z-]\S*: ",
+     "keywords should be the most user-relevant single-word command or topic"),
     (r"^# .*\n.*\.\s+$", "don't add trailing period on summary line"),
     (r"^# .*\n[^#].{77,}", "summary line too long (limit is 78)"),
     (r"^\+\n \n", "adds double empty line"),