Add git_template directory with ctags hooks

pull/2/head
Bodaniel Jeanes 2011-11-08 00:52:14 -06:00
parent 6c55caafc3
commit 777889a521
9 changed files with 22 additions and 1 deletions

View File

@ -6,7 +6,6 @@
* Remove 'export' from variables that don't need them
* Make current directory red in prompt if non-writeable (ala fish)
* Fix shell $PATH. Intelligently build up from only existent directories and ensure no-duplicates
* Git template with ctag/other hooks (http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html)
Copyright (c) 2008-2011 Bodaniel Jeanes

View File

@ -25,6 +25,7 @@ task :install do
vcs/git/gitconfig
vcs/git/gitignore
vcs/git/gitk
vcs/git/git_template
vcs/hg/hgrc
)

View File

@ -0,0 +1,8 @@
#!/bin/sh
# See http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html
new_tags_file="`mktemp -t ctags`"
ctags --tag-relative -Rf "${new_tags_file}" --exclude=.git --languages=-javascript,sql
mv "$new_tags_file" ".git/tags"

View File

View File

@ -0,0 +1 @@
post-commit

View File

@ -0,0 +1,3 @@
#!/bin/sh
.git/hooks/ctags >/dev/null 2>&1 &

View File

@ -0,0 +1 @@
post-commit

View File

@ -0,0 +1,5 @@
#!/bin/sh
case "$1" in
rebase) exec .git/hooks/post-merge ;;
esac

View File

@ -9,6 +9,7 @@
put = push origin HEAD
push-all = "!for i in $(git config --list | grep -E ^remote\\..+\\.url | sed -E 's/^remote\\.(.*)\\.url=.*/\\1/'); do git push $i master; done"
unadd = reset HEAD
ctags = !.git/hooks/ctags
[apply]
whitespace = nowarn
[color]
@ -63,3 +64,5 @@
[github]
user = bjeanes
[init]
templatedir = ~/.git_template