Skip to content

Instantly share code, notes, and snippets.

@jcmuller
Last active December 20, 2015 11:38
Show Gist options
  • Save jcmuller/6124453 to your computer and use it in GitHub Desktop.
Save jcmuller/6124453 to your computer and use it in GitHub Desktop.
ctags script for git hooks
#!/bin/bash
# Install at ~/.git_template/hooks/ctags (and set init.templatedir to ~/.git_template)
set -e
PATH="/usr/local/bin:$PATH"
trap "rm -f .git/tags.$$" EXIT
ctags --tag-relative -Rf.git/tags.$$ --exclude=.git --exclude='*.min.*'
mv .git/tags.$$ .git/tags
#!/bin/sh
.git/hooks/ctags >/dev/null 2>&1 &
#!/bin/sh
.git/hooks/ctags >/dev/null 2>&1 &
#!/bin/sh
.git/hooks/ctags >/dev/null 2>&1 &
#!/bin/bash
case "$1" in
rebase) exec .git/hooks/post-merge ;;
esac
@jcmuller
Copy link
Author

This is totally inspired by @tpope.

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