Skip to content

Conversation

@audibleblink
Copy link

ITPR: Naive way to skip files that don't have matches. Hitting enter gets tiring on orgs with hundreds of results.

Hollar if it needs further attention or if you see this breaking functionality down the line. I can dive deeper if you think this would be a nice-to-have.

@the-bumble
Copy link
Contributor

Hi audibleblink,

So, I've been thinking about this issue. Match-less files are actually a bit more complicated then they seem. The reason they show up at all is because of the way that the backend Github code search API tokenizes queries.

You can't use the following wildcard characters as part of your search query: . , : ; / \ ` ' " = * ! ? # $ & + ^ | ~ < > ( ) { } [ ]. The search will simply ignore these symbols.
From https://help.github.com/en/articles/searching-code

All these characters are basically just transformed to spaces. So, we get back results that are not "true" matches. We could just auto-skip these items entirely, or add a --skip-no-match flag. Thoughts? There may be few / if any matching search results for queries with lots of ignored symbols.

Also, why did you introduce a sleep in the autoskip? Was GitGot getting rate-limited too quick?

@audibleblink
Copy link
Author

Hey @the-bumble,
Correct about the sleep. For my use case, I commented out these filters because the org I was searching was returning too many low-fidelity results. I started getting all the blank results which led to my patching the way I did. After making those changes, I got hit with the pause screen.

If you think it possible to miss data by skipping the TUI prompt for results that are empty, then the --skip-no-match or --skip-empty seems like the way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants