[PATCH] check-commit: check capitalization in summary lines

Eric Sumner ericsumner at fb.com
Thu Feb 5 22:28:34 UTC 2015


# HG changeset patch
# User Eric Sumner <ericsumner at fb.com>
# Date 1423174148 28800
#      Thu Feb 05 14:09:08 2015 -0800
# Node ID 5098f8d2127ad5bb7dbd1534a707c850051a8589
# Parent  7f375d2de945e0e773541773db9c334f9e9f75c6
check-commit: check capitalization in summary lines

At the moment, check-commit will complain about the topic being capitalized,
but not the summary that comes after it.  This diff corrects that deficiency.

diff --git a/contrib/check-commit b/contrib/check-commit
--- a/contrib/check-commit
+++ b/contrib/check-commit
@@ -25,6 +25,7 @@
     (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"),
     (r"^\+\n \n", "adds double empty line"),


More information about the Mercurial-devel mailing list