News for hackers. Stuff that matters.
Re:Google Open Source Code Search by sqs on Wednesday March 11, 2020 @09:36PM (#22552641)
Sourcegraph CEO here. This is the same underlying code search offered for a while by Google Cloud Source Repositories for private code, and it’s cool to see this usable for Google’s own open-source code, too.

If you want to get universal code search for your own (private) code on any/all code hosts, Sourcegraph is easy to set up internally (self-hosted Docker install) at https://docs.sourcegraph.com/. Or you can get code search for all OSS projects at https://sourcegraph.com/search. More general info at https://about.sourcegraph.com.

Lots of Xooglers and current Googlers use Sourcegraph, too. Just mentioning Sourcegraph because I’ve seen several other folks mention us in the comments (thanks!).

Re:Google Open Source Code Search by dnpp123 on Thursday March 12, 2020 @04:32AM (#22554843)
Thanks. Sourcegraph seems better from my 1mn test ?

Following this article https://bugs.xdavidhu.me/google/2020/03/08/the-unexpected-go... recently featured on HN, I tried

https://cs.opensource.google/search?q=%2F%5E(%3F:(%5B%5E:%2F... : no result

https://sourcegraph.com/search?q=/%5E%28%3F:%28%5B%5E:/%3F%2... : 2 results !

Re:Google Open Source Code Search by voz_ on Wednesday March 11, 2020 @09:39PM (#22552665)
Great product. Used it extensively at Uber.
Re:Google Open Source Code Search by sqs on Wednesday March 11, 2020 @09:40PM (#22552678)
Thank you! Any complaints/requests/other feedback? How could we make it better?
Re:Google Open Source Code Search by escardin on Wednesday March 11, 2020 @10:41PM (#22553112)
Yes! Publish a graphql schema that is parseable by apollo graphql please! I tried to use your API on my companies internal source graph setup and had to hand roll my API calls because of these errors.
Re:Google Open Source Code Search by loicguychard on Thursday March 12, 2020 @05:22AM (#22555081)
Sorry to hear you this didn't work for you!

I filed an issue on sourcegraph/sourcegraph, would you mind posting more details there about the errors you ran into? https://github.com/sourcegraph/sourcegraph/issues/8970

Re:Google Open Source Code Search by HiJon89 on Thursday March 12, 2020 @08:09AM (#22555917)
Seems like this is in the works already, but the boolean operators in OpenGrok are so intuitive and powerful. I use them every single day and the lack of support in Sourcegraph immediately disqualified it for us. For example yesterday I was looking for Dropwizard Managed classes not annotated with @Singleton so I did:

Managed && !"@Singleton"

(I'm omitting the fully-qualified class name for brevity)

If I also wanted to look for HealthCheck classes I could update the query to:

(Managed || HealthCheck) && !"@Singleton"

I think it also helps that OpenGrok has a separate input for filtering file paths (completely splitting the "where" and the "what" parts of the query). And this file path search supports the same boolean operators. So if I want to narrow my search to two particular repositories I could put CrmSearch || AutomationPlatform into the File Path input. And because this input only handles file paths, I don't need to remember any special syntax. Whereas if you clump the entire query into a single input, then users need a way to tell you whether a search term applies to file paths or file contents.

Re:Google Open Source Code Search by rvttt on Thursday March 12, 2020 @01:18PM (#22559185)
Engineer at Sourcegraph here. Adding boolean operators is a priority on our roadmap, and expected to go live between May and July this year. On separate inputs: definitely something we've also identified and are actively working on. One recent experimental addition is "Interactive mode" that lets you enter patterns separately for repos, files, and patterns, and so on. There's a dropdown next to the query bar to try it out--there are some kinks, and we're currently working on making this a polished feature. Thanks for the feedback, and stay tuned!
Re:Google Open Source Code Search by HiJon89 on Thursday March 12, 2020 @06:28PM (#22562604)
Awesome, thanks for the response. Looking forward to trying out Sourcegraph again
Re:Google Open Source Code Search by voz_ on Thursday March 12, 2020 @01:51AM (#22554139)
I'm at FB now and we have an internal code search. I apologize, I can't recall any feedback for sourcegraph.
Re:Google Open Source Code Search by actionowl on Thursday March 12, 2020 @12:43AM (#22553854)
I've looked at this a few times but never given it a go. Going to actually try it this week for $DAYJOB.

One nice-to-have would be support for C, does the C++ extension work for C as well?

Thanks!

Re:Google Open Source Code Search by cforney on Friday March 13, 2020 @12:00AM (#22564594)
Yes, the extension supports C, C++, and C#! Sourcegraph supports over 30 languages out of the box using our basic code intelligence (search based heuristics and ctags).

Check out the recent release notes: https://about.sourcegraph.com/blog/sourcegraph-3.13#basic-co... And how out of the box code intelligence works: https://docs.sourcegraph.com/user/code_intelligence/basic_co...

Re:Google Open Source Code Search by actionowl on Friday March 13, 2020 @11:11PM (#22572891)
Thanks for the info!
Re:Google Open Source Code Search by monadic2 on Wednesday March 11, 2020 @10:14PM (#22552925)
What’s the code licensed under? It’s not clear from your site at first glance.
Re:Google Open Source Code Search by shoeffner on Wednesday March 11, 2020 @11:03PM (#22553277)
https://github.com/sourcegraph/sourcegraph/blob/master/LICEN... says: "LICENSE.apache (Apache License) applies to all files in this repository, except for those in the enterprise/ and web/src/enterprise/ directories, which are covered by LICENSE.enterprise."

Thus, Apache 2.0 and some custom license requiring you to accept the terms, have a correct number of seats, and does not allow you to "copy, merge, publish, distribute, sublicense, and/or sell the Software."

I am not sure what all of this means, though. Better check out the licenses yourself :)

Re:Google Open Source Code Search by sqs on Wednesday March 11, 2020 @11:00PM (#22553256)
It's open core (Apache 2 + some non-OSS parts for enterprise features). All of the code is public and we develop in the open at https://github.com/sourcegraph/sourcegraph.
Re:Google Open Source Code Search by dragonsh on Wednesday March 11, 2020 @11:39PM (#22553484)
Sourcegraph only support git repository so it's not very useful for enterprise with mercurial, svn or other distributed version control systems.

There is another open source application for code search opengrok [1] (it's completely open source unlike sourcegraph and supports multiple version controls beside git).

Take a look. It's easy to install and operate on bare metal, cloud and containers, instead of convoluted sourcegraph way of kubernetes or docker.

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

Re:Google Open Source Code Search by aurelianito on Wednesday March 11, 2020 @11:57PM (#22553600)
You always can bridge to git from svn and mercurial. It is almost seamless, and after generating the git repository everything will work.
Re:Google Open Source Code Search by dragonsh on Thursday March 12, 2020 @01:04AM (#22553957)
Many organizations don’t use or want to use git. This is another convoluted solution, trying to fit a square peg in round hole.

Another reason not to use sourcegraph is it’s proprietary (with some open source parts), unlike opengrok fully open source.

Re:Google Open Source Code Search by judge2020 on Thursday March 12, 2020 @01:41AM (#22554098)
Is the sourcegraph "open core" unlike how redis is "open core", eg. The main code is open but there are paid, closed-source modules and extensions?
Re:Google Open Source Code Search by sqs on Thursday March 12, 2020 @05:39AM (#22555163)
Sourcegraph is open core like how GitLab and VS Code are open core. You can run "Sourcegraph OSS" and get limited features, or you can run Sourcegraph (see https://docs.sourcegraph.com/#quickstart) and get all the features, but you need a license key when you hit the user limit.
Re:Google Open Source Code Search by zxienin on Thursday March 12, 2020 @01:42AM (#22554102)
Is there a variant of this that integrates with IDE of choice?