Quote:
Originally Posted by euhlmann
Or use an actual database engine's full text search, which should be far more efficient.
Btw, when I tried searching for usages of WPILib classes with my mongo/node implementation, I found more than a few top results being the source for that WPILib class, since it seems many teams like to keep entire copies of WPILib in their repos. I wonder if there's a way to filter those out.
|
Git grep is actually quite fast, and way more space efficient than most database engines. Most database engines don't have paging sizes large enough for an entire source file, and so you're left with subpar lookup speeds as compared to git grep that can directly look through the changes to files. Obviously this needs some testing, but this is the theory behind it anyway.
Git grep also has the advantage that you can call it with `git rev-list --all` to search for occurrences of a string over all commits, ever. Likewise, you can grep subdirectories, discounting any directories that resemble that of the wpilib source.