Skip to content

Instantly share code, notes, and snippets.

@sids
Forked from gf3/gist:457702
Created June 8, 2011 03:22
Show Gist options
  • Save sids/1013710 to your computer and use it in GitHub Desktop.
Save sids/1013710 to your computer and use it in GitHub Desktop.
Regenerate ctags on checkout
#!/bin/sh
# Regenerate ctags on checkout
# project/.git/hooks/post-checkout
DIR=$GIT_DIR
if [ 0 -eq $3 ]; then
# file checkout
else
# tree checkout
FILES=$(git diff-tree --diff-filter=ACMR --name-only -w -r $1 $2)
if [ -n "$FILES" ]; then
exctags -a $FILES
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment