[Feature request] Switch Filter Priority

Discuss new features and functions
User avatar
Posts: 6
Joined: 7 Oct 2018

djwilec

Hello,

for further versions, it would be nice to switch the filter rules from include - exclue (allow - deny) to exclude - include (deny - allow). This would make filters more flexible and solves the one and other problems with configuring filters.
User avatar
Posts: 2272
Joined: 22 Aug 2012

Plerry

There is no priority in the filter rules, so nothing can be reversed from allow-deny into deny-allow.

As per the relevant FFS-manual page:
"Files and directories are only considered for synchronization if they pass all filter rules. They have to match at least one entry in the include list and none of the entries in the exclude list ... " ?
Is there any unclarity in that description?

If you have any specific "challenges" regarding using the Include/Exclude filter(s), particularly any where you feel your suggestion would be of benefit, please share those here.
Likely I will be able to help you translate those into FFS's presently implemented filtering method; a method that meanwhile already quite some years ago I rapidly learned to appreciate as logical, flexible and versatile, and has not disappointed me since.
User avatar
Posts: 6
Joined: 7 Oct 2018

djwilec

i would like only to sync the "include" path, without to define, what to exclude, eg:
/subfolder/*.txt would also sync /subfolder/subfolder/*.txt ... that not my suggestion..

therefore, if i would only sync /subfoder/*.txt i have to exlcude /subfolder/*/ ... but i think *.txt should only sync the files, not folders or files ins subsub folders?!

thats why i like filters in a ranking, first do that, second do that... not especially include/exclude...
User avatar
Posts: 2272
Joined: 22 Aug 2012

Plerry

What you describe above does not seem to be a "first do this, then do that" approach, but instead a re-definition of the de-facto industry-standard that an asterix ("*") stands for any number (including 0) of arbitrary characters, so including a slash ("/") or backslash ("\").

Your proposal seems to imply that an astrix ("*") would stand for any for any number (including 0) of arbitrary characters excluding a slash ("/") or backslash ("\") character.
But if that would be the case, how would you e.g. include all content of the root-folder and all of its sub-folders (presently: Include *) or e.g. include all *.txt-files in a sub-folder and all of its sub-folders (presently: Include /subfolder/*.txt) ? Particularly the first case is probably the most common use of FFS.
The only way then seems to be to explicitly include each and every sub-folder in the entire tree, which is obviously completely impractical and in many cases impossible as the folder-tree depth might not be known up front.

As illustrated per my questions above, I do not support a change in line with your suggestion.