top | item 16119731

Sourcegraph Server 2.4: free, powerful search for private code

188 points| azmenak | 8 years ago |about.sourcegraph.com

82 comments

order

hanwenn|8 years ago

For people interested in searching code using an open source solution, you might be interested in Zoekt too, github.com/google/zoekt.

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:

https://cs.bazel.build/?q=%20

For example, https://cs.bazel.build/search?q=+r%3Atorvalds+craz%5Byi%5D&n... looks for craz[iy] across the Linux kernel.

sqs|8 years ago

Sourcegraph CEO here. Thanks for this post. We packed a lot of stuff into 2.4: faster, more powerful code search, Google Alerts-style search monitoring, diff searches, and more.

It’s now free on a single server for any number of users and repositories.

Happy to answer questions here.

akavel|8 years 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?)

sslalready|8 years ago

Just tried this out on some of our code bases. It appears to fail to generate snippets/highlights for all files that contain non-Unicode text, e.g. "Müller" in ISO-8859-1. Known issue?

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?

oxplot|8 years ago

> Google Alerts-style search monitoring

I expected email notifications but all I managed to do was to add the saved queries on the home page. Am I missing something?

demarq|8 years ago

For those of us associated with very many repos is there a way to limit cloning to only the ones we work with?

pathartl|8 years ago

What's the analytics/telemetry feature? I don't see it discussed on the site at all.

pvg|8 years ago

Can this be run without docker, somehow? It's nigh-unusable on OS X with it.

rswail|8 years ago

Do you have a non-docker installation? The equivalent of gitlab's omnibus would be awesome.

Particularly for things like postgres configuration etc.

ohstopitu|8 years ago

unrelated question to the server but related to Sourcegraph: Why did you guys switch away from the VS code style editor on the web to an uneditable one? I loved using it.

on an unrelated note: did you work on AWS SQS?

jitl|8 years ago

Do you have any publicly available security review documents?

egeozcan|8 years ago

Do you support mercurial? If not, is it planned?

senatorobama|8 years ago

Do you accept REMOTE jobs?

dvirsky|8 years ago

what's the underlying search engine?

mikevm|8 years ago

How does this differ from OpenGrok https://oracle.github.io/opengrok/ ?

sslalready|8 years ago

Wow, that's a pretty awful UI. The default search form screams "advanced search" from the late 90ies. The compare example looks pretty dated too. I think Kibana and Sourcegraph are on the right track with a single input field that accepts field:value type searches. They're great once you've learned them.

dman|8 years ago

Opengrok supports C/C++.

exikyut|8 years ago

the_common_man|8 years ago

Very cool, will give it a try later for our gitlab repos. Is gitlab supported?

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?

sqs|8 years ago

Yes, Sourcegraph supports GitLab repositories! Check out https://about.sourcegraph.com/docs/server/config/repositorie... and the section right below for auth. You'll need to add and authenticate them one-by-one in the config. Soon we'll be add direct GitLab integration like we have for GitHub and GitHub Enterprise, which will sync all (or selected) repositories using the GitLab API.

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.

tomalpha|8 years ago

Do you have any plans to add more languages to code intelligence? (Particularly C and C++)

orsenthil|8 years ago

Why should we use this instead of the github search (for our private repos) ?

drb91|8 years ago

I mean honestly if you are happy with github search you should stay where you are.

Personally, I find it to be absolutely horrendous. It’s so much faster to clone the repo and search it locally.

j1elo|8 years ago

GitHub search is pretty useless if you want to rely on it to find all uses of a given word, say during a refactorization

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)

sqs|8 years ago

Our users prefer Sourcegraph over GitHub for code search for multiple reasons:

- 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....

karmakaze|8 years ago

GitHub search is quite useless. Results are incomplete in unpredictable ways. I've had good results with etsy/houndd.

hetoh|8 years ago

What is the License for the free install ? MIT/BSD/Apache ?

teraflop|8 years ago

Here are the terms: https://about.sourcegraph.com/terms/

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.

benatkin|8 years ago

No, it isn't open source. It's similar to GitHub Enterprise.

alkonaut|8 years ago

Which version control systems are supported?