Skip to content

Instantly share code, notes, and snippets.

@atn34
Created April 9, 2014 06:17
Show Gist options
  • Save atn34/10231136 to your computer and use it in GitHub Desktop.
Save atn34/10231136 to your computer and use it in GitHub Desktop.
#! /bin/sh
GITDIR=$(git rev-parse --git-dir)
TAGSFILE=tags.$$
mkdir $GITDIR/tags_lock 2>/dev/null || exit 0
trap "rmdir $GITDIR/tags_lock; rm $GITDIR/$TAGSFILE" EXIT
# normal ctags
ctags --tag-relative -Rf $GITDIR/$TAGSFILE --exclude=$GITDIR
# haskell ctags
if which hasktags > /dev/null ; then
OLD_DIR=$(pwd)
(cd $GITDIR && hasktags -c -x --ignore-close-implementation -a -f $TAGSFILE $OLD_DIR)
LC_COLLATE=C sort $GITDIR/$TAGSFILE -o $GITDIR/$TAGSFILE
fi
mv $GITDIR/$TAGSFILE $GITDIR/tags
@atn34
Copy link
Author

atn34 commented Apr 9, 2014

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