Skip to content

Next Gen Ignores: Requirements #2491

Open
0 of 2 issues completed
Open

Description

@calmh

This issue replaces the ones that relate to fundamental issues with how our ignores work. The following is the up to date list of requirements:

Certain Requirements

  • Must be understandable by someone who understands the interface in use by DropBox, OneDrive, etc.
  • Must be a simple tree view with checkboxes
    • Root of tree (=folder root) checked by default
    • Can uncheck root and then check just the branches that we want synced
  • Must be able to black list extensions
  • Must live in config (not .stignore files)
  • Must "live update". That is, if I ignore a file that was going to be pulled, we should not pull it. If I unignore a file that we are missing, it should be pulled shortly thereafter.
  • Must be able to specify if ignored files should be preserved or removed on directory delete.
    • Per what though? File extension? Directory?
  • Power user access to flexible, underlying patterns
  • Be able to to remove files for folders that are not picked, as it remove things that are now ignored.
  • Have inclusion and exclusion mode, ignore everything, include X, versus include everything, ignore X.

Maybe?

  • Per directory file extension black lists ("never sync *.tmp")
  • Per directory file extension white lists ("only sync *.doc")
  • Should sync between devices
  • Ability to ignore a directory by the presence of a special file in it (cachedir.tag).

Comments and discussion below. A project maintainer will keep the list above in sync as the requirements change or are clarified. Note that this is not a list of problems with the current system, but requirements for a new system.

Sub-issues

Sub-issues

0 of 2 Issues completed
Loading 2 sub-issues

Activity

  1. added
    enhancement
    on Nov 19, 2015
  2. added this to the milestone on Nov 19, 2015
  3. crccheck commented on Nov 19, 2015

    @crccheck

    Why not also keep .stignore, but make it sync between devices as .gitignore and .hgignore do? That way, there's a developer friendly way to keep files out. As someone who had to delete 100k node_modules files yesterday (not to mention .DS_Store, packages, build, .tox, etc), that would have save me 3 gigs of bandwidth and time.

    There's two distinct user stories:

    1. As a user to Syncthing who also knows Dropbox, I want a familiar interface for selectively syncing files so I only sync what I care about
    2. As a developer using Syncthing, I want a familiar interface for selectively syncing files globally so I only sync what I care about without additional set up every new install.
  4. calmh commented on Nov 19, 2015

    @calmh
    MemberAuthor

    A .fooignore file might come naturally to developers, but that's really the only demographic that expects a hidden file with a bizarre extension (think Windows). I think it's a developer accident that it exists at all in it's current form today - it's really a piece of folder configuration as anything else. Not having it in the folder itself also works better with read only folders - perhaps you want to share the contents of a DVD-ROM... (This also requires handling the non-existence of .stfolder, but there's a ticket for that.)

    Whether it syncs or not is really somewhat beside the point of the existence of the file, but I do think there should be at least an option to sync the patterns, yes.

    (You can do that today with a little #include hackery as well.)


    To bring it more in line with the actual ticket; what's the actual requirement that having an .stignore on disk fulfills?

  5. cdhowie commented on Nov 19, 2015

    @cdhowie
    Contributor

    I don't care where the ignore data is stored, but patterns allow me to express ignores in a concise manner and with more flexibility than a tree option. Please at least retain this functionality, if not in a file called .stignore then somewhere else. None of the options provided in this ticket summary will meet my needs.

    If the current pattern-based ignore option is removed I'm afraid I may have to stop upgrading Syncthing, as versions without pattern-based ignore wouldn't meet my needs.

  6. calmh commented on Nov 19, 2015

    @calmh
    MemberAuthor

    @cdhowie What are the needs, that are not covered by the tree options and the extension white/black lists?

  7. cdhowie commented on Nov 19, 2015

    @cdhowie
    Contributor

    There is no accommodation for prefixes in the current proposal. I can't be the only one with a ._* ignore.

    Neither is there a way to express a pattern along the lines of "ignore all objects named bin under directory foo" whereas we can do that today with

    /foo/bin
    /foo/**/bin
    

    I'm not asking you not to implement a nicer interface for new users, I'm asking you not to sacrifice the power users on the altar of the masses.

  8. calmh commented on Nov 19, 2015

    @calmh
    MemberAuthor

    Well, currently the masses are being lead to the slaughter en masse as they try to work the ignore system, so some sort of balance there is required. :D

    The prefix thing is a good point, and should probably be supported somehow. I need to think about the last one...

  9. AudriusButkevicius commented on Nov 19, 2015

    @AudriusButkevicius
    Member

    So the two could coexist, but power users will have to grasp their concepts around about the order in which it gets executed, etc.

  10. calmh commented on Nov 19, 2015

    @calmh
    MemberAuthor

    Well, yes. At some point whatever the user is configuring, graphically or text based or however, is going to to get compiled into some list of match objects of some kind. Today that's a list of regexps, unfortunately that's a bit inefficient to evaluate. But something like that; whatever it ends up being could of course be exposed in some way so that they can be input directly into the config or something.

  11. cdhowie commented on Nov 19, 2015

    @cdhowie
    Contributor

    whatever it ends up being could of course be exposed in some way so that they can be input directly into the config or something.

    I would absolutely be happy with that resolution, if there is a (somewhat) easy way to edit this in the GUI. Like an "advanced" button at the bottom of the simple UI that opens the list of compiled patterns, letting me fiddle with them.

    (I'd be willing to contribute dev time to making that happen, as this is an important feature for me.)

  12. calmh commented on Nov 19, 2015

    @calmh
    MemberAuthor

    Possibly. The way I could envision it in that case is that you'll probably have a simple default layout with a tree view and a list of extensions or something. Switch to advanced mode and you get the compiled patterns or something and can edit them at will. But once you've done that, you probably won't be able to switch back, as what you created in the advanced mode might not be expressible in the simple mode.

  13. cdhowie commented on Nov 19, 2015

    @cdhowie
    Contributor

    But once you've done that, you probably won't be able to switch back, as what you created in the advanced mode might not be expressible in the simple mode.

    Same thing I was thinking. Or, you can switch back, but you'll get a warning that your manually-modified patterns will get destroyed if you do.

  14. AudriusButkevicius commented on Nov 19, 2015

    @AudriusButkevicius
    Member

    I think we can keep what we have today and keep it the same way it is today, just add a thing before ignores which is the dir selector.

  15. calmh commented on Nov 19, 2015

    @calmh
    MemberAuthor

    Okay I added that to the requirements

  16. 88 remaining items

  17. added
    documentation
    needs-triage
    and removed
    enhancement
    on Oct 1, 2020
  18. hlovdal commented on Oct 11, 2020

    @hlovdal

    I have read through all the comments here and one takeaway is that syncthing ought to have something probably named Folder ignore profiles.

    • A shared folder can have zero or more folder ignore profiles associated.
      • Zero means behaviour exactly like today.
      • Examples: desktop, laptop and tablet.
    • When attaching a new device, the device with the folder content sends a list of all the currently associated folder ignore profiles to the blank device.
    • In addition to filling in the device id, the user must select which folder ignore profile to use where "None" is an additional choice.
    • The selected folder ignore profile will be used to create an initial .stignore file on the new blank device.
    • The .stignore file along with any files it includes (recursively) are the first files that are synchronized. Synchronization of all other files are delayed until this is done.
    • After this initial transfer, the .stignore file (and included files) is never automatically updated again, even if the profile is modified.
    • Folder ignore profiles are configured in folder settings in a new tab next to "Ignore Patterns".
    • Folder ignore profiles are not stored within the shared folder.
    • Folder ignore profiles should probably be synchronized between all the devices (and then needs conflict handling).

    The above can be implemented today without any dependency to any new ignore behaviour, and it will fully address the forget and race condition issues that @madumlao raised.

    The above should represent a complete MVP. Some smaller additional features that could be added later:

    • Force propagation of folder ignore profile updates. If you update say the "mobile" profile on your desktop computer, you can chose that this update should be sent to all devices. If a device receives a profile update that matches the profile that initially was used, then it can be applied automatically if configured to do so or have it as a pending question for the user to confirm before doing the update. This means that profiles need a unique id so that renaming from "mobile" to "mobile phone" does not break things.
    • Allow for re-selection of profile.
    • A folder ignore profile could either be folder specific or global (possible to share between multiple shared folders).

    The force propagation ting might not be that important since it effectively already can be achieved with a simple #include .stignore.mobile.

  19. philipbowser commented on Dec 7, 2021

    @philipbowser

    So a GUI could translate all the checkboxes into specific include and exclude patterns and vice versa. An additional textbox could be provided for advanced patterns.
    I think it should actually be possible to combine the two. So when I have whatever patterns in my list, I should be able to filter all the ones, that specify a specific file or directory (no wildcards) and translate them into a treeview and vice versa without losing anything.
    So I could even show an advanced mode to edit all patterns and then switch back to treeview. Best of both worlds! :-)

    This seems like the way to go. Have the tree view checkboxes just populate the ignore pattern text box with the specific include/exclude patterns, then advanced folks can still add their advanced patterns if they need it.

    I think the most crucial elements of this, even if a tree-view with checkboxes isn't implemented, are the needs to see what files and folders have not been synced yet (so you don't have to download potentially hundreds of gigs of data just to find out what to ignore) and to have this be a per device setting. If you could see a representation of what you don't have on your computer, and check a box to start syncing only the folders you need, then Syncthing would be easy to deploy in a mixed skill level environment where not everyone who's using the share is a power user.

  20. junkhacker commented on Jan 6, 2022

    @junkhacker

    i've tried to find if this has been suggested before and i don't see it if it has been, but i'd really like to see the option of adding a "ignore-missing" flag on includes.
    the ability to have just a simple
    #include .stglobalignores ignore-missing

    i think this would solve many people's issue regarding the desire to propagate ignore patterns without the issue of syncing stopping due to a failure to load the ignore patterns until the included file is synced.

    a possible enhancement on the idea might be for new folder syncs that get created with a #include rule in their .stignore to seek out the existence of the file (first locally, then on other nodes) to sync before any other files (unless the included file is ignored itself within the ignore settings, of course)

  21. jtagcat commented on Jan 6, 2022

    @jtagcat

    The ignore-missing part can be considered a part of the path / second path; #includeopt/#includeoptional could be used instead (internally checking if the file exists, and calling include when it does).

  22. junkhacker commented on Jan 6, 2022

    @junkhacker

    fair point. i don't care about the syntax so much as the feature. plenty of ways it could be specified like:
    #optionalinclude
    #(?)include
    #(?m)include (m for missing)

    but i really think this would bridge the gap for features that a lot of people would like without adding a bunch of extra complexity to the ignore rules.

  23. madumlao commented on Jan 12, 2022

    @madumlao

    Just want to point out that I very recently added a machine to my syncthing cluster and I was pleasantly surprised to see that the .stignore and .stignore_synced were automagically synced without me having to do anything.

    I definitely don't recall this being there before, so whichever version this was added in, bravo.

  24. imsodin commented on Jan 12, 2022

    @imsodin
    Member

    This issue is not meant as a catch-all container for any discussions related to ignores. I am locking it now, because the comments got more frequent and are detracting. If you have a question about ignores, something you think needs to be added to the info present in this thread or anything else related to ignores, open a topic on https://forum.syncthing.net

    And just to not leave this incorrect piece of information lingering as the last info in this thread:
    The file .stignore_synced has always been synced, and a file .stignore at the folder root is still not synced.

  25. locked and limited conversation to collaborators on Jan 12, 2022
  26. removed
    needs-triage
    on Mar 10, 2023
  27. added theissue type on May 30, 2025
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

    documentation

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions