[Cmake-commits] CMake branch, hooks, updated. 19f86ec15cc36f3edd30210724b0d11b080d9961
Brad King
brad.king at kitware.com
Wed Sep 15 09:24:50 EDT 2010
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, hooks has been updated
via 19f86ec15cc36f3edd30210724b0d11b080d9961 (commit)
from f83a32feb68c5b6ee2e98f54f016daed86a7fd8f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=19f86ec15cc36f3edd30210724b0d11b080d9961
commit 19f86ec15cc36f3edd30210724b0d11b080d9961
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Sep 15 09:22:03 2010 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Sep 15 09:22:03 2010 -0400
pre-commit: Allow submodule check to be disabled
If hooks.submodule is 'false' disable all checks. If an individual
hooks.<module>.update is 'true' then accept any update for that module.
Leave these options out of the hints printed. Developers that know what
they are doing will be able to find them by reading the hook source.
diff --git a/pre-commit b/pre-commit
index afaba6c..bee9c90 100755
--- a/pre-commit
+++ b/pre-commit
@@ -175,16 +175,24 @@ short_commit() {
}
lookup_config_module_update() {
+ update=$(git config "hooks.$1.update")
+
+ # Special-case "true" to accept any update.
+ test "{$update}" = "{true}" && echo '.' && return
+
# Format is "aaaaaa..bbbbbb" for update aaaaaa => bbbbbb.
# Convert to regex "^aaaaaa[a-z0-9]* bbbbbb[a-z0-9]*$".
sha1ex='[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]*'
regex='^\('"$sha1ex"'\)\.\.\('"$sha1ex"'\)$'
- git config "hooks.$1.update" |
+ echo "$update" |
sed -n "/$regex/ {s/$regex/"'^\1[a-z0-9]* \2[a-z0-9]*$/;p;}' |
grep '.' # Return false if result is empty.
}
check_module() {
+ enabled=$(git config --get --bool hooks.submodule) || enabled=true
+ test "$enabled" = "false" && return
+
# Allow module-only commits without extra work.
test -z "$diffs_normal" && return
-----------------------------------------------------------------------
Summary of changes:
pre-commit | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list