bug report: filter (including inside excluded) works wrong in Ubuntu

Get help for specific problems
Posts: 6
Joined: 14 Sep 2017

syncer

the last example provided in the docs on filtering unfortunately doesn't work in Ubuntu :(
Example: Exclude a sub folder except for certain files

Set up two folder pairs with the same source and target paths but with distinct local filters:
Folder pair 1; local exclude filter: \SubFolder\
Folder pair 2; local include filter: \SubFolder\*.txt
when including "/SubFolder/*.txt" and excluding "/SubFolder/" FFS works as if "/SubFolder/" is excluded but "/SubFolder/*.txt" is not included

ubuntu 17.04 x64
ffs 9.3 build 9 aug 2017

screenshots:
Screenshot from 2017-09-15 02-30-33.png
Screenshot from 2017-09-15 02-30-33.png (152.24 KiB) Viewed 886 times
Screenshot from 2017-09-15 02-32-24.png
Screenshot from 2017-09-15 02-32-24.png (152.98 KiB) Viewed 886 times
Screenshot from 2017-09-15 02-32-54.png
Screenshot from 2017-09-15 02-32-54.png (158.88 KiB) Viewed 886 times
User avatar
Posts: 2451
Joined: 22 Aug 2012

Plerry

FFS is doing exactly what you are telling it to do!
The example in the user manual on Include/Exclude you refer to reads (my emphasizing):
Example: Exclude a sub folder except for certain files
Set up two folder pairs with the same source and target paths but with distinct local filters:
Folder pair 1; local exclude filter: \SubFolder\
Folder pair 2; local include filter: \SubFolder\*.txt
In your screenshot(s) you only use a single folder pair and thus a single, global filter.
As you exclude (all of) \Subfolder\, obviously \Subfolder\*.txt will also be excluded, as
Files and directories ... have to match at least one entry in the include list and none of the entries in the exclude list ...
You should do as described in the example:
You should create two identical left-right location pairs. You create a 2nd pair by clicking on the green "+" in front of the 1st pair left location (number 6 here), and define local include/exclude filters by using the red funnel icon in between each of the left-right location pairs.
Then you will almost certainly notice this also works in Ubuntu ...

B.T.W. I would expect that in Ubuntu you have to use forward slashes (/) rather than the (Windows) backward slashes (\).
But I have no experience with that
Posts: 6
Joined: 14 Sep 2017

syncer

thank you, I understood now!

it's a pity one cannot exclude some folders except some subfolders e. g.
include /projects/
exclude /projects/old/
include /projects/old/*.important.txt
include /projects/old/important/
in theory, this is not hard to implement, as simply the more nested a folder is, the higher priority it has

but this is simple only if there are no wildcards in left side of paths, so that algorithm is able to compare their nesting

for example, such idea is used in IntelliJ IDEA IDEs' family, when defining scopes of source code files, e. g. in the following image the following scope is defined
Screenshot from 2017-09-28 07-28-16.png
Screenshot from 2017-09-28 07-28-16.png (41.63 KiB) Viewed 860 times
I included the whole project ("js2" folder) recursively, except the "salt" subdir, which I excluded (therefore, the file "minion" is excuded too), but I included its subfolder "js2/salt/roots" (therefore, its contents -- file "top.sls" -- is included), but I excluded its subfolder "js2/salt/roots/common" (therefore, its contents -- file "init.sls" -- is excluded too)

though in JetBrains, they use their own logic syntax (the pattern is
(
file[js-2]:*/
&&!file[js-2]:salt//*
||file[js-2]:salt/roots//*
)
&&!file[js-2]:salt/roots/common//*
in this case), but the same sure can be done by more simple way, e. g.:
include:
js2/
js2/salt/roots/

exclude:
js2/salt/
js2/salt/roots/common/
wildcards are also permitted, but only on the right side of paths, e. g.:
include:
project/
project/important-archives/*.zip

exclude:
project/*.zip
User avatar
Posts: 2451
Joined: 22 Aug 2012

Plerry

Well, for sure your suggestions do not fit the present developer's choice of
Files and directories ... have to match at least one entry in the include list and none of the entries in the exclude list ...
Given the amount of questions in this forum directly or indirectly related to filtering, even the present relatively simple concept of include and exclude filter(s) is often only understood upon more elaborate clarification.
So, it is questionable if making the concept (even ...) more advanced/complex is the wise thing to do.

Nevertheless, the concept you suggest is interesting.
Probably your first suggestion (with alternating sequences of includes and excludes) is more easily understood (the latest applicable rule takes precedence over earlier ones) and is more easily applicable to include- or exclude-definitions that contain wildcards than your later suggestion, that would depend on specificity.
Looking e.g. at cascaded style-sheets (*.css), schemes based on specificity for many form a major obstacle.