Hacker News new | ask | show | jobs
by sqs 2332 days ago
Sourcegraph CEO here. I see the doc mentions Sourcegraph for code search (cool!). Something like ripgrep is indeed better for your case, a single person who just needs to search code in local directories on their own machine. I made a PR for our docs at https://github.com/sourcegraph/sourcegraph/pull/8075 that should clarify this.

Sourcegraph is a web-based code search tool that automatically syncs and indexes many repositories from your organization's code host(s). It's intended for every developer at an organization to use for searching across all of the organization's code (and for navigating/cross-referencing with code intelligence). It's self hosted and usually there is 1 Sourcegraph instance per organization. If you love local+personal code search, I bet you and your teammates would love organization-wide code search, so give Sourcegraph a try (https://docs.sourcegraph.com/#quickstart). :)

7 comments

Thank you for replying and updating the docs, appreciate it!

I still wish it was easier, it's such a cool tool :) In theory it should be possible to set up inotify watches on local repositories and reindex on changes (perhaps with some throttling logic if it's too heavy), although I understand it's harder than it sounds and my usecase is probably somewhat marginal. I might set it up anyway if my personal infrastructure ever settles.

Another great option for local code/repo search is Hound. I maintain an instance of it at my workplace, but it's so lightweight and easy to deploy that I could easily imagine running an instance of it on my laptop for offline personal use.

https://github.com/hound-search/hound

YES! We have been using hound for several years now, having all hundreds of our org repos searchable in one spot, in a LIGHTNING FAST manner has been an invaluable tool to help our various teams keep up with the legacy sprawl and effectively remove old features and all their dependencies from our sprawly systems. I even wrote a microservice that uses gitlab global hooks to keep hound up to date without polling, and a little c# config generator that runs as a cron job on our gitlab instance and redeploys hound with the newest repos included.

Hound falls short on access control front (we wrapped our instance with a saml proxy), but it's still a 'you either can search every piece of software for \'password\'' or you don't have any access at all. Having to index a specific branch instead of all of them kinda stinks too; for those two specific reasons we have been eyeing sourcegraph, esp. as the gitlab integration matures.

I can't emphasize enough how fast hound is and how pleasurable it is having a regex based code search that doesn't make me wait.

Yeah, the access control thing is not ideal— I have my instance behind Apache for the active directory plugin. Potentially as a hack you could run multiple Hound instances and reverse proxy the correct one based on a user's role? Might be easier to just add in proper support upstream. :)

Anyway, for now I'm at a small enough org that everyone still just sees everything, and it's been super valuable.

As far as competition with other tools, the infrastructure team at my org has their Elastic instance plugged into our GitLab, but most of the engineers agree that Hound is better— it's faster, it does regex, and it doesn't do goofy stuff like return pages of the same result from everyone's fork of the same repo.

A similar but more structured (though perhaps Hound supports a similar feature set) code searching tool is OpenGrok [1]. It's a bit more setup as it uses Apache Tomcat, but once it is setup it has an incredibly fast and useful code querying tool with really useful abilities to x-ref functions/structures, highlight uses of variables, and integrates git info as well. If you've ever used elixir.bootlin.com to go through the Linux source code, opengrok is effectively a more feature packed open source version of that. I highly recommend taking a look to anyone who spends a lot of time digging through code.

[1] https://oracle.github.io/opengrok/

Recently interviewed for a PM role at Sourcegraph, so I read everything Sourcegraph shares online and it was amazing to see your plans and OKR's for the future being laid out in the open. Kudos on running an open, successful organization.

After reading about your masterplan I would love to know your thoughts on the question presented regarding phase 2.

Will coding in the future be more like writing a novel or like knowing how to read+write? I feel the latter will eventually be true as the the human-machine interface becomes more 'native'.

I'm not familiar with your product, so this question might be either overly simple or entire outside your wheelhouse, but does Sourcegraph have any integration with IDEs? Like if my organization had a module in a repository that did image compression (random example), could I hit a hotkey and search for it, then have the plugin pull the module out of a different project and insert it into what I'm working on?
Sourcegraph has editor plugins (https://docs.sourcegraph.com/integration/editor) that give you editor hotkeys for (1) multi-repository search and (2) go-to-file on Sourcegraph (in your web browser, so you can read the code without ruining your editor state or share the URL of your current file with a teammate).

That advanced use case you mentioned isn't supported, but it sounds very cool. It's in the realm of things we'd like to offer someday. If anyone's interested in hacking on that (and making a PR to https://github.com/sourcegraph/sourcegraph), I'd be happy to screenshare with them and give them some pointers.

I was in an Uber with one of your engineers who was heading to Gophercon. He seemed cool so I'm going to assume you're all cool people.
Wow, the prices seem extremely high to me for a search engine across code repos.

$30/person is almost double what Stack Overflow charges, and that product can act as a frontend to search not just code but any type of documents, with voting, tagging, analytics on what confuses people the most and more.

It would be hard for me to justify even $10/person for something like Sourcegraph in my company (a Fortune 500 ecommerce brand), for the highest enterprise tier of functionality.

$30/person per month for the lowest tier? Boy, I wish I knew of companies willing to pay that. None in my experience ever have been.

> in my company (a Fortune 500 ecommerce brand)

My strategic advice is to get whatever's best in class, and not worry about $X0/month. Compared to what you should be spending on devs that rounds to free.

I’ve never heard of any company that does that. In all 6 of the large tech companies I’ve worked for, all of which were very profitable, this type of per-head cost would be a HUGE blocker to being allowed to requisition the tool.
Seems like more than half of this comment is just speaking about Sourcegraph, something sqs themselves acknowledge is not the right tool here. I know you're the CEO, but maybe can avoid pushing your product when it's not relevant :)

Thank you for updating the documentation to clarify the use case though!