Skip to content

A way to really sync ignore patterns #2353

Closed

Description

@Schroedingers-Cat

It would be so great if we had next to .stignore an additional file called .stignore_synced so we can define ignore patterns on one machine and don't need to manually include them on all the other nodes.

ATM, you can include an external file in the .stignore however that entry won't get synced so basically it doesn't matter if you copy&paste one line or thousand lines on all of your nodes (except for when you change the ignore patterns, of course). With around 14 nodes this becomes a time consuming and extremely unnecessary task. This has not been considered in the issues I have found here (#424, #837 and #2115 ) so this should be reconsidered.

Having an additional ignore file that gets synced means you only have to set up the ignore patterns on one machine and even new nodes use the ignore patterns.

Activity

  1. AudriusButkevicius commented on Oct 3, 2015

    @AudriusButkevicius
    Member

    Why?
    As part of your initial setup, you include a file which is synced, and you are done.

  2. Schroedingers-Cat commented on Oct 3, 2015

    @Schroedingers-Cat
    Author

    I have up to 21 repos synced across 14 nodes. Reducing the amount of configuration steps to what is really necessary helps when dealing with such a setup.
    For instance if I set up a new node these are the steps only needed to include the ignore pattern:
    I first need to save the basic settings of every repo (you cannot directly enter the #include line to the ignore file when you accept a new repo), then click again on the new repo to expand, click on settings, scroll down (on an 1080p screen ...) to the ignore button, paste the #include line, hit save, scroll down and hit save again. And that for every repo. And that on every new node.
    Or whenever I have to recreate a repo I have to remember to include the ignore file. And let's not forget that it is no fun editing .stignore on Android.

    So why not?

  3. AudriusButkevicius commented on Oct 3, 2015

    @AudriusButkevicius
    Member

    You can just drop the same .stignore file in all the repo destinations before you even start adding them.
    Also, all of this is automatable and could become calling a single script which sets everything up via the API's ... you just choose to do it by hand like a masochist 😺

    Yeah, I guess we could do that, but my personal view is that I am not bothered, we should scrap/redo the ignore system in the first place, before adding more sugar on top of it.

  4. Schroedingers-Cat commented on Oct 3, 2015

    @Schroedingers-Cat
    Author

    The first point is only half a solution. It reduces the amount of work, but the work is still useless. Additionally, this would mean you have to use the same .stignore file for all repos, meaning you have to include machine specific stuff in another external txt file and whooops we have a st_ignore.txt and a st_ignore_synced.txt - just what I proposed in the first place.

    I didn't know you want to redo the ignore system. May I ask why?
    What I really like about it is that I can ignore folders/files/pattern unix style like /folder_a/file* and it would still work on Windows. When you redo the ignore system, please don't kill that feature.

    I've heard of the API (you are talking about this? http://docs.syncthing.net/dev/rest.html) however I don't know where to begin. What would a script adding the line #include st_ignore_synced.txt to every repo on an instance look like? I know Linux bash and Windows cmd, but looking at the API documentation I don't know how to talk to Syncthing's REST interface over HTTP on the GUI port.

  5. AudriusButkevicius commented on Oct 3, 2015

    @AudriusButkevicius
    Member

    Anyways, I still personally think this is a won't fix, as you can do everything do via the REST API.
    The fact that you struggle is because you do not automate, and you can't sustain a large cluster without automation, as you will always have a lot of manual steps.

    You can ask on the forums on how to set that up.

    As for ignores, it's now very hard to sync only some very deep directory, and only that directory, hence it should be replaced by selective sync, but selective sync will suffer from the same problem, which means it will be per device and not synced, and the ignores will only remain a list of extensions we ignore, rather than paths with magic wildcards like we have now.

  6. Schroedingers-Cat commented on Oct 3, 2015

    @Schroedingers-Cat
    Author

    This is not about using syncthing in a large cluster. It is about reducing the amount of having to re-enter (manually or by scripting) redundant data. Just because you can automate something doesn't mean a native implementation wouldn't be useful. Also please consider how error prone it is to let the user take care of adding ignorefiles to each repo of their machines or to let the user even automate that.

    It is better to have a simple solution to a simple problem. Making Syncthing support to sync an additional ignore-file would be no task for you guys. It would be even trivial, if #837 would add the line #include .st_ignore_synced.

    Automating via REST API means the user would have to make sure that a script gets called at certain points of time (syncthing start, adding new repository ...) on all nodes. That script also should deal with multiple syncthing instances on some machines with different port numbers (multiple users on the same machine...), credentials ... . And one would need to make it work on different OS (Win, Linux, Android...) . Of course, that can be done. But it's complex and requires a lot of work for users.

    the ignores will only remain a list of extensions we ignore, rather than paths with magic wildcards like we have now.

    Does that mean users won't be able to exclude file types from specific folders?

  7. jkufner commented on Oct 3, 2015

    @jkufner

    Why .stignore does not work exactly the same way as Git's .gitignore? Syncthing sould simply synchronize this file along with everything else (maybe with higher priority) and if user does not want it synchronized, he can add .stignore entry into .stignore file. Just like it is done with Git.

  8. AudriusButkevicius commented on Oct 3, 2015

    @AudriusButkevicius
    Member

    Does that mean users won't be able to exclude file types from specific folders?

    Yes

  9. Schroedingers-Cat commented on Oct 3, 2015

    @Schroedingers-Cat
    Author

    @AudriusButkevicius , why do you think that this would be an improvement? I have some repos with configuration files from a lot of software programs. So I need to sync certain xml files because they contain configurations I need on all machines (like my presets or preferences) but then in the same repo I need to ignore certain xml files as they contain machine-specific stuff like screen resolution, primary sound device, hard-coded paths to other resources etc. . Of course there are guidelines for every OS to differentiate between such content but 99% of the devs ignore it and Ignore Patterns with RegEx are the only way to get that mess working.
    Selective Sync and Ignore Patterns are different things for solving different problems. Why kill a good feature in favour of another feature with a different purpose?

    @jkufner I'd like that, too. So with an empty .stignore you'd get all your patterns synced while with an .stignore containing .stignore you'd get Syncthing's current behaviour.

  10. AudriusButkevicius commented on Oct 3, 2015

    @AudriusButkevicius
    Member

    why do you think that this would be an improvement?

    It's not about improvements, it's about mimicking what other pieces of software do, which seems to satisfy majority's needs, as majority now complains that you cannot exclude all directories apart from one deep directory. There will always be someone who's usecase is not satisfied. The reason why one has to die, because the other one is not compatible. Ignoring some directory and selectively syncing it makes no sense. Plus all the wildcard business in ignore patterns is very expensive and hard to get right.

  11. fragtion commented on Oct 6, 2015

    @fragtion

    I have an idea as a possible workaround. Let's say you're syncing a folder /abc/* on both devices. Syncthing will create an .stignore file in the /abc/ directory. Why not symlink that .stignore file to instead point to /abc/synced_ignores for example, for all the peers. That way if you edit the synced_ignores file it will synchronize across all the peers as normal. From my experience syncthing does not need to be restarted to apply changes to the .stignore file. As long as it follows the symlink correctly, I don't see why this workaround shouldn't work. AFAIK .stignore also supports #include, so you could have static .stignore's per peer, with the included file path pointing to the dynamic/synchronized list.

    Edit: I see another user has already applied this approach: https://forum.syncthing.net/t/useful-stignore-patterns/1175

    Edit 2: reading your post again, it seems you are already aware of these methods but are looking for a more convenient way of implementing them during initial setup deploy. Personally, I don't think it gets much easier than including a global sync file though, apart from your suggestion to mimic the way git does it, although this would have its drawbacks too - for example, " if user does not want it synchronized, he can add .stignore entry into .stignore file." that is bound to inevitably cause some confusion....

  12. AudriusButkevicius commented on Oct 6, 2015

    @AudriusButkevicius
    Member

    Well his problem is that you need to setup that static entry as part of setup.

  13. cdhowie commented on Nov 12, 2015

    @cdhowie
    Contributor

    the ignores will only remain a list of extensions we ignore

    At the risk of pulling this issue further off-topic...

    👎 👎 👎

    One of the HUGE problems that Syncthing solves for me is dealing with the obnoxious .DS_Store and ._* files that come from my Mac node and the thumbs.db files that come from my Windows nodes. I absolutely 100% do not want these replicated to other nodes. It's a waste of disk space and bandwidth. They cannot be effectively matched with suffix-only or extension-only matching.

    If the ignore-by-pattern feature is removed I would either have to turn off Syncthing upgrades, maintain my own fork, or move to a different piece of software entirely.

    Please don't sacrifice your power users on the altar of the masses. Both can coexist.

  14. Schroedingers-Cat commented on Nov 12, 2015

    @Schroedingers-Cat
    Author

    The reason why one has to die, because the other one is not compatible. Ignoring some directory and selectively syncing it makes no sense.

    If you add selective sync and keep regex, then selective sync shouldn't even offer the option to sync a regex-ignored folder. These systems are not incompatible.

    Plus all the wildcard business in ignore patterns is very expensive and hard to get right.

    But it works way better than in any other syncing solution I've used. So you got it very right! :) If it's computationally expensive, only those who use it will have their cpu doing something (useful, in my opinion).
    Has this matter been discussed anywhere else in detail?

    Back on topic, a global ignore list per repository would be very easy for the devs to implement (you got all the code running flawlessly, you just need to check another file for ignore patterns that gets synced ...) and quite useful for people either having lots of nodes, folders or both.

  15. calmh commented on Nov 19, 2015

    @calmh
    Member
  16. locked and limited conversation to collaborators on Nov 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions