# HG changeset patch # User Matt Mackall # Date 2015-12-10 18:56:23 # Node ID e0465035def9e6eeaebf684df3e7f258f0d96663 # Parent b0d23a55f91e9e5d56a55738ad6a59cd5f65126a 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 --git a/contrib/check-commit b/contrib/check-commit --- a/contrib/check-commit +++ b/contrib/check-commit @@ -26,6 +26,8 @@ errors = [ "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"),