* build-aux/git-hooks/commit-msg: Allow tabs.
Treat them as if they were expanded to spaces, with tab stops every 8 columns.
This commit is contained in:
parent
39eaef9f8b
commit
f646cd99e5
2 changed files with 16 additions and 6 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2014-12-28 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
|
* build-aux/git-hooks/commit-msg: Allow tabs.
|
||||||
|
Treat them as if they were expanded to spaces, with tab stops
|
||||||
|
every 8 columns.
|
||||||
|
|
||||||
2014-12-17 Paul Eggert <eggert@cs.ucla.edu>
|
2014-12-17 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
* .gitignore: Ignore /conftest*.
|
* .gitignore: Ignore /conftest*.
|
||||||
|
|
|
@ -87,6 +87,15 @@ exec $awk '
|
||||||
status = 1
|
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 {
|
78 < length && $0 ~ space {
|
||||||
print "Line longer than 78 characters in commit message"
|
print "Line longer than 78 characters in commit message"
|
||||||
status = 1
|
status = 1
|
||||||
|
@ -103,12 +112,7 @@ exec $awk '
|
||||||
}
|
}
|
||||||
|
|
||||||
$0 ~ non_print {
|
$0 ~ non_print {
|
||||||
if (gsub(/\t/, "")) {
|
print "Unprintable character in commit message"
|
||||||
print "Tab in commit message; please use spaces instead"
|
|
||||||
}
|
|
||||||
if ($0 ~ non_print) {
|
|
||||||
print "Unprintable character in commit message"
|
|
||||||
}
|
|
||||||
status = 1
|
status = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue