Earlier quoted context omitted.
Sorry, there are size limits on the number of files in a repositories that we'll index. That is probably why your repository wasn't indexed. Out of curiosity, what are you storing in this repository?
Sequences of code from Python package releases from pypi, as an experiment I’m working on. They compress quite nicely as the deltas between releases are fairly small. I thought it would be nice to be able to search through them, but I guess the file limit was reached. That’s a shame.
The technology behind GitHub’s new code search
131–140 of 187 posts
Re: The technology behind GitHub’s new code search
#132> Just use grep? First though, let’s explore the brute force approach to the problem. We get this question a lot: “Why don’t you just use grep?” To answer that, let’s do a little napkin math using ripgrep on that 115 TB of content. On a machine with an eight core Intel CPU, ripgrep can run an exhaustive regular expression query on a 13 GB file cached in memory in 2.769 seconds, or about 0.6 GB/sec/core. But you don't…
That seems very slow by today's standards. There's a rather... eccentric guy who easily beat that almost 10 years ago with his implementations of string search: https://news.ycombinator.com/item?id=6954298
Re: The technology behind GitHub’s new code search
#133I'm curious if they'll open source Blackbird, it does not seem mentioned in the post.
Re: The technology behind GitHub’s new code search
#134Earlier quoted context omitted.
When trying out some C++ I was surprised by how many projects bundled the library source code, essentially finding any actual client code a pain.
As a C++ developer, I maybe-ironically have this same complaint with JavaScript projects ;P. I particularly hate it when people embed minified versions of libraries, as line-based search and display then will experience a hit for essentially every query on the one giant line that is tens of kilocharacters long.
If your language's package manager puts your deps within the repo directory by default, people will commit the vendored code. See: Node, Go (since go.mod).
As long as we can all agree that committing compiled code is a crime punishable by 24 hours in the shame cube.
Re: The technology behind GitHub’s new code search
#135Re: The technology behind GitHub’s new code search
#136Earlier quoted context omitted.
Thank you. This is SUCH an obvious feature that seems super trivial to implement.
I'm not sure how to read the post and come away thinking any of this is "super trivial", but I'd imagine if it were that easy, they would have done it already.
Re: The technology behind GitHub’s new code search
#137Earlier quoted context omitted.
Sorry, it cannot handle any of those cases. You're talking about the ability to find the literal `this::foo` but that's not how it would normally appear. It normally will appear anywhere inside a `namespace this` scope, which cs.github does not grok. And cs.github cannot address finding the definition related to a given call site. It doesn't even try.
You are correct, as I mentioned, we do not analyze symbols for C and C++ at this time.
I wonder if it would be possible to leverage LSP as a kind of tokenization generalization framework, or even piggyback off of the existing effort by incorporating search-friendly/-helpful metadata into future versions of the protocol spec.
Re: The technology behind GitHub’s new code search
#138Is it inverse frequency, so common bigrams get split last? And the goal is to be able to search on a larger gram that covers the more common trigrams as often as possible?
Re: The technology behind GitHub’s new code search
#139Re: The technology behind GitHub’s new code search
#140Earlier quoted context omitted.
I'm not sure how to read the post and come away thinking any of this is "super trivial", but I'd imagine if it were that easy, they would have done it already.
It's simple enough that most IDEs implement it. Take from that what you will.
It’s possible GitHub could also leverage those language servers (which would be super cool) but doing it at GitHub scale is certainly not trivial.
Poor man’s version using the new GitHub search would be to construct a regex that matches one but not the other.