File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/sh
22
3+ DISCLAIMER=" Remember that you can ignore these checks and force-commit with 'git commit -n'"
4+
35# This can be used in a comment as a reminder to self.
46git diff-index --cached -S " DONOTCOMMIT" HEAD --patch --exit-code " :!githooks" \
5- || { echo ; echo " Have you forgotten about the “DONOTCOMMIT”?" ; exit 1; }
7+ || { echo ; echo " Have you forgotten about the “DONOTCOMMIT”?" ; echo $DISCLAIMER ; exit 1; }
8+
9+ git diff-index --cached HEAD -u . \
10+ | egrep -C3 " ^-.*DONOTCHANGETHIS" \
11+ && { echo " There is a changed line with DONOTCHANGETHIS in it" ; echo $DISCLAIMER ; exit 1; } \
12+ || true
613
714# Eldev functions can be used during development, but must not be committed.
815git diff-index --cached -S " eldev-" HEAD --patch --exit-code " :!githooks" " :!Eldev" \
9- || { echo ; echo " Don't commit code relying on Eldev!" ; exit 1; }
16+ || { echo ; echo " Don't commit code relying on Eldev!" ; echo $DISCLAIMER ; exit 1; }
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ DISCLAIMER=" Remember that you can ignore these checks and force-push with 'git push --no-verify'"
4+
5+ REMOTE=$1
6+
7+ git log " $REMOTE /HEAD..HEAD" \
8+ | egrep -C5 " DONOTPUSH" \
9+ && { echo " There is a not-yet-pushed commit with DONOTPUSH in its message" ; echo $DISCLAIMER ; exit 1; } \
10+ || true
You can’t perform that action at this time.
0 commit comments