There’s two separate issues here, but they have both the same cause: Negative (!) patterns mean that the entire tree is scanned (not hashed!) to detected explicitly included patterns below an ignored one. Example ignores:
This will detect and add a file parent/foo, even though parent itself would be ignored.
So yes, Syncthing is scanning it all with your patterns
The error comes from the filesystem watcher (to continuously pick up changes) which for the same reason needs to setup watches for the entire tree, but opposed to our own scanning cannot deal with errors on ignored paths by just ignoring them (any error means the entire watch setup fails).
You are right of course. But what I mean is that IF (and only if) all the inclusions start with a slash, THEN SC doesn’t need to scan everything because it knows that ALL inclusions will be located within these folders.
That is not really a special case pattern implementation in my opinion. But rather a logical way to interpret the patterns.
The word IF is exactly what makes it a special case.
I am not against the idea as it’s a potential optimization to reduce scan time, but I’d rather people fixed their permissions/folder structure for issues like this. There is nothing preventing you from having two separate folders pointing at the things you want to sync.
Sure, but it was just an example. They could be more and then it would be quite tedious.
The concrete use case is that in Linux many programs store their configurations files in the home directory. I want to synchronize some of these program configs to my laptop. An example is Thunderbird, Remmina and Gimp but there are more:
Instead of adding these folders one by one, it would be so much easier to only include these folders from the Home dir.
I believe it would be fairly easy to implement.
Sure, and I have done that. The only issue is then the very slow scan time which isn’t really necessary here.