[PATCH] check-commit: try to curb bad commit summary keywords

Matt Mackall mpm at selenic.com
Thu Dec 10 19:25:35 UTC 2015


# HG changeset patch
# User Matt Mackall <mpm at 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"),


More information about the Mercurial-devel mailing list