|
|
|
|
|
by akavel
3085 days ago
|
|
What benefits does it have over git grep, esp. if I'm using a monorepo? What new patterns/possibilities does it enable? Is it maybe speed somehow? (I assume it could then be more "live search/exploration"/rapid exploration than git grep - but OTOH wouldn't it require some slow reindexing after each change?) |
|
Sometimes while coding you just need to find where something is so you can edit it or jump to it. In that case, your editor's search or `git grep` is definitely better. But when you're looking for example code, reviewing/reading code, or debugging code, it's often better to do it in a UI that's more optimized for those tasks than `git grep` and your editor.
And then Sourcegraph also has code intelligence, code host browser extension integrations, saved queries, etc., beyond the basic code search.
Google has a massive monorepo, and they have a similarly advanced code search system that they describe publicly. It's very well loved and frequently used by their developers. If you know any ex-Googlers (or ex-Facebookers, who have a similar system), ask them, and check out https://static.googleusercontent.com/media/research.google.c... and https://docs.google.com/document/d/1LQxLk4E3lrb3fIsVKlANu_pU....
BTW, Sourcegraph doesn't use an index for search. We heavily optimized the performance of searching an arbitrary revision that has never been indexed. So no slow reindexing after each change.