Hello from the GitHub code search team! I'm really proud of this release. It's the result of a year of hard work from multiple teams to bring the custom code search engine we built for cs.github.com to github.com. In the background, we've also spent a lot of time since the launch rebuilding the index format to let us scale up the system.<p>My colleague Tim Clem will be speaking at GitHub Universe today about some of technical details: <a href="https://githubuniverse.com/events/detail/virtual-schedule/49426c3f-89ed-477d-b6e1-ab08ee201aca" rel="nofollow">https://githubuniverse.com/events/detail/virtual-schedule/49...</a>
One feature for code search that I've wanted for some time that could unlock some really interesting results would be to allow search to reach into the git file history.<p>I've found myself sometimes thinking that something existed in a particular codebase and I go to look for only to discover that I'm unable find it. Then, I realize that the code I was looking for has been removed. I can only find it by browsing back into the history figuring out the events that led to the deletion or change. Being able to search the history would be killer IMO.
A couple of years ago you stopped indexing repos that hadn't had activity for a year [0]. Will such repos be indexed by the new code search?<p>[0]: <a href="https://github.blog/changelog/2020-12-17-changes-to-code-search-indexing/" rel="nofollow">https://github.blog/changelog/2020-12-17-changes-to-code-sea...</a>
My only problem with the new code search is I've noticed some examples where exact string searches fail to locate some matches. I was looking for callers of a function and assumed no results meant no callers. But a simple 'search all' in VS Code found results missing from GitHub code search.
I used this recently when I was searching for examples of CPython extensions implementing a particular feature, and it actually did help me find what I was looking for! I also used it when looking for examples of Github action workflows that did particular things.
It's nice that you can use the path: option to specify the file extension and/or the path to the file.
This looks very similar to the internal code search product at Google (called CodeSearch). If the quality of this is going to be anywhere near that of CodeSearch, I would use it every day
Honestly, I have caught myself looking for an advanced search option on my github page more than a couple of times. Just to remember that it does not exist. Long overdue!
Does it still only index the primary/default branch of a repository, or can it search within all branches? If it can now, can we filter the search for stuff within the branches of forks for a specific repository?<p>So many interesting work can only be found manually, laboriously (but is so rewarding) within the explore network graph where people work on their own branches in their own forks. Their code is never found from the search function.
> Way more than grep.<p>Heck, it'd be nice if the current system right now at least did grep with users being able to toggle POSIX options. It doesn't even do that.<p>Instead, I have to clone the entire repo to do a trivial lookup. To be fair, supporting this would require GitHub to do the compute themselves, but I have no idea what they could possibly be doing right now that's more effective.
Is this the product that tree-sitter-graph [0] is being used for?<p>[0] <a href="https://github.com/tree-sitter/tree-sitter-graph" rel="nofollow">https://github.com/tree-sitter/tree-sitter-graph</a>
I have been using cs.github.com religiously since it originally went into beta and it has increased productivity for me to insane levels. There are many features I still want but its usually *good enough
This will also improve the github.com code search, right? I always found it frustrating that I couldn't really search for exact strings, even using quotes. I hope this fixes that too.