-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
#!/bin/sh | ||
|
||
DISCLAIMER="Remember that you can ignore these checks and force-commit with 'git commit -n'" | ||
|
||
# This can be used in a comment as a reminder to self. | ||
git diff-index --cached -S "DONOTCOMMIT" HEAD --patch --exit-code ":!githooks" \ | ||
|| { echo; echo "Have you forgotten about the “DONOTCOMMIT”?"; exit 1; } | ||
|| { echo; echo "Have you forgotten about the “DONOTCOMMIT”?"; echo $DISCLAIMER; exit 1; } | ||
|
||
git diff-index --cached HEAD -u . \ | ||
| egrep -C3 "^-.*DONOTCHANGETHIS" \ | ||
&& { echo "There is a changed line with DONOTCHANGETHIS in it"; echo $DISCLAIMER; exit 1; } \ | ||
|| true | ||
|
||
# Eldev functions can be used during development, but must not be committed. | ||
git diff-index --cached -S "eldev-" HEAD --patch --exit-code ":!githooks" ":!Eldev" \ | ||
|| { echo; echo "Don't commit code relying on Eldev!"; exit 1; } | ||
|| { echo; echo "Don't commit code relying on Eldev!"; echo $DISCLAIMER; exit 1; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
DISCLAIMER="Remember that you can ignore these checks and force-push with 'git push --no-verify'" | ||
|
||
REMOTE=$1 | ||
|
||
git log "$REMOTE/HEAD..HEAD" \ | ||
| egrep -C5 "DONOTPUSH" \ | ||
&& { echo "There is a not-yet-pushed commit with DONOTPUSH in its message"; echo $DISCLAIMER; exit 1; } \ | ||
|| true |