Skip to content

Instantly share code, notes, and snippets.

@pda
Created May 1, 2013 04:03
Show Gist options
  • Save pda/5493674 to your computer and use it in GitHub Desktop.
Save pda/5493674 to your computer and use it in GitHub Desktop.
Git post-commit hook to build ctags file. Backgrounding/mutex could be useful as codebase grows. See http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html for fancier options.
#!/bin/sh
set -e
PATH="/usr/local/bin:$PATH"
tmpfile=tags.$$
trap "rm -f $tmpfile" EXIT
ctags --tag-relative -Rf$tmpfile --exclude=.git --languages=ruby
mv $tmpfile tags
@pda
Copy link
Author

pda commented May 1, 2013

Mostly taken from http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html where you'll find fancier shiny things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment