check-commit: try to curb bad commit summary keywords
authorMatt Mackall <mpm@selenic.com>
Thu, 10 Dec 2015 12:56:23 -0600
changeset 27692 e0465035def9
parent 27691 b0d23a55f91e
child 27693 2b9126d6588b
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.
contrib/check-commit
--- a/contrib/check-commit	Fri Jan 08 14:47:02 2016 -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-z0-9-]\S*: ",
+     "summary keyword should be most user-relevant one-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"),