]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: prevent trailing period at first line of a commit message
authorBernhard Voelker <mail@bernhard-voelker.de>
Wed, 13 Feb 2013 23:28:06 +0000 (00:28 +0100)
committerBernhard Voelker <mail@bernhard-voelker.de>
Thu, 14 Feb 2013 22:19:57 +0000 (23:19 +0100)
* scripts/git-hooks/commit-msg (bad_first_line): Return an error
message if the first line of a commit message ends with a period.

scripts/git-hooks/commit-msg

index 1732103804352145c9ab37126adc3686af475c48..3e91e8ea410d239b73bcee703f05798ca8f5936a 100755 (executable)
@@ -62,6 +62,9 @@ sub bad_first_line($)
   $line =~ /:/
     or return 'missing colon on first line of log message';
 
+  $line =~ /\.$/
+    and return 'do not use a period "." at the end of the first line';
+
   # The token(s) before the colon on the first line must be on our list
   # Tokens may be space- or comma-separated.
   (my $pre_colon = $line) =~ s/:.*//;