summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-07-07 18:49:50 +0200
committerPeter Wu <peter@lekensteyn.nl>2015-07-07 19:32:09 +0200
commita9c15554de5dfb0f8565e8b50f40562f6ce4a816 (patch)
tree9281b09302674c5091e5c214af4d92accff9a64c
parent693abf252741abea667f96cb67f3a11ef35a054e (diff)
downloadlibgcrypt-a9c15554de5dfb0f8565e8b50f40562f6ce4a816.tar.gz
build: ignore scissor line for the commit-msg hook
* build-aux/git-hooks/commit-msg: Stop processing more lines when the scissor line is encountered. -- This allows the command `git commit -v` to work even if the code is longer than 72 characters. Note that comments are already ignored by the previous line. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
-rwxr-xr-xbuild-aux/git-hooks/commit-msg6
1 files changed, 6 insertions, 0 deletions
diff --git a/build-aux/git-hooks/commit-msg b/build-aux/git-hooks/commit-msg
index 5a697c7a..3ca918b2 100755
--- a/build-aux/git-hooks/commit-msg
+++ b/build-aux/git-hooks/commit-msg
@@ -86,11 +86,17 @@ sub check_msg($$)
2 <= @line && length $line[1]
and return 'second line must be empty';
+ # See git-commit(1), this is the --cleanup=scissors option. Everything
+ # after and including this line gets ignored.
+ my $marker = '# ------------------------ >8 ------------------------';
+
# Limit line length to allow for the ChangeLog's leading TAB.
foreach my $line (@line)
{
72 < length $line && $line =~ /^[^#]/
and return 'line longer than 72 characters';
+
+ last if $line eq $marker;
}
return '';