From 16680f2ad51d0d1c5efaca93fc8d4df777768897 Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Sat, 18 Apr 2015 17:18:01 +0200 Subject: git: added git hooks for ctags (re)generation taken from: http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html --- git/hooks/ctags | 10 ++++++++++ git/hooks/post-checkout | 2 ++ git/hooks/post-commit | 2 ++ git/hooks/post-merge | 2 ++ git/hooks/post-rewrite | 4 ++++ 5 files changed, 20 insertions(+) create mode 100755 git/hooks/ctags create mode 100755 git/hooks/post-checkout create mode 100755 git/hooks/post-commit create mode 100755 git/hooks/post-merge create mode 100755 git/hooks/post-rewrite (limited to 'git') diff --git a/git/hooks/ctags b/git/hooks/ctags new file mode 100755 index 0000000..db388dd --- /dev/null +++ b/git/hooks/ctags @@ -0,0 +1,10 @@ +#!/bin/sh +# +# Taken from tpope's blog: http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html +# + +set -e +dir="`git rev-parse --git-dir`" +trap 'rm -f "$dir/$$.tags"' EXIT +git ls-files | ctags --tag-relative -L - -f"$dir/$$.tags" +mv "$dir/$$.tags" "$dir/tags" diff --git a/git/hooks/post-checkout b/git/hooks/post-checkout new file mode 100755 index 0000000..84f17ed --- /dev/null +++ b/git/hooks/post-checkout @@ -0,0 +1,2 @@ +#!/bin/sh +.git/hooks/ctags >/dev/null 2>&1 & diff --git a/git/hooks/post-commit b/git/hooks/post-commit new file mode 100755 index 0000000..84f17ed --- /dev/null +++ b/git/hooks/post-commit @@ -0,0 +1,2 @@ +#!/bin/sh +.git/hooks/ctags >/dev/null 2>&1 & diff --git a/git/hooks/post-merge b/git/hooks/post-merge new file mode 100755 index 0000000..84f17ed --- /dev/null +++ b/git/hooks/post-merge @@ -0,0 +1,2 @@ +#!/bin/sh +.git/hooks/ctags >/dev/null 2>&1 & diff --git a/git/hooks/post-rewrite b/git/hooks/post-rewrite new file mode 100755 index 0000000..fe8972d --- /dev/null +++ b/git/hooks/post-rewrite @@ -0,0 +1,4 @@ +#!/bin/sh +case "$1" in + rebase) exec .git/hooks/post-merge ;; +esac -- cgit v1.2.3