Loading git-hooks +22 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ source $LIBDIR/arg_parse_functions BIN=`basename "$0"` GIT="git ${GIT_DIR+--git-dir "${GIT_DIR}"}" GIT_DIR="${GIT_DIR:-`git rev-parse --git-dir`}" HOOKS="update" usage () { Loading Loading @@ -55,9 +56,29 @@ full_usage () cmd_init () { summary="set up git-hook directories in a repository" local force local force skip add_arg FLAG -f force add_arg FLAG -s skip parse_args "$@" cd "$GIT_DIR"/hooks for hook in $HOOKS; do if ! mkdir $hook.d 2>/dev/null; then if [ x$force == xyes ]; then mv $hook.d $hook.d.old mv $hook $hook.old chmod -x $hook.old mkdir $hook.d elif [ x$skip == xyes ]; then continue else die "$hook.d already exists" fi fi [ -e $hook ] && mv $hook $hook.d/org_$hook [ -e $hook.sample ] && mv $hook.sample $hook.d/ ln -s "$LIBDIR"/run-hooks $hook done } cmd_add () Loading Loading
git-hooks +22 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ source $LIBDIR/arg_parse_functions BIN=`basename "$0"` GIT="git ${GIT_DIR+--git-dir "${GIT_DIR}"}" GIT_DIR="${GIT_DIR:-`git rev-parse --git-dir`}" HOOKS="update" usage () { Loading Loading @@ -55,9 +56,29 @@ full_usage () cmd_init () { summary="set up git-hook directories in a repository" local force local force skip add_arg FLAG -f force add_arg FLAG -s skip parse_args "$@" cd "$GIT_DIR"/hooks for hook in $HOOKS; do if ! mkdir $hook.d 2>/dev/null; then if [ x$force == xyes ]; then mv $hook.d $hook.d.old mv $hook $hook.old chmod -x $hook.old mkdir $hook.d elif [ x$skip == xyes ]; then continue else die "$hook.d already exists" fi fi [ -e $hook ] && mv $hook $hook.d/org_$hook [ -e $hook.sample ] && mv $hook.sample $hook.d/ ln -s "$LIBDIR"/run-hooks $hook done } cmd_add () Loading