Closed adriangalilea closed 3 months ago
Are you editing the .stignore
files using the Web GUI or directly (e.g. with a text editor)? If it's the latter, please make sure that there are no funky invisible characters inserted into the file (e.g. BOM) that could possibly hinder with the ignore patterns, making them invalid in the process.
Normally, there should be no difference between how ignore patterns behave depending on the OS (except for some limitations on Windows).
Are you editing the
.stignore
files using the Web GUI or directly (e.g. with a text editor)? If it's the latter, please make sure that there are no funky invisible characters inserted into the file (e.g. BOM) that could possibly hinder with the ignore patterns, making them invalid in the process.Normally, there should be no difference between how ignore patterns behave depending on the OS (except for some limitations on Windows).
I'm using an editor, but a cli one(helix), I re-created the very same file several times, copy-pasting some times to avoid the possibility of typos, nothing.
It is particularly hard to diagnose, because when it decides to pick the whole ~
it takes solid several minutes to realize and 4 folders appear at once on my syncthing folder on the rest of the devices which is incredibly annoying, I have 0 indication that it's going to happen.
99.9% certainty.
I replicated it just once again, this time through the web UI, same result, completely ignores my .stignore, oh the irony :)
Could it be because I'm using ~
?
Could it be because is a git repo?
Why would it behave differently on the 2 machines... I have no idea, but is literally the same setup, copy-pasted >x5 times through different means.
This is a support request which should be handled on our forum. Please move the discussion there, until we are certain that an actual bug is identified.
Using a tilde for the folder path does not affect ignores in any way, they are always relative to the folder root. Therefore you shouldn't use it inside the ignore file of course.
For easier testing, un-share the folder for the other devices, or create a test folder at the same path, with different ID and no sharing. Also note that syncing the home folder is usually not encouraged. Although your special case of ignoring all but some specific files should work alright. As long as you don't mess up the ignore patterns.
This is very odd,
Should this:
*
!.env
Be the same as
!.env
*
??
Because it ignores everything that comes after the * in my testing.
Also !.env
and !/.env
does not behave the same, even tho .env
is literally on the root folder.
Perhaps it's because I've been hitting my head with this wall for too many hours...
I think doing this:
!.env
*
On both Linux and mac worked, and I can't quite put my finger on what is going on.
Should this:
* !.env
Be the same as
!.env *
??
No, the order does matter, so in this case *
needs to come last.
No, the order does matter, so in this case
*
needs to come last.
That's unexpected, as .gitignore doesn't behave the same(I know is not the same, but seems inspired on it).And is also undocumented :/
I still think I haven't arrived at the bottom of my issues, but I've been doing this for too many hours so will take a break now.
Well, maybe this counts as documented:
The .stignore file contains a list of file or path patterns. The first pattern that matches will decide the fate of a given file.
But a explicit example may be best, ideally in a warn style that says "order matters" it does not behave like .gitingore,
I did literally quoted that in the message above, I would suggest making that text bold at the very least.
Also, as I mentioned, I don't think that was all I was observing, but will keep testing and notify if that's indeed the case, many thanks to everyone regardless.
What happened?
I have 3 hosts:
My
~
is a git repo.Same exact
.gitignore
on the raspberry pi and on the mac.Same exact
.stignore
on the raspberry pi and on the macSame exact
config.xml
on the raspberry pi and on the macWhen I add Linux onto the synology, it'll work great, the .env file is synced.
When I add the mac, it just starts adding everything he has on
~
It doesn't matter how many things I tried. Raspberry pi
.stignore
works differently than on the mac.I just can't use it.
Syncthing version
v1.27.9
Platform & operating system
Linux aarch64 / Mac Sonoma 14.5
Browser version
No response
Relevant log output
No response