You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.stglobalignore file to be synced between nodes #424
enhancementNew features or improvements of some kind, as opposed to a problem (bug)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Add a new .stglobalignore file that works the same maner that .stignorefile but in this case the file is synced to other nodes.
The ignored patters are the concatenatios of both .stignore ans .stglobalignore files.
Using #includes does not solve the problem, because you force me the same to have the .stignore file, which is not replicated to the nodes.
I thing that using a ".stglobalignore" file is the most easy to implement, it's compatible with the way it works now and it's easy to the understand by the simple user. Also, you are sure that it will be replicated to the nodes, you not depend on having a ".stignore" on remote node to makes #includes.
and just use lamport clocks over IgnoresVersion and IgnoresBy to sync them up?
Nodes in read-only mode would still update IgnoresVersion and IgnoresBy (but not the content of Ignores) so that they could correctly advertise newer changes?
And we would store Ignores, IgnoresVersion and IgnoresBy as part of the config.xml?
Yes, but this is 2nd part of #502, whereby we have local ignore and global (synced) ignore per repo, so you have the full right not to use it (and use the local one instead) if you don't want others to know what you are ignoring locally.
Also, you'd probably want to have a flag saying "ignore global ignore".
Right. So the extension above really only reflects the (per repo) "Global Ignore Patterns" setting. That's fine. It's one more area where we might run into sync conflicts though, when patterns have been edited on more than one node.
Well, the clock doesn't really help in handling conflicts, just in deciding which version is the more recent when there are no conflicts. We'd need a full vector clock to detect conflicts. (Yes, this would be nice for files in general; it's just kind of a pain to implement with cluster membership that varies over time.)
I guess we don't really care about the fact that there was a conflict, the thing we do care about is eventual consistency or eventual conflict resolution.
One problem I see though, is that the patterns are different on different OS'es.
As in /root/mystuff/*/doc.txt != C:\Users\Administrator\mystuff\*\doc.txt
and that Windows doesn't support patterns as well as Unix does.
I guess the path separator issue can be solved by each node advertising their path separator, and then replacing that on the receiving end with a local version of the path separator for each pattern?
Now that I think about it, perhaps you are right, an #include directive would do the job just as well, and perhaps I am just too eager to introduce changes to the structs ;)
One problem I see though, is that the patterns are different on different OS'es.
As in
/root/mystuff/_/doc.txt != C:\Users\Administrator\mystuff_\doc.txt
and that Windows doesn't support patterns as well as Unix does.
This should not be true. As in .gitignore, file patterns should not differ between different OS'es.
In .stignorefile all patterns should be relative to repository folder, you can't use absolute patters.
The path separator should always be "/".
Git with it's .gitignore file works in this way, and people are used to it.
The easiest method to solve this is by allowing the user to use new ".stglobalignore" file is replicated to other nodes in the same way as the rest of the files in the repository.
Syncthing must consider the sum of the contents of the file ".stignore" and ".stglobalignore" to determine which files to ignore.
I see no need to change the current internal structure of SyncThing, the ".stglobalignore" should be treated like any other file in the repository and it simply should be evaluated as the file ".stignore" when you find it.
This is the way that, for example, GIT use to handle the .gitignore file, the .gitignore file is treated as any other file in the repository and it changes are committed to the repository as any other change, (unless file ".gitignore" is specifically included within it).
This is the way that developers are accustomed to deal with the ".gitignore file" so I think that is good to use it too in SyncThing.
I am just giving absolute paths as an example.
If we add an #include directive, you can create your own .stglobalignore and just include it without any black magic involved.
The only argument against #include is as follows.
Developers are accustomed to dealing with .gitignore, non-developers are not.
So you need UI for this to be honest.
enhancementNew features or improvements of some kind, as opposed to a problem (bug)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Activity
calmh commentedon Jul 20, 2014
Mmmyes, or some other mechanism to make it easier to sync ignore patterns between nodes (
#includedirectives in.stignoreperhaps?).kattunga commentedon Jul 20, 2014
Using #includes does not solve the problem, because you force me the same to have the .stignore file, which is not replicated to the nodes.
I thing that using a ".stglobalignore" file is the most easy to implement, it's compatible with the way it works now and it's easy to the understand by the simple user. Also, you are sure that it will be replicated to the nodes, you not depend on having a ".stignore" on remote node to makes #includes.
AudriusButkevicius commentedon Aug 26, 2014
So lets talk how we could do this.
Can we change
to
and just use lamport clocks over
IgnoresVersionandIgnoresByto sync them up?Nodes in read-only mode would still update
IgnoresVersionandIgnoresBy(but not the content ofIgnores) so that they could correctly advertise newer changes?And we would store
Ignores,IgnoresVersionandIgnoresByas part of the config.xml?calmh commentedon Aug 26, 2014
But we don't necessarily want to sync all ignore patterns...
calmh commentedon Aug 26, 2014
In fact, I might not want to tell the other nodes what files are being ignored.
AudriusButkevicius commentedon Aug 26, 2014
Yes, but this is 2nd part of #502, whereby we have local ignore and global (synced) ignore per repo, so you have the full right not to use it (and use the local one instead) if you don't want others to know what you are ignoring locally.
Also, you'd probably want to have a flag saying "ignore global ignore".
calmh commentedon Aug 26, 2014
Right. So the extension above really only reflects the (per repo) "Global Ignore Patterns" setting. That's fine. It's one more area where we might run into sync conflicts though, when patterns have been edited on more than one node.
AudriusButkevicius commentedon Aug 26, 2014
That's why we'd have basic lamport clocks, to ensure that everyone agrees on what the end result should look like, so there wouldn't be any conflicts.
calmh commentedon Aug 26, 2014
Well, the clock doesn't really help in handling conflicts, just in deciding which version is the more recent when there are no conflicts. We'd need a full vector clock to detect conflicts. (Yes, this would be nice for files in general; it's just kind of a pain to implement with cluster membership that varies over time.)
AudriusButkevicius commentedon Aug 26, 2014
I guess we don't really care about the fact that there was a conflict, the thing we do care about is eventual consistency or eventual conflict resolution.
One problem I see though, is that the patterns are different on different OS'es.
As in
/root/mystuff/*/doc.txt!=C:\Users\Administrator\mystuff\*\doc.txtand that Windows doesn't support patterns as well as Unix does.
I guess the path separator issue can be solved by each node advertising their path separator, and then replacing that on the receiving end with a local version of the path separator for each pattern?
AudriusButkevicius commentedon Aug 26, 2014
Now that I think about it, perhaps you are right, an
#includedirective would do the job just as well, and perhaps I am just too eager to introduce changes to the structs ;)kattunga commentedon Aug 26, 2014
Hi Audrius,
This should not be true. As in .gitignore, file patterns should not differ between different OS'es.
In .stignorefile all patterns should be relative to repository folder, you can't use absolute patters.
The path separator should always be "/".
Git with it's .gitignore file works in this way, and people are used to it.
kattunga commentedon Aug 26, 2014
The easiest method to solve this is by allowing the user to use new ".stglobalignore" file is replicated to other nodes in the same way as the rest of the files in the repository.
Syncthing must consider the sum of the contents of the file ".stignore" and ".stglobalignore" to determine which files to ignore.
I see no need to change the current internal structure of SyncThing, the ".stglobalignore" should be treated like any other file in the repository and it simply should be evaluated as the file ".stignore" when you find it.
This is the way that, for example, GIT use to handle the .gitignore file, the .gitignore file is treated as any other file in the repository and it changes are committed to the repository as any other change, (unless file ".gitignore" is specifically included within it).
This is the way that developers are accustomed to deal with the ".gitignore file" so I think that is good to use it too in SyncThing.
please, read again my post where I explain how I use SyncThing:
https://discourse.syncthing.net/t/syncronize-stignore-file/557
AudriusButkevicius commentedon Aug 26, 2014
I am just giving absolute paths as an example.
If we add an
#includedirective, you can create your own.stglobalignoreand just include it without any black magic involved.The only argument against #include is as follows.
Developers are accustomed to dealing with
.gitignore, non-developers are not.So you need UI for this to be honest.
kattunga commentedon Aug 26, 2014
After some thought, I agree that using #include directives is a good solution. I deleted my 2 last comments to avoid confusion.
Add #include directive to .stignore (fixes syncthing#424)
Add #include directive to .stignore (fixes syncthing#424)
Merge pull request #589 from AudriusButkevicius/include
Hout commentedon Feb 25, 2016
For osx users, mackup could help.