6 ms·
Why should we use this instead of the github search (for our private repos) ?
by orsenthil 9y ago
Why should we use this instead of the github search (for our private repos) ?
- deleted 9y ago[deleted]
- drb91 9y agoI 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.
- zeusk 9y ago> Personally, I find it to be absolutely horrendous. Why is that so?
- drb91 9y agoThese are the reasons of which I am conscious: 1. There doesn't appear to be any relevancy sorting. It appears only the exact term is returned. If it’s not exact, I am not sure how to control whether or not it looks for an exact match and/or what strategy it uses to fuzzy match. Does it tokenize? Use some kind of levenstein distance algorithm? 2. The query results are hugely wasteful in terms of screen space. This means searching for a minorly common term in a large codebase is prohibitively time consuming compared to cloning + ripgrep or whatever. 3. There's no way to search file names + file content. It took me 7 years after github's creation to realize you could search for filenames if you press 't' on the repository. 4. No regex or globbing support, to my knowledge. This is before listing all the tooling (like sourcegraph) I would hope would be built into a source code repository to assist browsing but are strangely missing--every IDE and editor out there is much faster at casually browsing code because navigation is so much cheaper and frictionless. I mean overall it's not broken, it's just way less useful for searching a tree of code files than find/xargs/grep is, let alone ack/thesilversearcher/ripgrep. If the capabilities I'm describing are there, they're well-hidden. Github just isn't a good place to browse code.
- zeusk 9y ago1. I never really noticed that because I mainly use Sourcegraph's code-intelligence on open source projects and as a result search is something that I have to rarely rely on. 2. You can stylize any page using something like stylebot or a homebrew browser extension. 3. Although not something that I do often, I find the filename search on google (for OSS projects) quite accurate and then the chrome extension allows you to open that file on sourcegraph.com or inject code intelligence within the github page as well. 4. Github sort of supports regex like search, you can learn more @ https://help.github.com/articles/searching-code/ https://help.github.com/articles/searching-code/
- drb91 9y ago2) isn’t about style, it’s about the fact that the results are paginated. You end up needing to search the damn search results, which is super slow when you’re paginated and it could have been a screen scan if you could fill the screen with results and scroll rapidly through the rest. this is just honest feedback, not a value judgement.
- sqs 9y agoI don’t think the person you replied to is complaining about Sourcegraph. He is talking about how he dislikes GitHub code search, and it seems that he likes Sourcegraph.
- zeusk 9y agoI dislike github search too, especially the pagination part but the issues GP mentioned can be avoided by using some google-foo and Sourcegraph for Chrome :)
- sqs 9y agoOur 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-server-2-4#diff-search 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.com/en//pubs/archive/43835.pdf https://static.googleusercontent.com/media/research.google.c... and https://docs.google.com/document/d/1LQxLk4E3lrb3fIsVKlANu_pUjnILteoWMMNiJQmqNVU/edit#heading=h.xxziwxixfqq3 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-github/dgjhfomjieaadpoljlnidmbgkdffpack?hl=en https://chrome.google.com/webstore/detail/sourcegraph-for-gi....
- perfmode 9y agoIs code intelligence a paid upgrade for all languages?
- sqs 9y agoYes, code intelligence (go-to-definition, find references, hovers, etc.) on Sourcegraph Server is a paid upgrade for all languages. But you can try/use it for free on open-source projects using our Chrome extension (to get it on code you view on GitHub) at https://chrome.google.com/webstore/detail/sourcegraph-for-github/dgjhfomjieaadpoljlnidmbgkdffpack/reviews?hl=en https://chrome.google.com/webstore/detail/sourcegraph-for-gi... or on our public site directly at https://sourcegraph.com/github.com/gorilla/websocket/-/blob/server.go#L26:6$references:external https://sourcegraph.com/github.com/gorilla/websocket/-/blob/... (for example).
- j1elo 9y agoGitHub 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-words-in-github-organizations-code 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 9y agoSourcegraph CEO here. 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_LIBRARIES_GENERATION 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!
- j1elo 9y agoI'm the poster at SO :) Very cool! I'll definitely give it a try
- nqzero 9y agocan you only search a single repo at a time ? does it parse the code and store the AST, or is it just plain text ?
- sqs 9y agoIt searches multiple repositories at a time. That query above searches all repositories in the given organization. It does have code intelligence (parsing, semantic references and go-to-def, etc.) but that search is just a text search.
- karmakaze 9y agoGitHub search is quite useless. Results are incomplete in unpredictable ways. I've had good results with etsy/houndd.