Skip to content

Commit 3d5869c

Browse files
committed
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.
1 parent 89742d7 commit 3d5869c

File tree

5 files changed

+80
-0
lines changed

5 files changed

+80
-0
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.gitattributes export-ignore
2+
.hooks* export-ignore
23

34
bootstrap crlf=input
45
configure crlf=input

.hooks-config.bash

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#=============================================================================
2+
# CMake - Cross Platform Makefile Generator
3+
# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
4+
#
5+
# Distributed under the OSI-approved BSD License (the "License");
6+
# see accompanying file Copyright.txt for details.
7+
#
8+
# This software is distributed WITHOUT ANY WARRANTY; without even the
9+
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10+
# See the License for more information.
11+
#=============================================================================
12+
13+
# Loaded by .git/hooks/(pre-commit|commit-msg|prepare-commit-msg)
14+
# during git commit after local hooks have been installed.
15+
16+
hooks_chain_pre_commit="Utilities/Git/pre-commit"
17+
hooks_chain_commit_msg="Utilities/Git/commit-msg"
18+
hooks_chain_prepare_commit_msg="Utilities/Git/prepare-commit-msg"

Utilities/Git/commit-msg

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
#=============================================================================
3+
# CMake - Cross Platform Makefile Generator
4+
# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
5+
#
6+
# Distributed under the OSI-approved BSD License (the "License");
7+
# see accompanying file Copyright.txt for details.
8+
#
9+
# This software is distributed WITHOUT ANY WARRANTY; without even the
10+
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
# See the License for more information.
12+
#=============================================================================
13+
14+
die() {
15+
echo 'commit-msg hook failure' 1>&2
16+
echo '-----------------------' 1>&2
17+
echo '' 1>&2
18+
echo "$@" 1>&2
19+
exit 1
20+
}
21+
22+
# This is a placeholder for future commit-msg checks.
23+
exit 0

Utilities/Git/pre-commit

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
#=============================================================================
3+
# CMake - Cross Platform Makefile Generator
4+
# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
5+
#
6+
# Distributed under the OSI-approved BSD License (the "License");
7+
# see accompanying file Copyright.txt for details.
8+
#
9+
# This software is distributed WITHOUT ANY WARRANTY; without even the
10+
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
# See the License for more information.
12+
#=============================================================================
13+
14+
die() {
15+
echo 'pre-commit hook failure' 1>&2
16+
echo '-----------------------' 1>&2
17+
echo '' 1>&2
18+
echo "$@" 1>&2
19+
exit 1
20+
}
21+
22+
# This is a placeholder for future pre-commit checks.
23+
exit 0

Utilities/Git/prepare-commit-msg

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
#=============================================================================
3+
# CMake - Cross Platform Makefile Generator
4+
# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
5+
#
6+
# Distributed under the OSI-approved BSD License (the "License");
7+
# see accompanying file Copyright.txt for details.
8+
#
9+
# This software is distributed WITHOUT ANY WARRANTY; without even the
10+
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
# See the License for more information.
12+
#=============================================================================
13+
14+
# This is a placeholder for future prepare-commit-msg hooks.
15+
exit 0

0 commit comments

Comments
 (0)