Skip to content


Creating ctags with git hooks

If you are as lazy or forgetful as I am, you won’t remember to recreate your ctags files. Now you don’t have to. Have your ctags automatically generated when committing, merging, or branching.


Creating ctags with git from Bryan Liles on Vimeo.

I originally saw this code here, and Tobias was kind enough to let me repost it here and make a video of it.

If you like these kind of videos let me know.

Update

To get this to work, you must have exuberant ctags installed. The bsd version uses different command line options. I encourage you to try installing it using macports.

Posted in Geek Vids, Smarticus Says.


6 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. tcrawley says

    Bryan:

    Nice job! I just realized that we have the same WP theme – makes us appear to be in cohoots.

  2. Dave Bolton says

    I've been very much enjoying your videos Bryan, keep it going!

    Cheers,
    Dave

  3. François Beausoleil says

    Bryan, this is very good. The stock ctags on Mac OS 10.5 doesn't recognize the -L and -e options though. I had to install the ctags port. After that, I was able to run run_tags. Thank you very much, and please keep these Vim videos coming!

  4. bryanl says

    Yes, this is important. You must install exuberant ctags from macports. I'm not too familiar with the bsd version.

  5. Tobias Crawley says

    Bryan:

    I just updated the run_tags script to run the find | ctags in the background to make git commands more responsive on larger code bases. The updated version is at http://gist.github.com/42308.

Continuing the Discussion

  1. ideas.each &:post » Generating a TAGS file from a git hook linked to this post on April 19, 2009

    [...] script has been modified to register for the post-checkout hook as well, based on a suggestion from Bryan Liles). The post-merge hook will get called after you do a git pull to merge from another repository, and [...]



Some HTML is OK

or, reply to this post via trackback.

blog comments powered by Disqus


Blog WebMastered by All in One Webmaster.