[Cmake-commits] CMake branch, hooks, updated. 125100babc6a0c1f25cb88b7da66c1bbb2a62fdf

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Nov 17 17:58:00 EST 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  125100babc6a0c1f25cb88b7da66c1bbb2a62fdf (commit)
       via  dc31be5bda3817384e0208b38a905ab8a070196a (commit)
      from  2dbbb6ff4e0d55558865abdb540c368b1d4e208a (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=125100babc6a0c1f25cb88b7da66c1bbb2a62fdf
commit 125100babc6a0c1f25cb88b7da66c1bbb2a62fdf
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Nov 17 17:54:50 2010 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Nov 17 17:54:50 2010 -0500

    commit-msg: Allow long first lines starting in "Revert "
    
    Revert commits always have longer first lines than the commit they
    revert.  Do not reject those that happen to go over the threshold.  It
    is much simpler if the "git revert" command creates the commit without
    error.

diff --git a/commit-msg b/commit-msg
index 7856f1e..5d18c5a 100755
--- a/commit-msg
+++ b/commit-msg
@@ -41,6 +41,10 @@ msg_is_merge() {
 	echo "$line" | grep "^Merge " >/dev/null 2>&1
 }
 
+msg_is_revert() {
+	echo "$line" | grep "^Revert " >/dev/null 2>&1
+}
+
 msg_first() {
 	len=$(echo -n "$line" | wc -c)
 	if test $len -eq 0; then
@@ -51,7 +55,7 @@ msg_first() {
 --------
 '"$line"'
 --------'
-	elif test $len -gt 78 && ! msg_is_merge; then
+	elif test $len -gt 78 && ! msg_is_merge && ! msg_is_revert; then
 		die 'The first line may be at most 78 characters:
 ------------------------------------------------------------------------------
 '"$line"'

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc31be5bda3817384e0208b38a905ab8a070196a
commit dc31be5bda3817384e0208b38a905ab8a070196a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Nov 16 17:40:16 2010 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 16 17:40:16 2010 -0500

    Chain to script configured by "hooks.chain-<hook>"
    
    Chain the pre-commit, commit-msg, and prepare-commit-msg hooks to
    locally configured scripts.  Interpret relative paths with respect to
    the working directory where the hooks run (top of work tree).  This
    allows project setup scripts to add project-specific checks for each of
    these hooks.

diff --git a/commit-msg b/commit-msg
index 92a95cd..7856f1e 100755
--- a/commit-msg
+++ b/commit-msg
@@ -125,3 +125,8 @@ case "$hooks_GerritId" in
 	'')      gerrit_advice ;;
 	*)       gerrit_error ;;
 esac
+
+#-----------------------------------------------------------------------------
+# Chain to project-specific hook.
+. "$GIT_DIR/hooks/hooks-chain.bash"
+hooks_chain commit-msg "$@"
diff --git a/hooks-chain.bash b/hooks-chain.bash
new file mode 100644
index 0000000..63c1f40
--- /dev/null
+++ b/hooks-chain.bash
@@ -0,0 +1,31 @@
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#=============================================================================
+
+hooks_chain() {
+	hook="$1" ; shift
+	chain=$(git config --get hooks.chain-$hook) || return 0
+	case "$chain" in
+	'/'*) prefix="" ;;
+	'[A-Za-z]:/'*) prefix="" ;;
+	'.'*) prefix="" ;;
+	*) prefix="./" ;;
+	esac
+	if test -x "$prefix$chain" ; then
+		exec "$prefix$chain" "$@"
+	fi
+}
+
+# vim: set filetype=sh tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab :
diff --git a/pre-commit b/pre-commit
index 15a0151..0f71055 100755
--- a/pre-commit
+++ b/pre-commit
@@ -252,4 +252,9 @@ test -z "$bad" || die "$bad"
 # Style hooks.
 . "$GIT_DIR/hooks/pre-commit-style"
 
+#-----------------------------------------------------------------------------
+# Chain to project-specific hook.
+. "$GIT_DIR/hooks/hooks-chain.bash"
+hooks_chain pre-commit "$@"
+
 # vim: set filetype=sh tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab :
diff --git a/prepare-commit-msg b/prepare-commit-msg
new file mode 100755
index 0000000..505b522
--- /dev/null
+++ b/prepare-commit-msg
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#=============================================================================
+
+#-----------------------------------------------------------------------------
+# Chain to project-specific hook.
+. "$GIT_DIR/hooks/hooks-chain.bash"
+hooks_chain prepare-commit-msg "$@"

-----------------------------------------------------------------------

Summary of changes:
 commit-msg         |   11 ++++++++++-
 hooks-chain.bash   |   31 +++++++++++++++++++++++++++++++
 pre-commit         |    5 +++++
 prepare-commit-msg |   21 +++++++++++++++++++++
 4 files changed, 67 insertions(+), 1 deletions(-)
 create mode 100644 hooks-chain.bash
 create mode 100755 prepare-commit-msg


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list