Thursday Night

Paul Betts’s personal website / blog / what-have-you

ctags builder for really f’ing big source trees

After waiting a really long time, I found out that ctags doesn’t like generating tagfiles for 40gb code repositories, as well as the generated file being really huge and unwieldy. I had some free time over the weekend, so I wrote a Ruby script that creates tag files for large source trees and splits them apart by directory if there are too many source files in it. So basically, if it can form one big file it will, but if not, it’ll split it into several small files that are named after your subdirectory. Some examples:

generate_ctags.rb --outputdir ~/kernel_tags --filecount 5000 /usr/src/linux

produces:

acpi
arch
asm
asm-alpha
asm-arm
asm-arm26
asm-cris
asm-frv

…and so on

Download it at http://www.paulbetts.org/projects/generate_ctags.rb

PS: The code is pretty hacky but it’s usable right now; it has a bug where it says that it failed generating the file but don’t believe it. It also has another bug where if you don’t arrange the params in a specific format it doesn’t work. Maybe I’ll fix it sometime but right now I’m too lazy.

Written by Paul Betts

July 16th, 2006 at 11:09 pm

Posted in Programming, Ruby