Live data from Hacker News

GitHub code search is generally available

github.blog

61–70 of 156 posts

Re: GitHub code search is generally available

#61

Earlier quoted context omitted.

Is the difference that now the basic search functionality actually works? The previous standard GitHub search I found to be remarkably bad. I would be looking at some small public repo, search for an exact string match I know exists in the code, scope the search to that repo only, and still see zero results. Even copy-pasting a line of code from a file in the repo often resulted in zero matches.

I don't get it too. Maybe one needs to enable something. The search is still useless. Locally I use git-grep.

It seems you still need to enable the feature. Click your user icon in the top right -> choose "Feature preview" in the dropdown -> enable the "New Code Search and Code View" feature.

Re: GitHub code search is generally available

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

I'm pretty sure sourcegraph.com has been doing all that (search all GH repos, exact search in quotes, case-sensitive search, regex search, limit files using filename regex) for longer than 5 years.

Re: GitHub code search is generally available

#65

Surprised more people aren't talking about how Microsoft has a near monopoly on the developer ecosystem. They've got GitHub, OpenAI, and VS Code all working together and collecting data that strengthen each other's products while also using their embrace, extend, extinguish strategy with WSL and all of these steer people towards Azure services whenever possible. Seems like something that verges on an anti-trust situa…

except windows itself is not loved by most developers, microsoft will take over the developer world when it replaces its windows with linux fully(instead of WSL2, which is nice but not great)

Part of the reason Windows isn't loved by developers is also hardware. So a switch to Linux won't fix this, unless they made the switch when Apple was releasing those horrific keyboards!

Re: GitHub code search is generally available

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

Loving the new Code Search! Might be super specific, but is there any syntax for searching attributes in HTML elements. For example if a React Component called what's the best way to find all the buttons that are red?

Re: GitHub code search is generally available

#68
post #55

Earlier quoted context omitted.

I don't get it too. Maybe one needs to enable something. The search is still useless. Locally I use git-grep.

Same experience here. Are there advertisement accounts posting here or something? Legitimately weird.

Ah, you need to log in to get access to the new code search!

Re: GitHub code search is generally available

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

Loving the new Code Search! Might be super specific, but is there any syntax for searching attributes in HTML elements. For example if a React Component called what's the best way to find all the buttons that are red?

Hmm, you can construct a regular expression, something like:

    lang:tsx /
Example:

https://github.com/search?q=lang%3Atsx+%2F%3CButton%5B%5E%5C...

Re: GitHub code search is generally available

#70

Earlier quoted context omitted.

I don't get it too. Maybe one needs to enable something. The search is still useless. Locally I use git-grep.

It seems you still need to enable the feature. Click your user icon in the top right -> choose "Feature preview" in the dropdown -> enable the "New Code Search and Code View" feature.

How that is not standard for the last 10 years is baffling.
Post reply on HN