Can we add per device global ignore patterns (with defaults for macOS and Windows)

Hi!

I’m a very happy new user of Syncthing, surprised how easy to use a piece of Open Source software can be! Everything was straightforward and easy to set up, except for one thing:

For some reason, Syncthing syncs .DS_Store files to my windows machine by default. Why does it do that?

So I searched Github issues, and people have been complaining about this for years, yet somehow nothing is being done about it.

The first issue about the topic was pretty clear, but it devolved into a bike shedding discussion whether to ignore .git folder by default or not: Github issue #837

Apparently it was decided that the ignore system needs to be overhauled: Github issue #2491 While a more powerful ignore system absolutely sounds like a powerful idea, it doesn’t really fix the very simple issue that Syncthing just shouldn’t sync .DS_Store and Thumbs.db

Then I found a thread here on the forum, which suggests enabling default ignore lists with #include patterns (Some thoughts on ignores syncing, includes, and defaults.) and there’s even a pull request open on Github that allows specifying default ignores for new folders (lib, gui: Default ignores for new folders (fixes #7428) by imsodin · Pull Request #7530 · syncthing/syncthing · GitHub).

Why doesn’t Syncthing just ignore .DS_Store and Thumbs.db per default? For every folder?

This is an issue that every Mac and Windows user is going to run into, and every user needs to figure out how the ignore system works, even if they just want to sync the complete folder, just because Syncthing syncs some hidden system files that it really shouldn’t sync.

So my wish would be to have a global setting in Syncthing, configurable in the UI, where you can add some ignore patterns that apply to every folder, and by default it contains these lines:

(?d).DS_Store
(?d).Spotlight-V100
(?d).Trashes
(?d)desktop.ini
(?d)Thumbs.db

If people really want to sync .DS_Store files they can do so by either changing the global ignore setting in the web interface, or by overriding patterns with the ! prefix in .stignore files.

Default patterns are in the works (see https://github.com/syncthing/syncthing/pull/7530). Global patterns (i.e. editable patterns applied to all folders) would be cool, but someone needs to do all the work to implement them.

As for per-OS ignore patterns, there is likely going to be some controversy with them. For example, there are way more things to ignore in Windows than just the two you’ve mentioned above (e.g. the Recycle Bin, Windows backup folders, and many other system folders located in the drive root). If ignore patterns were always filled with them by default, it would create a lot of clutter, which many people will likely not enjoy. Of course, such settings could be configurable, but still, a lot of work will be required to implement all of this.

Because Syncthing’s job is to synchronize files, and it synchronizes everything by default. As you mentioned, there have been a lot of talks about default ignore patterns, but different people have different needs, so synchronizing everything is a very understandable default behaviour that causes no confusion.