aboutsummaryrefslogtreecommitdiffstats
path: root/build-aux/git-hooks/commit-msg
diff options
context:
space:
mode:
authorK. Handa2014-12-29 22:54:07 +0900
committerK. Handa2014-12-29 22:54:07 +0900
commitbb5e7861593815f912c21b2aee1e4be9a6cc64a2 (patch)
tree080066ad78a5de3f2a8a3fbfbc3e3d242c1c16b7 /build-aux/git-hooks/commit-msg
parent3fa5f4416ed219688b9d0e370edf40dce15a5de3 (diff)
parent8e0b2702ce8ad593a2098ae8028728ed137fb26c (diff)
downloademacs-bb5e7861593815f912c21b2aee1e4be9a6cc64a2.tar.gz
emacs-bb5e7861593815f912c21b2aee1e4be9a6cc64a2.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs.
Diffstat (limited to 'build-aux/git-hooks/commit-msg')
-rwxr-xr-xbuild-aux/git-hooks/commit-msg16
1 files changed, 10 insertions, 6 deletions
diff --git a/build-aux/git-hooks/commit-msg b/build-aux/git-hooks/commit-msg
index 2e3e4f21cda..9b6179ee613 100755
--- a/build-aux/git-hooks/commit-msg
+++ b/build-aux/git-hooks/commit-msg
@@ -87,6 +87,15 @@ exec $awk '
87 status = 1 87 status = 1
88 } 88 }
89 89
90 {
91 # Expand tabs to spaces for length calculations etc.
92 while (match($0, /\t/)) {
93 before_tab = substr($0, 1, RSTART - 1)
94 after_tab = substr($0, RSTART + 1)
95 $0 = sprintf("%s%*s%s", before_tab, 8 - (RSTART - 1) % 8, "", after_tab)
96 }
97 }
98
90 78 < length && $0 ~ space { 99 78 < length && $0 ~ space {
91 print "Line longer than 78 characters in commit message" 100 print "Line longer than 78 characters in commit message"
92 status = 1 101 status = 1
@@ -103,12 +112,7 @@ exec $awk '
103 } 112 }
104 113
105 $0 ~ non_print { 114 $0 ~ non_print {
106 if (gsub(/\t/, "")) { 115 print "Unprintable character in commit message"
107 print "Tab in commit message; please use spaces instead"
108 }
109 if ($0 ~ non_print) {
110 print "Unprintable character in commit message"
111 }
112 status = 1 116 status = 1
113 } 117 }
114 118