-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude duplicate entries #24
Comments
@kshvmdn do you mean add multiple to the map per path that you're selecting from? Is there any reason why we can't if the user query's with Seems like as long as you preserve everything between Maybe I'm missing an edge case though. What do you think? essentially remove the noise and then the problem becomes a bit easier |
@jonesbrianc26 You're absolutely correct, not sure why I missed this idea. There's actually a method,
|
Fixed in #25! |
Duplicate entries are shown when any of the directories has a leading/trailing slash. This only applies to queries which select from multiple directories with at least one being a child directory of another.
Assume structure is as follows:
And you run the following queries
You should see that the first doesn't include
foo
twice, but the next 3 do.This can easily be solved with a new
Excluder
implementation which maintains a set (map[string]bool
) of seen directories to determine if the directory has already been traversed. I'm fairly certain that the best solution for this would be to use regex, but it may actually be more efficient to just add multiple entries to the map per file (no trailing/leading slash, trailing, leading, and both). There's a naive implementation of this inQuery.execute
.Very open to hearing other ideas!
The text was updated successfully, but these errors were encountered: