Skip to content

cleanup: matchesIgnore is an incomplete glob, doesn't support **, !, or ? #32

Description

@gitcoder89431

Problem

The client-side matchesIgnore in internal/syncthing/client.go only handles three cases:

  • node_modules/ (trailing slash = dir match)
  • *.ext (single leading wildcard)
  • Exact name matches

Syncthing's .stignore format also supports:

  • ** (recursive glob)
  • ? (single character wildcard)
  • !pattern (negation/re-include)
  • (?i)pattern (case-insensitive flag)

If a user adds docs/**/*.md or !important.txt to their .stignore, the TUI file list will show incorrect sync/hidden state for those files.

Fix

Replace the hand-rolled matching with filepath.Match for basic glob support, and handle the ! negation prefix. Document that ** and Syncthing-specific flags ((?i), (?d)) are not fully supported client-side, as full support would require reimplementing Syncthing's ignore engine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions