[git] Add ctags hooks for git
Taken from here:
http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html
change
commit bb28d1840dc270b3972d795db0e6bc33cd695a62
author Alpha Chen <alpha.chen@gmail.com>
date
parent 2a170068
diff --git a/git/.git_templates/hooks/ctags b/git/.git_templates/hooks/ctags
new file mode 100755
index 00000000..1ac991e5
--- /dev/null
+++ b/git/.git_templates/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/.git_templates/hooks/post-checkout b/git/.git_templates/hooks/post-checkout
new file mode 100644
index 00000000..84f17ed6
--- /dev/null
+++ b/git/.git_templates/hooks/post-checkout
@@ -0,0 +1,2 @@
+#!/bin/sh
+.git/hooks/ctags >/dev/null 2>&1 &
diff --git a/git/.git_templates/hooks/post-commit b/git/.git_templates/hooks/post-commit
new file mode 100644
index 00000000..84f17ed6
--- /dev/null
+++ b/git/.git_templates/hooks/post-commit
@@ -0,0 +1,2 @@
+#!/bin/sh
+.git/hooks/ctags >/dev/null 2>&1 &
diff --git a/git/.git_templates/hooks/post-merge b/git/.git_templates/hooks/post-merge
new file mode 100644
index 00000000..84f17ed6
--- /dev/null
+++ b/git/.git_templates/hooks/post-merge
@@ -0,0 +1,2 @@
+#!/bin/sh
+.git/hooks/ctags >/dev/null 2>&1 &
diff --git a/git/.git_templates/hooks/post-rewrite b/git/.git_templates/hooks/post-rewrite
new file mode 100644
index 00000000..fe8972dd
--- /dev/null
+++ b/git/.git_templates/hooks/post-rewrite
@@ -0,0 +1,4 @@
+#!/bin/sh
+case "$1" in
+  rebase) exec .git/hooks/post-merge ;;
+esac