aboutsummaryrefslogtreecommitdiffstats
path: root/build-aux/git-hooks/commit-msg
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux/git-hooks/commit-msg')
-rwxr-xr-xbuild-aux/git-hooks/commit-msg19
1 files changed, 11 insertions, 8 deletions
diff --git a/build-aux/git-hooks/commit-msg b/build-aux/git-hooks/commit-msg
index 13a05351ded..6721d53a582 100755
--- a/build-aux/git-hooks/commit-msg
+++ b/build-aux/git-hooks/commit-msg
@@ -63,7 +63,7 @@ exec $awk '
63 /^#/ { next } 63 /^#/ { next }
64 64
65 !/^.*$/ { 65 !/^.*$/ {
66 print "Invalid character (not UTF-8) in commit message; see 'CONTRIBUTE'" 66 print "Invalid character (not UTF-8) in commit message"
67 status = 1 67 status = 1
68 } 68 }
69 69
@@ -77,13 +77,13 @@ exec $awk '
77 sub(/^squash! /, "") 77 sub(/^squash! /, "")
78 78
79 if ($0 ~ "^" space) { 79 if ($0 ~ "^" space) {
80 print "White space at start of commit message'\''s first line; see 'CONTRIBUTE'" 80 print "White space at start of commit message'\''s first line"
81 status = 1 81 status = 1
82 } 82 }
83 } 83 }
84 84
85 nlines == 2 && $0 ~ non_space { 85 nlines == 2 && $0 ~ non_space {
86 print "Nonempty second line in commit message; see 'CONTRIBUTE'" 86 print "Nonempty second line in commit message"
87 status = 1 87 status = 1
88 } 88 }
89 89
@@ -97,30 +97,33 @@ exec $awk '
97 } 97 }
98 98
99 78 < length && $0 ~ space { 99 78 < length && $0 ~ space {
100 print "Line longer than 78 characters in commit message; see 'CONTRIBUTE'" 100 print "Line longer than 78 characters in commit message"
101 status = 1 101 status = 1
102 } 102 }
103 103
104 140 < length { 104 140 < length {
105 print "Word longer than 140 characters in commit message; see 'CONTRIBUTE'" 105 print "Word longer than 140 characters in commit message"
106 status = 1 106 status = 1
107 } 107 }
108 108
109 /^Signed-off-by: / { 109 /^Signed-off-by: / {
110 print "'\''Signed-off-by:'\'' in commit message; see 'CONTRIBUTE'" 110 print "'\''Signed-off-by:'\'' in commit message"
111 status = 1 111 status = 1
112 } 112 }
113 113
114 $0 ~ non_print { 114 $0 ~ non_print {
115 print "Unprintable character in commit message; see 'CONTRIBUTE'" 115 print "Unprintable character in commit message"
116 status = 1 116 status = 1
117 } 117 }
118 118
119 END { 119 END {
120 if (nlines == 0) { 120 if (nlines == 0) {
121 print "Empty commit message; see 'CONTRIBUTE'" 121 print "Empty commit message"
122 status = 1 122 status = 1
123 } 123 }
124 if (status != 0) {
125 print "Commit aborted; please see the file 'CONTRIBUTE'"
126 }
124 exit status 127 exit status
125 } 128 }
126' <"$1" 129' <"$1"