why not .stignore in sub-folders?


It would be great to have .stignore files in nested folders to make folder exclusions more self contained.
Also if the a sub-folder is moved there would be no need to edit the root .stignore file to update all relevant paths.
Is there any reason to only support .stignore in the root folder?


It’s just a lot of additional complexity, as you’d need to track ignore patterns for every existing directory or load patterns on the fly for every operation, which outweighs the advantages by far. We are aware that syncthing’s ignore system has room for improvement and you could read lengthy deliberations on the topic here: https://github.com/syncthing/syncthing/issues/2491

1 Like

Rui Fortes,

I wonder if you could implement your idea with .stignore files that contain include statements referencing .stignores in sub-directories. Does syncthing do only one layer of includes or can they be nested?

We used to have this. But it makes it tricky to provide an in-GUI ignore pattern editor, and can have odd effects when just scanning part of the tree. Is ../foo a valid ignore pattern that affects another part of the tree, for example?

Includes are the remaining escape hatch, yes.