diff --git a/.gitattributes b/.gitattributes index ed54ab894e7..c4c2d86f908 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3576,6 +3576,7 @@ Scripts/developer_scripts/cgal_build -text Scripts/developer_scripts/cgal_generate_cmake_script -text Scripts/developer_scripts/cgal_generate_cmake_script.cmake -text Scripts/developer_scripts/cgal_git_svn_clone -text +Scripts/developer_scripts/cgal_git_update_hooks_for_client -text Scripts/developer_scripts/cgal_header_clean_up.py -text Scripts/developer_scripts/cgal_test_with_cmake eol=lf Scripts/developer_scripts/check_library_uses_no_gpl_files -text diff --git a/Scripts/developer_scripts/cgal_git_update_hooks_for_client b/Scripts/developer_scripts/cgal_git_update_hooks_for_client new file mode 100755 index 00000000000..fba4d7022ac --- /dev/null +++ b/Scripts/developer_scripts/cgal_git_update_hooks_for_client @@ -0,0 +1,35 @@ +if [ ! -e .git -o ! -e CMakeLists.txt ]; +then + echo "Call $0 from root directory of the CGAL repository" + exit +fi + +branch=$(git symbolic-ref HEAD) +branch=${branch/refs\/heads\//} + +if [ ! -e .git ]; +then + echo "Call $0 from root directory of the CGAL repository" + exit +fi + +if [ "$branch" != "master" ]; +then + echo "Call $0 from branch 'master'" + exit +fi + +echo -n "Fetching from origin ... " +git fetch +echo "done" + +echo "Updating hooks ... " + +cd .git/hooks +if [ ! -e .git ]; +then + git init +fi +git pull .. origin/hooks-for-clients +echo "Hooks updated." +cd ../..