summaryrefslogtreecommitdiff
path: root/git_template/hooks
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2015-05-04 12:38:10 +0100
committerUrbain Vaes <urbain@vaes.uk>2015-05-04 12:38:10 +0100
commit9b8c4db81cc090e516efaa37c3a61fb38eacc0b3 (patch)
tree7b4b95df737d1d4d79748687a0a16bf6081387d3 /git_template/hooks
parented33b82654d2c5099d73394a806cb31e53cec4ce (diff)
Added git hooks for ctags
Diffstat (limited to 'git_template/hooks')
-rwxr-xr-xgit_template/hooks/ctags8
-rwxr-xr-xgit_template/hooks/post-checkout2
-rwxr-xr-xgit_template/hooks/post-commit2
-rwxr-xr-xgit_template/hooks/post-merge2
-rwxr-xr-xgit_template/hooks/post-rewrite4
5 files changed, 18 insertions, 0 deletions
diff --git a/git_template/hooks/ctags b/git_template/hooks/ctags
new file mode 100755
index 0000000..a9a2150
--- /dev/null
+++ b/git_template/hooks/ctags
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -e
+PATH="/usr/local/bin:$PATH"
+dir="`git rev-parse --git-dir`"
+trap 'rm -f "$dir/$$.tags"' EXIT
+git ls-files | ctags --tag-relative -L - -f"$dir/$$.tags" --languages=-javascript,sql
+mv "$dir/$$.tags" "$dir/tags"
+
diff --git a/git_template/hooks/post-checkout b/git_template/hooks/post-checkout
new file mode 100755
index 0000000..84f17ed
--- /dev/null
+++ b/git_template/hooks/post-checkout
@@ -0,0 +1,2 @@
+#!/bin/sh
+.git/hooks/ctags >/dev/null 2>&1 &
diff --git a/git_template/hooks/post-commit b/git_template/hooks/post-commit
new file mode 100755
index 0000000..84f17ed
--- /dev/null
+++ b/git_template/hooks/post-commit
@@ -0,0 +1,2 @@
+#!/bin/sh
+.git/hooks/ctags >/dev/null 2>&1 &
diff --git a/git_template/hooks/post-merge b/git_template/hooks/post-merge
new file mode 100755
index 0000000..84f17ed
--- /dev/null
+++ b/git_template/hooks/post-merge
@@ -0,0 +1,2 @@
+#!/bin/sh
+.git/hooks/ctags >/dev/null 2>&1 &
diff --git a/git_template/hooks/post-rewrite b/git_template/hooks/post-rewrite
new file mode 100755
index 0000000..fe8972d
--- /dev/null
+++ b/git_template/hooks/post-rewrite
@@ -0,0 +1,4 @@
+#!/bin/sh
+case "$1" in
+ rebase) exec .git/hooks/post-merge ;;
+esac