There is a demo site where you can search 30G of source code (including the Linux kernel, Android and Chrome) supporting regular expressions, and file name search:
For example, https://cs.bazel.build/search?q=+r%3Atorvalds+craz%5Byi%5D&n... looks for craz[iy] across the Linux kernel.
BTW I know you're in Munich now but I wanted to say hi from your hometown Utrecht.
It’s now free on a single server for any number of users and repositories.
Happy to answer questions here.
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.
Many queries times out for me although I'm running it on a pretty beefy AWS c5 instance with SSDs. Queries such as "type:diff" doesn't seem to work at all on my code bases. It also does not appear to cache any data from previous runs of "git log", so attempting to do the suggested reload doesn't really workaroudn the issue. Are you working on improving the performance?
We're actively working on improving the performance of diff search, but I would expect other types of queries to complete quickly. Would you mind sharing more about the size / characteristics of your repositories? Feel free to email me at beyang@sourcegraph.com if a private channel is better.
I expected email notifications but all I managed to do was to add the saved queries on the home page. Am I missing something?
The homepage does show a nice sparkline and results summary, though. Easy to see at a glance if new secret keys, deps, etc., are added to your repositories if you set up the queries.
Telemetry lets you see the telemetry data it sends to Sourcegraph (which you can disable in the site config and never contains code/paths/repo names or anything derived from them).
Particularly for things like postgres configuration etc.
Re: PostgreSQL configuration, is it that you want to be able to manage and back up the data yourself (not using the Docker container's internal PostgreSQL), or is it a tuning/performance concern, or something else?
BTW, someone else down-thread asked for this, too (https://news.ycombinator.com/item?id=16121182).
on an unrelated note: did you work on AWS SQS?
We have customers who run Sourcegraph on machines that are completely blocked off from the Internet and only have access to the specific IP ranges of their code hosts on the same network. You can set it up like that if you'd like, which would significantly reduce the risks without needing to trust any third parties (us or the security reviewer).
Let us know if you have any other questions or feedback!
Here's an example of a C++ search query: https://sourcegraph.com/search?q=repo:google/leveldb+FilterB...
- https://github.com/sourcegraph/sourcegraph-classic
- https://github.com/sourcegraph/sourcegraph-archive-private-2...
- https://github.com/sourcegraph/infrastructure
- https://github.com/sourcegraph/sourcegraph
- https://github.com/sourcegraph/definfo-prototype
- https://github.com/sourcegraph/sourcegraph-desktop
- https://github.com/sourcegraph/sourcegraph-emacs-beta
- https://github.com/sourcegraph/splunk-promethus-alerts
- https://github.com/sourcegraph/ZARCHIVED-corporate
- https://github.com/sourcegraph/css-langserver
Listed as they showed up in the GIF. That was fun!
Also, I cannot find the code for sourcegraph on github. It used to be available under a fair source license. Anyone have a link to the code?
The source code is not public for this version. I think that source-available but non-open-source licenses are an idea ahead of their time when applied to user-facing software like Sourcegraph. I hope that changes, and we'd love to make Sourcegraph source-available again, but it actually introduced (rather than eliminated) questions in the process of companies adopting Sourcegraph. I'll probably blog about this soon because it's something I care about a lot.
Yes, please! I have seen your videos and read a lot about your thoughts on this subject.
Another question, if you don't mind: does sourcegraph have a forum or irc/slack? A quick search for sourcegraph+slack ends up finding many hits.. for your name, lol.
In fact looks like I'm not able to get netrc or SSH keys working.
Personally, I find it to be absolutely horrendous. It’s so much faster to clone the repo and search it locally.
https://stackoverflow.com/questions/43891605/search-partial-...
So, you end up having to clone all repos locally and grep for the word.
Just pointing out that limitation of search in GitHub, not saying that this other tool is actually reliable to do this kind of things (I haven't used it before)
To compare GitHub to Sourcegraph search, here is that same query on Sourcegraph.com (which is Sourcegraph Server running for all open-source code on GitHub):
https://sourcegraph.com/search?q=repo:Kurento/+DISABLE_LIBRA...
It works as expected (and as the SO poster wanted)! It shows desired results that GitHub search does not.
Regexps are also supported...give it a try!
- Regular expression searches
- Exact searches (no ignoring punctuation, for example)
- Searches on any commit or branch, not just recently indexed master
- Diff searches (see https://about.sourcegraph.com/blog/introducing-sourcegraph-s...)
- Overall faster, more powerful searches and filtering capabilities
- Code intelligence (go-to-definition, find-references, hovers, etc.)
Not everyone needs these things. But users who do need them say that they save a lot of time and make them more productive.
At Google, for example, they have a similarly advanced internal code search system that developers love (see https://static.googleusercontent.com/media/research.google.c... and https://docs.google.com/document/d/1LQxLk4E3lrb3fIsVKlANu_pU... for research/numbers).
If your needs are met by GitHub's search, then I would still suggest using the Sourcegraph Chrome extension (also available for Firefox), which adds code intelligence to code you view on GitHub: https://chrome.google.com/webstore/detail/sourcegraph-for-gi....
> You may not release the results of any performance or functional evaluation of any of the Software to any third party without prior written approval of Sourcegraph for each such release.
I note with some distaste that it includes an Oracle-esque prohibition on benchmarking.
> You may not release the results of any performance or functional evaluation of any of the Software to any third party without prior written approval of Sourcegraph for each such release.