diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-04-04 23:49:22 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-04-04 23:49:22 +0200 |
commit | c8b3364d0939fd1ef821cc1033c7803051e0b5d9 (patch) | |
tree | de1945a66c18d53a76d6e62e8cb97fbf79187063 /etc/functions | |
parent | d6d596207a56115e0dda9cf02298267f0a45b65e (diff) |
Removed unused (and probably obsolete) git-hook function
Diffstat (limited to 'etc/functions')
-rwxr-xr-x | etc/functions/git-hook | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/etc/functions/git-hook b/etc/functions/git-hook deleted file mode 100755 index 86c2bbb..0000000 --- a/etc/functions/git-hook +++ /dev/null @@ -1,61 +0,0 @@ -## vim:ft=zsh -## Small function to help with git hooks -## Copyright (C) 2008 by Daniel Friesel <derf@derf.homelinux.org> -## License: WTFPL <http://sam.zoy.org/wtfpl> - -autoload fdie -typeset hook_dir action=${1=list} hook=$2 - -if [[ -n $GIT_DIR && -d $GIT_DIR ]] { - hook_dir=$GIT_DIR/hooks -} elif [[ -d .git/hooks ]] { - hook_dir=$PWD/.git/hooks -} elif [[ -d hooks ]] { - hook_dir=$PWD/hooks -} elif [[ $PWD == */hooks ]] { - hook_dir=$PWD -} else { - hook_dir=$(git rev-parse --git-dir)/hooks || - return -} - -function usage { - cat <<- ENDOFHELP - Usage: git-hook enable|disable <hook> - ENDOFHELP -} - -function hook_enable { - if [[ -e $hook_dir/$hook ]] { - if ! [[ -x $hook_dir/$hook ]] { - chmod +x $hook_dir/$hook - } - } else { - fdie "No such hook: '$hook'"; return - } -} - -function hook_disable { - if [[ -e $hook_dir/$hook ]] { - if [[ -x $hook_dir/$hook ]] { - chmod -x $hook_dir/$hook - } - } else { - fdie "No such hook: '$hook'"; return - } -} - -function hook_list { - for hook in $hook_dir/*; { - [[ -x $hook ]] && echo -n $green - echo -n ${hook:t} - echo $reset - } -} - -case $action in - enable) shift 2; hook_enable $* ;; - disable) shift 2; hook_disable $* ;; - list) shift; hook_list $* ;; - *) usage ;; -esac |