| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #!/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
- }
- if test -z "$HOOKS_ALLOW_KWSYS"; then
- # Disallow changes to KWSys
- files=$(git diff-index --name-only --cached HEAD -- Source/kwsys) &&
- if test -n "$files"; then
- die 'Changes to KWSys files
- '"$(echo "$files" | sed 's/^/ /')"'
- should not be made directly in CMake. KWSys is kept in its own Git
- repository and shared by several projects. Please visit
- http://public.kitware.com/Wiki/KWSys/Git
- to contribute changes directly to KWSys. Run
- git reset HEAD -- Source/kwsys
- to unstage these changes. Alternatively, set environment variable
- HOOKS_ALLOW_KWSYS=1
- to disable this check and commit the changes locally.'
- fi
- fi
|