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
[WIP] Selective sync #1712
[WIP] Selective sync #1712
Conversation
return true | ||
} | ||
|
||
func (p *Pruner) ShouldSkipDirectory(path string) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't both ShouldSkipFile
and ShouldSkipDir
be a simple check for filepath.HasPrefix
on any of the patterns? The answer is only yes if it's a dir mentioned directly, or some subpath of a mentioned dir, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well a file will never be a prefix of any of the patterns.
A pattern might be a prefix to one of the files, but that does not imply that we need to sync it, as the base directory of the file has to explicitly match the pattern (minus the [^/]+
) bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I guess I should add /
to all dir patterns and to all dir paths passed in.
Looks generally sane to me, as far as the pruner stuff goes. The |
@st-jenkins retest this please |
@st-jenkins run integration tests please |
Need to address the comment I made, and some tests. |
So pruner now deals with The part which builds the tree sort of does too, but doesn't do proper anchoring (ending patterns with |
(I've taken over this branch and rebased it on top of current master, will close this as this is out of date; look for a new one in time.) |
Basically, request for comments/help regarding this pruner business, as it looks really bad.
Especially the fact that I can't toggle stuff on or off without having to go through the config, and relying on the order the AJAX calls are made to potentially detect that the flag has been toggled.
Alternatively I could rely on a nil slice to indicate it's on or off, but that's easy to mess up from the API consumer perspective.