This commit is contained in:
aozhiwei 2019-03-20 10:29:51 +08:00
parent 9d23cf84bb
commit 9283953cb2
11 changed files with 64 additions and 2 deletions

1
githooks/applypatch-msg Executable file
View File

@ -0,0 +1 @@
#!/bin/python

0
githooks/commit-msg Executable file
View File

40
githooks/install.sh Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash
basepath=$(cd `dirname $0`; pwd)
githooks_dir=${basepath}/../../../../.git/hooks
if [ ! -L $githooks_dir/applypatch-msg ]; then
ln -s $basepath/applypatch-msg $githooks_dir/applypatch-msg
fi
if [ ! -L $githooks_dir/commit-msg ]; then
ln -s $basepath/commit-msg $githooks_dir/commit-msg
fi
if [ ! -L $githooks_dir/post-update ]; then
ln -s $basepath/post-update $githooks_dir/post-update
fi
if [ ! -L $githooks_dir/pre-applypatch ]; then
ln -s $basepath/pre-applypatch $githooks_dir/pre-applypatch
fi
if [ ! -L $githooks_dir/pre-commit ]; then
ln -s $basepath/pre-commit $githooks_dir/pre-commit
fi
if [ ! -L $githooks_dir/prepare-commit-msg ]; then
ln -s $basepath/prepare-commit-msg $githooks_dir/prepare-commit-msg
fi
if [ ! -L $githooks_dir/pre-push ]; then
ln -s $basepath/pre-push $githooks_dir/pre-push
fi
if [ ! -L $githooks_dir/pre-rebase ]; then
ln -s $basepath/pre-rebase $githooks_dir/pre-rebase
fi
if [ ! -L $githooks_dir/update ]; then
ln -s $basepath/update $githooks_dir/update
fi

0
githooks/post-update Executable file
View File

0
githooks/pre-applypatch Executable file
View File

21
githooks/pre-commit Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
env |grep -q "is_out_net"
if [ $? -eq 0 ]; then
exit 0
fi
# git branch|grep -q "* dev"
# if [ $? -ne 0 ]; then
# echo 'not dev branch, exit'
# exit 0
# fi
# echo 'no sync protocol to svn'
git branch|grep -q "* master"
if [ $? -eq 0 ]; then
svn update ~/opensource/game1008_proto
cp -f server/tools/protobuild/cs_*.proto ~/opensource/game1008_proto
svn commit -m '同步协议' ~/opensource/game1008_proto
fi

0
githooks/pre-push Executable file
View File

0
githooks/pre-rebase Executable file
View File

0
githooks/prepare-commit-msg Executable file
View File

0
githooks/update Executable file
View File

View File

@ -102,8 +102,8 @@ parser.add_option(
help = "",
)
(options, args) = parser.parse_args()
#if not options.nohooks:
# repair_githooks()
if not options.nohooks:
repair_githooks()
if need_rebuild(options.pb_files.split(',')):
rebuild(options.cpp_out, options.python_out, options.pb_files.split(','))