From 3d5869ca3c065c872d6365164b301d2f8d7e2b64 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 24 Oct 2011 10:18:36 -0400 Subject: [PATCH] Add pre-commit|commit-msg|prepare-commit-msg hook placeholders Add CMake-specific hook placeholders that chain from the main hooks branch after it is installed into the local .git/hooks directory. --- .gitattributes | 1 + .hooks-config.bash | 18 ++++++++++++++++++ Utilities/Git/commit-msg | 23 +++++++++++++++++++++++ Utilities/Git/pre-commit | 23 +++++++++++++++++++++++ Utilities/Git/prepare-commit-msg | 15 +++++++++++++++ 5 files changed, 80 insertions(+) create mode 100644 .hooks-config.bash create mode 100755 Utilities/Git/commit-msg create mode 100755 Utilities/Git/pre-commit create mode 100755 Utilities/Git/prepare-commit-msg diff --git a/.gitattributes b/.gitattributes index 43676a97f..d9d64d639 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ .gitattributes export-ignore +.hooks* export-ignore bootstrap crlf=input configure crlf=input diff --git a/.hooks-config.bash b/.hooks-config.bash new file mode 100644 index 000000000..97152f651 --- /dev/null +++ b/.hooks-config.bash @@ -0,0 +1,18 @@ +#============================================================================= +# CMake - Cross Platform Makefile Generator +# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= + +# Loaded by .git/hooks/(pre-commit|commit-msg|prepare-commit-msg) +# during git commit after local hooks have been installed. + +hooks_chain_pre_commit="Utilities/Git/pre-commit" +hooks_chain_commit_msg="Utilities/Git/commit-msg" +hooks_chain_prepare_commit_msg="Utilities/Git/prepare-commit-msg" diff --git a/Utilities/Git/commit-msg b/Utilities/Git/commit-msg new file mode 100755 index 000000000..9a5d1c1b3 --- /dev/null +++ b/Utilities/Git/commit-msg @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +#============================================================================= +# CMake - Cross Platform Makefile Generator +# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= + +die() { + echo 'commit-msg hook failure' 1>&2 + echo '-----------------------' 1>&2 + echo '' 1>&2 + echo "$@" 1>&2 + exit 1 +} + +# This is a placeholder for future commit-msg checks. +exit 0 diff --git a/Utilities/Git/pre-commit b/Utilities/Git/pre-commit new file mode 100755 index 000000000..e4f9fd0a7 --- /dev/null +++ b/Utilities/Git/pre-commit @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +#============================================================================= +# CMake - Cross Platform Makefile Generator +# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= + +die() { + echo 'pre-commit hook failure' 1>&2 + echo '-----------------------' 1>&2 + echo '' 1>&2 + echo "$@" 1>&2 + exit 1 +} + +# This is a placeholder for future pre-commit checks. +exit 0 diff --git a/Utilities/Git/prepare-commit-msg b/Utilities/Git/prepare-commit-msg new file mode 100755 index 000000000..1517bb2db --- /dev/null +++ b/Utilities/Git/prepare-commit-msg @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +#============================================================================= +# CMake - Cross Platform Makefile Generator +# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= + +# This is a placeholder for future prepare-commit-msg hooks. +exit 0