Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ignoring files based on an xattr value #9411

Open
DragoonAethis opened this issue Feb 10, 2024 · 2 comments
Open

Allow ignoring files based on an xattr value #9411

DragoonAethis opened this issue Feb 10, 2024 · 2 comments
Labels
enhancement New features or improvements of some kind, as opposed to a problem (bug) needs-triage New issues needed to be validated

Comments

@DragoonAethis
Copy link

This feature request is partially inspired by this PR on rye, a new Python project manager. It introduces a feature where it can automatically mark a directory excluded from sync for Dropbox and iCloud clients by setting a special extended attribute on the directory (com.dropbox.ignored or com.apple.fileprovider.ignore#P). It would be useful if Syncthing supported a similar mechanism.

I sync my workspaces which generally includes quite a few Python projects, most of which come with large virtualenvs. tl;dr: You don't want to sync virtualenvs. Virtualenvs contain installed Python libraries and helper scripts - they can differ a lot between OSes, so you can't cleanly reuse the same virtualenv if syncing files between Windows, Linux or macOS. They also contain thousands of almost exclusively automatically-managed files with unpleasant side effects in case of automatic sync conflict resolutions picking the wrong files, or mixing and matching files synced between different OSes. The project manager should take care of all this automatically on demand.

In general I think it would be useful for people syncing their code between multiple computers. The alternative is to put a special .stignore into project/workspace directories, but that requires either loose files per project, or having a top-level .stignore with /*/.venv and !/exception-project/.venv rules that is then managed separately on each device.

On the negative side, this feature can be very "opaque" - if a directory is ignored via xattrs, there's no clear feedback on why Syncthing just ignores a specific directory (nothing in .stignore, nothing wrong in logs) and can confuse users if enabled unconditionally.

@DragoonAethis DragoonAethis added enhancement New features or improvements of some kind, as opposed to a problem (bug) needs-triage New issues needed to be validated labels Feb 10, 2024
@calmh
Copy link
Member

calmh commented Feb 10, 2024

This is probably simple and clear on the source side of things, but less so on the destination, and ignore patterns apply to both. On the destination, architecture wise in Syncthing, it’s a bit late to discover a file is supposed to be ignored when we are at the point where it’s going to get written to disk. We want to know that when we process the incoming index data…

@calmh
Copy link
Member

calmh commented Feb 10, 2024

There’s also a fairly straightforward workaround available in that you can write a small script that walks your folder and writes these directories to the ignore file if they have a specific attribute set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or improvements of some kind, as opposed to a problem (bug) needs-triage New issues needed to be validated
Projects
None yet
Development

No branches or pull requests

2 participants