summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-12-28 10:17:48 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2014-12-28 10:17:48 -0800
commit9fb9136398821ed5f3a8b4405bbc222964f54028 (patch)
tree3d8f33383e16220bc72700747031256fa70bb981 /build-aux
parentc12598a62e2e31f3377c52fe4b283b710ce1451e (diff)
parentf646cd99e5f2181cbaef365d2f8262789a515e45 (diff)
downloademacs-9fb9136398821ed5f3a8b4405bbc222964f54028.tar.gz
Merge from origin/emacs-24
f646cd9 * build-aux/git-hooks/commit-msg: Allow tabs.
Diffstat (limited to 'build-aux')
-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 '
status = 1
}
+ {
+ # Expand tabs to spaces for length calculations etc.
+ while (match($0, /\t/)) {
+ before_tab = substr($0, 1, RSTART - 1)
+ after_tab = substr($0, RSTART + 1)
+ $0 = sprintf("%s%*s%s", before_tab, 8 - (RSTART - 1) % 8, "", after_tab)
+ }
+ }
+
78 < length && $0 ~ space {
print "Line longer than 78 characters in commit message"
status = 1
@@ -103,12 +112,7 @@ exec $awk '
}
$0 ~ non_print {
- if (gsub(/\t/, "")) {
- print "Tab in commit message; please use spaces instead"
- }
- if ($0 ~ non_print) {
- print "Unprintable character in commit message"
- }
+ print "Unprintable character in commit message"
status = 1
}