Skip to content

Commit

Permalink
Use ripper-tags for post-checkout hook
Browse files Browse the repository at this point in the history
  • Loading branch information
jefffederman committed Jan 28, 2017
1 parent ffcc385 commit 02fac98
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion git_template/hooks/post-checkout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
# Slightly modified from Tim Pope’s original, see:
# http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html#comment-2347209899
.git/hooks/ctags >/dev/null 2>&1 || true &
.git/hooks/ripper-tags >/dev/null 2>&1 || true &
11 changes: 11 additions & 0 deletions git_template/hooks/ripper-tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
# Changed from Tim Pope’s original to use ripper-tags, see:
# http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html#comment-1502773044
set -e
# `ripper-tags` is a gem, need it in our path
PATH="$GEM_PATH:$PATH"
dir="`git rev-parse --git-dir`"
trap 'rm -f "$dir/$$.tags"' EXIT
git ls-files | \
ripper-tags -R --tag-relative --exclude=vendor,public -f "$dir/$$.tags"
mv "$dir/$$.tags" "$dir/tags"

0 comments on commit 02fac98

Please sign in to comment.