Skip to content

Commit 2a4739d

Browse files
committed
pre-commit hook to check for KJ_DBG in source files
1 parent d5b74d0 commit 2a4739d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

githooks/pre-commit

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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, disallowed text patterns detected."
9+
echo -e "To commit anyway, use --no-verify\n"
10+
exit 1
11+
fi

0 commit comments

Comments
 (0)