Live data from Hacker News

GitHub code search is generally available

github.blog

11–20 of 156 posts

Re: GitHub code search is generally available

#11
post #7

I'm Colin from GitHub's code search team, happy to answer any questions. For more info on how we built this, you can check out our technical blog post from a few months ago https://github.blog/2023-02-06-the-technology-behind-githubs...

How does it compare to Sourcegraph? What is the main differentiator?

Re: GitHub code search is generally available

#12
I have missed Google Code Search, which launched in 2006 and was discontinued in 2013. Similar to GitHub's code search, it supported searching by regex and filtering by language etc. - but obviously the amount of code to search through is orders of magnitude larger than it was 10-15 years ago. Still I wonder what took GitHub so long to build this - it's hardly a novel idea, and it seems like such an obvious power tool for programmers to have.

Re: GitHub code search is generally available

#13
post #6

I generally like the new code search, but I've got one big gripe: there's no way to sort code results by any kind of proxy for recency. The old code search had the ability to sort by indexed date. This wasn't perfect, but it was something. I like keeping up with who's using my code and whether they're leaving comments or commit chains that outline trouble they're having with it. Sometimes old code pops up in the rece…

(I work on code search.) Yeah, sorry about that. We've heard this feedback a lot. There's two reasons why we haven't implemented this. First, content is shared between repositories which makes this harder than before, when it wasn't. Second, we rebuild the index weekly or even more frequently, so the proxy of "when was this added" that was used doesn't work any more. What we would like to use is "when was this blob added to this branch" but that's extremely expensive to retrieve from Git because Git trees don't record it.

Re: GitHub code search is generally available

#14
post #12

I have missed Google Code Search, which launched in 2006 and was discontinued in 2013. Similar to GitHub's code search, it supported searching by regex and filtering by language etc. - but obviously the amount of code to search through is orders of magnitude larger than it was 10-15 years ago. Still I wonder what took GitHub so long to build this - it's hardly a novel idea, and it seems like such an obvious power too…

You could try https://sourcegraph.com/search

Though GitHub will probably have all the same features eventually and cheaper too.

Re: GitHub code search is generally available

#15
post #9
post #2

I have been using since the beta, truly the most impressive product released in the last 5 years (along with chatgpt). The amount of indexed code, the quickness and the precision of this search is simply stunning.

Could you elaborate more on why this is a significant feature? I can see how it would be handy to search a codebase online, especially one you don't have cloned locally, but for my own codebases, I can search the entire thing just fine in VS Code with ctrl-shft-f.

For me it's been very useful at finding codebases with work done on extremely specific niche things that would've been near impossible to find otherwise (e.g. tools for obscure protocols hidden away on obtusely named repos)

Re: GitHub code search is generally available

#16

I don't get the praise over GitHub code search. I find it very inaccurate and often missing references etc. Maybe it depends on the language you are using it with? (Go here)

Are you referring to what they just released? Github code search has always been notoriously bad. This is a new search product:

"today, our new code search and code view are generally available to all users on GitHub.com"

Re: GitHub code search is generally available

#17
post #9
post #2

I have been using since the beta, truly the most impressive product released in the last 5 years (along with chatgpt). The amount of indexed code, the quickness and the precision of this search is simply stunning.

Could you elaborate more on why this is a significant feature? I can see how it would be handy to search a codebase online, especially one you don't have cloned locally, but for my own codebases, I can search the entire thing just fine in VS Code with ctrl-shft-f.

Ever wanted to use an API and found the documentation to be lacking?

GitHub code search pretty much solves that. For any API you can find an example of someone else using it.

I've been using it for this for a year now and I wouldn't want to live without it.

Re: GitHub code search is generally available

#18

I don't get the praise over GitHub code search. I find it very inaccurate and often missing references etc. Maybe it depends on the language you are using it with? (Go here)

Have you tried the new search that was just launched? It seems to have significantly improved search accuracy. I agree the old version wasn't that great (though still was one of the better options for finding usage of things in the wild like rarely used OSS dependencies I needed to debug).

Re: GitHub code search is generally available

#19
post #17
post #9

Earlier quoted context omitted.

Could you elaborate more on why this is a significant feature? I can see how it would be handy to search a codebase online, especially one you don't have cloned locally, but for my own codebases, I can search the entire thing just fine in VS Code with ctrl-shft-f.

Ever wanted to use an API and found the documentation to be lacking? GitHub code search pretty much solves that. For any API you can find an example of someone else using it. I've been using it for this for a year now and I wouldn't want to live without it.

> For any API you can find an example of someone else using it.

Amazing. This was the light bulb moment for me. I work at [big tech co] and we have an internal code search tool, and anytime I need to use a new API I pull it up to find examples of how it's used.

Now I can do this for the entire world of OSS, amazing.

Re: GitHub code search is generally available

#20
post #13
post #6

I generally like the new code search, but I've got one big gripe: there's no way to sort code results by any kind of proxy for recency. The old code search had the ability to sort by indexed date. This wasn't perfect, but it was something. I like keeping up with who's using my code and whether they're leaving comments or commit chains that outline trouble they're having with it. Sometimes old code pops up in the rece…

(I work on code search.) Yeah, sorry about that. We've heard this feedback a lot. There's two reasons why we haven't implemented this. First, content is shared between repositories which makes this harder than before, when it wasn't. Second, we rebuild the index weekly or even more frequently, so the proxy of "when was this added" that was used doesn't work any more. What we would like to use is "when was this blob a…

Does this mean it will not be implemented?
Post reply on HN