Skip to content

Commit cabf3ab

Browse files
committed
Add a simplistic but useful Git hook.
1 parent 7c42e3c commit cabf3ab

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: githooks/pre-commit

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
# This can be used in a comment as a reminder to self.
4+
git diff-index --cached -S "DONOTCOMMIT" HEAD --patch --exit-code ":!githooks" \
5+
|| { echo; echo "Have you forgotten about the “DONOTCOMMIT”?"; exit 1; }
6+
7+
# Eldev functions can be used during development, but must not be committed.
8+
git diff-index --cached -S "eldev-" HEAD --patch --exit-code ":!githooks" ":!Eldev" \
9+
|| { echo; echo "Don't commit code relying on Eldev!"; exit 1; }

0 commit comments

Comments
 (0)