[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master bf52d55 6/7: Require a valid pre-commit hook
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master bf52d55 6/7: Require a valid pre-commit hook to exist |
Date: |
Thu, 16 Nov 2017 11:09:55 -0500 (EST) |
branch: master
commit bf52d556b9150c15210130ea09feb0dbb8dcef9b
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Require a valid pre-commit hook to exist
---
check_git_setup.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/check_git_setup.sh b/check_git_setup.sh
index 2488292..949ffb9 100755
--- a/check_git_setup.sh
+++ b/check_git_setup.sh
@@ -63,8 +63,13 @@ printf " 'readlink -f .git/hooks':\n"
printf " expected '%s'\n" "$PWD"/hooks
printf " observed '%s'\n" "$(readlink -f .git/hooks)"
+# Verify that .git/hooks is a symlink to the repository's hooks/
+# directory, and that it contains an executable pre-commit hook.
+# (There may be other hooks, but that one should always exist.)
+
case "$(readlink -f .git/hooks)" in
("$PWD/hooks")
+ [ -x ".git/hooks/pre-commit" ] || { printf "fail: missing hook\n"; exit 2;
}
printf "git hooks directory is properly symlinked\n"
exit 0
;;
- [lmi-commits] [lmi] master updated (2a7f972 -> c8de75e), Greg Chicares, 2017/11/16
- [lmi-commits] [lmi] master 0b4d84b 2/7: Prefer $PWD to $(pwd), Greg Chicares, 2017/11/16
- [lmi-commits] [lmi] master bf52d55 6/7: Require a valid pre-commit hook to exist,
Greg Chicares <=
- [lmi-commits] [lmi] master 68cc423 4/7: Regularize readlink options, Greg Chicares, 2017/11/16
- [lmi-commits] [lmi] master f92ba83 3/7: Allow backup of old .git/hooks to fail, Greg Chicares, 2017/11/16
- [lmi-commits] [lmi] master 1e1716f 5/7: Assert rather than assume, Greg Chicares, 2017/11/16
- [lmi-commits] [lmi] master 030f1c5 1/7: Fix incorrect command order, Greg Chicares, 2017/11/16
- [lmi-commits] [lmi] master c8de75e 7/7: Show symlink in a few of its many guises, Greg Chicares, 2017/11/16