Feature: Rich filter rules and file lists (--filter, --files-from, --exclude-from) #175
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Corresponding rsync flags/behavior:
--include,--exclude— filter rules (currently supported only as filename globs)--filter— rich include/exclude rule language with include/exclude/delete/protect actions--files-from=FILE— transfer only paths listed in a file--exclude-from=FILE,--include-from=FILE— read patterns from a fileCurrent FastSync behavior:
scanner.c:111-135matches--exclude/--includeonly againstentry->d_name(the bare filename), using a simple glob matcher inutils.c:59. There is no support for directory matching, anchored paths, rule files, or rsync-style filter syntax.Proposed changes:
--filter,--files-from=<file>,--exclude-from=<file>,--include-from=<file>FilterRule* filter_ruleslist; each rule has type (include/exclude), pattern, and anchor flags/foo), directory patterns (foo/), and recursive rules (**)--files-fromto bypass directory scanning and only transfer listed pathsPriority: medium
Rationale: Advanced filtering is essential for syncing large trees (e.g., exclude all
.git/directories anywhere, include only a specific subtree). Current filename-only globs are too limited.Acceptance criteria:
--exclude '/build/'excludes any directory namedbuildat any depth--files-from=list.txttransfers exactly the listed relative paths--filter='- *.tmp'produces the same result as--exclude '*.tmp'--files-from