Commit bb280573 authored by sankhesh's avatar sankhesh

ENH: Added safeguard hook to tell developer to setup environment

A placeholder pre-commit hook is installed by CMake to ensure the developer sets
up the development environment before committing any changes.
Addresses issue 2834.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21912 3bd1e089-480b-0410-8dfb-8563597acbee
parent 32a9b2cc
# Install a pre-commit hook to bootstrap commit hooks.
if (EXISTS "${Slicer_SOURCE_DIR}/.git/config" AND
NOT EXISTS "${Slicer_SOURCE_DIR}/.git/hooks/pre-commit")
# Silently ignore the error if the hooks directory is read-only.
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy ${Slicer_SOURCE_DIR}/CMake/pre-commit
${Slicer_SOURCE_DIR}/.git/hooks/pre-commit
OUTPUT_VARIABLE _output
ERROR_VARIABLE _output
RESULT_VARIABLE _result
)
if(_result AND NOT "${_output}" MATCHES "Error copying file")
message("${_output}")
endif()
endif()
#!/bin/sh
echo 'Your work tree has not been configured for Slicer development.
Paste the following commands into a shell:
./Utilities/SetupForDevelopment.sh
See
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/DevelopmentWithGit
for more information.'
exit 1
......@@ -28,6 +28,11 @@ set(CMAKE_MODULE_PATH
set(Slicer_CMAKE_DIR ${Slicer_SOURCE_DIR}/CMake)
set(Slicer_EXTENSIONS_CMAKE_DIR ${Slicer_SOURCE_DIR}/Extensions/CMake)
#-----------------------------------------------------------------------------
# http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/DevelopmentWithGit
#-----------------------------------------------------------------------------
include(SlicerCheckSourceTree)
#-----------------------------------------------------------------------------
include(CTestUseLaunchers OPTIONAL)
if(${CTEST_USE_LAUNCHERS})
......
......@@ -36,7 +36,7 @@ do
$gitName <$gitEmail>
"
read -ep "Is the author name and email address above correct? [Y/N] " correct
read -ep "Is the author name and email address above correct? [Y/n] " correct
if [ "$correct" == "n" ] || [ "$correct" == "N" ]; then
setup_user
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment