We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d83042 commit 9929604Copy full SHA for 9929604
githooks/pre-commit
@@ -0,0 +1,12 @@
1
+#!/bin/bash
2
+
3
+cd "$(git rev-parse --show-toplevel)"
4
+DISALLOWED_PATTERN='KJ_DBG'
5
6
+if git diff-index -G"$DISALLOWED_PATTERN" --cached HEAD --diff-filter=AM -U0 | grep -i --color -E "$DISALLOWED_PATTERN"
7
+then
8
+ echo -e "\nERROR, KJ_DBG is not allowed in checked-in source code:"
9
+ echo -e " see https://github.com/capnproto/capnproto/blob/v2/c%2B%2B/src/kj/debug.h#L42\n"
10
+ echo -e "To commit anyway, use --no-verify\n"
11
+ exit 1
12
+fi
0 commit comments