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 (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