find-stignore - a quick tool to show what is being ignored


((optional)) #1

Just going to leave this here for those who want some way to see what is being ignored by their .stignore file.

https://github.com/paulhargreaves/find-stignore

You’ll need to compile yourself. Enjoy. P.S. Very happy for a real API/part of syncthing to make this unnecessary :wink:


((optional)) #2

Now had chance to build a Windows binary; repo now has binaries for Linux x64 (tested on Ubuntu and Centos) and Windows x64.


(Audrius Butkevicius) #3

I am not sure this does the right thing. It seems to rely on files not being in syncthings database which might not always be true, as I suspect previously synced now ignored files will be in the database with the invalid bit set.


(Jakob Borg) #4

If I were to do this, I’d have made it a pure filesystem walk and used the syncthing/lib/ignore package to parse the ignore file and print matches.


((optional)) #5

as I suspect previously synced now ignored files will be in the database with the invalid bit set.

That doesn’t appear to be the case for the tests I did. I’d got several thousand files that were originally synced, then I added them to an ignore. That was several weeks (and version) ago. Then I looked at the database via the api and they don’t show up.

But maybe they get purged after a while? Regardless, the API documentation is pretty light on detail https://docs.syncthing.net/rest/db-browse-get.html doesn’t mention anything about ignored files or anything else.


((optional)) #6

If I were to do this, I’d have made it a pure filesystem walk and used the syncthing/lib/ignore package to parse the ignore file and print matches.

Feel free :wink: I’m sure several people would have found it useful.

More seriously though, this is my 2nd piece of go code, and the lib/ignore.go package isn’t documented - so it’s totally unclear (to me) on how to do anything with it.


(Jakob Borg) #7

Yeah that’s fair. Our internal-ish packages unfortunately aren’t really meant for public use. Here’s a quick example, without -print0 etc functionality (just give it the folder root).