My idea was to write a (maybe Python) script that parses the .stignore (and imported/sourced files) and then searches through the corresponding shared folder, which files actually match these patterns - and show them.
But before I try that, I wanted to ask if there maybe is already something like that or similar?
If no, the second question would be if the used syntax in the ignore files follows a certain existing standard or if it’s a custom syntax? In other words is there maybe some kind of existing library to import/use?
The reason I want to do this is that the interface of Syncthing unfortunately isn’t very helpful when it comes to really specific information about the actual files ignored or being stuck. Or maybe I’m too stupid to find it?!
Anyway… I guess some scripts or terminal tools to “extract” such information by searching through the data or by communicating with Syncthing itself, would be very helpful.
Since I don’t think I’m the first thinking about that I wanted to ask first, before doing anything.
I am not aware of anyone who has already done it. The syntax is based on standard wildcards (see glob library: https://github.com/gobwas/glob#syntax) and then extended, so it is custom. Syncthing does not tell you about ignored files in general, but it should tell you about files that create problems.
As far as I know the list of files returned by the route
/rest/db/browse of Syncthing’s REST-API only returns the files which are not ignored.
You could try to invert that list by iterating over the actual file system items. If an item is not in that list it must be either ignored or has not been scanned yet.
I suppose that makes more sense than re-implementing Syncthing’s ignore algorithm.
Thank you for your replies so far!
I agree that “re-engineering” the pattern matching in another language would probably be too complicated, especially since it wont update itself if anything changes. I guess the only sensible way would be to use Go and the Syncthing source directly to implement this.
Using the REST API and comparing the returned files seems to be way less work.
@neo2001 I need a script that shows me ignored files in a given Syncthing share as well. Did you succeed?