Skip to content

Instantly share code, notes, and snippets.

@gf3
Created June 29, 2010 19:40
Show Gist options
  • Save gf3/457702 to your computer and use it in GitHub Desktop.
Save gf3/457702 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