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

File system watcher should skip ignored directories in more cases #9339

Closed
calmh opened this issue Jan 12, 2024 · 0 comments
Closed

File system watcher should skip ignored directories in more cases #9339

calmh opened this issue Jan 12, 2024 · 0 comments
Labels
enhancement New features or improvements of some kind, as opposed to a problem (bug) needs-triage New issues needed to be validated
Milestone

Comments

@calmh
Copy link
Member

calmh commented Jan 12, 2024

Currently the file system watcher will skip watching ignored directories in trivial cases:

/foo

However, as soon as there is something "tricky" like an exclude pattern, it doesn't:

/foo
!bar

(/foo is no longer skipped, because in the mind of the ignore matcher, we might find unignored stuff underneath it...)

However there are a bunch of simple cases like above where we can safely say that anything under /foo must be ignored, because any other patterns come later in the file and will never be processed.

@calmh calmh added enhancement New features or improvements of some kind, as opposed to a problem (bug) needs-triage New issues needed to be validated labels Jan 12, 2024
calmh added a commit to calmh/syncthing that referenced this issue Jan 13, 2024
This moves Result into a package of its own and cleans up the related
naming a bit. The ShouldIgnore() method goes away, instead callers use the
Match() method directly.

This enables the work in syncthing#9339.
calmh added a commit to calmh/syncthing that referenced this issue Jan 13, 2024
This moves Result into a package of its own and cleans up the related
naming a bit. The ShouldIgnore() method goes away, instead callers use the
Match() method directly.

This enables the work in syncthing#9339.
@calmh calmh closed this as completed in 3297624 Jan 15, 2024
@calmh calmh added this to the v1.27.4 milestone Jan 22, 2024
calmh added a commit to calmh/syncthing that referenced this issue Feb 2, 2024
* main:
  lib/model: Typo in method name (fixes syncthing#9389)
  lib/model: Typo in debug print (fixes syncthing#9386)
  build: Update dependencies (syncthing#9379)
  build(deps): bump actions/cache from 3 to 4 (syncthing#9363)
  lib/api: Improve folder summary event, verbose service (syncthing#9370)
  lib/protocol: Refactor interface (syncthing#9375)
  gui, man, authors: Update docs, translations, and contributors
  lib/fs: Add invalid UTF-8 guards to watcher (fixes syncthing#9369) (syncthing#9372)
  lib/api: Remove remnants of CSRF tokens file mentions (ref syncthing#9284)
  gui, man, authors: Update docs, translations, and contributors
  gui: Remove non-functional HTML from External Versioning tooltip (ref syncthing#8923) (syncthing#9358)
  cmd/ursrv: Add FreeBSD detection  (syncthing#9351)
  cmd/ursrv: Fix Arch detection (syncthing#9350)
  lib/ignore: Optimise ignoring directories for filesystem watcher (fixes syncthing#9339) (syncthing#9340)
  gui, man, authors: Update docs, translations, and contributors
  lib/ignore: Refactor out result type (syncthing#9343)
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

1 participant