From: Tim-Philipp Müller Date: Tue, 3 Feb 2009 20:34:36 +0000 (+0000) Subject: gst-autogen.sh: add install_git_hooks() subroutine X-Git-Tag: submit/tizen/20130618.114443~257 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01ef680746388912c1d9499b42e598e63a1a574b;p=platform%2Fupstream%2Fgst-common.git gst-autogen.sh: add install_git_hooks() subroutine --- diff --git a/gst-autogen.sh b/gst-autogen.sh index ae60f7e..9b0ddf2 100644 --- a/gst-autogen.sh +++ b/gst-autogen.sh @@ -292,3 +292,27 @@ tool_run () exit 1 } } + + +install_git_hooks () +{ + if test -d .git; then + # install pre-commit hook for doing clean commits + for hook in pre-commit; do + if test ! \( -x .git/hooks/$hook -a -L .git/hooks/$hook \); then + echo "+ Installing git $hook hook" + rm -f .git/hooks/$hook + ln -s ../../common/hooks/$hook.hook .git/hooks/$hook || { + # if we couldn't create a symbolic link, try doing a plain cp + if cp common/hooks/pre-commit.hook .git/hooks/pre-commit; then + chmod +x .git/hooks/pre-commit; + else + echo "********** Couldn't install git $hook hook **********"; + fi + } + fi + done + fi +} + +