Requested previously in:
--filter=':- .gitignore' does not work. This reads .gitignore files as rsync per-directory merge filters. It does not implement Git ignore semantics and diverges on negation, anchoring, directory-only patterns, escaping and nested precedence.
git ls-files can provide an external solution when Git is installed and the source is a Git worktree. It does not provide native support for remote sources or ordinary directory trees containing .gitignore files.
I am not opposed to adding explicit native support. Before implementation, we should agree on the behaviour.
A possible interface would be an opt-in option such as --gitignore. It would interpret gitignore files on the sending side without silently changing the meaning of existing transfers.
The design needs to define:
- Whether nested gitignore files are supported and how their precedence is applied
- What anchored patterns are relative to when multiple source arguments are provided
- Whether only gitignore files are read or whether
.git/info/exclude and core.excludesFile are also in scope
- How Git exclusions interact with existing rsync filter rules
- Whether ignored files are protected from receiver-side deletion, consistent with ordinary rsync exclusions
- Behaviour for remote sources and directories that are not Git worktrees
- Whether Git-compatible parsing is implemented internally or delegated to Git
Thoughts? Open to discussion and implementations.
Requested previously in:
.gitignorefile as information to exclude files #721--filter=':- .gitignore'does not work. This reads .gitignore files as rsync per-directory merge filters. It does not implement Git ignore semantics and diverges on negation, anchoring, directory-only patterns, escaping and nested precedence.git ls-filescan provide an external solution when Git is installed and the source is a Git worktree. It does not provide native support for remote sources or ordinary directory trees containing .gitignore files.I am not opposed to adding explicit native support. Before implementation, we should agree on the behaviour.
A possible interface would be an opt-in option such as
--gitignore. It would interpret gitignore files on the sending side without silently changing the meaning of existing transfers.The design needs to define:
.git/info/excludeandcore.excludesFileare also in scopeThoughts? Open to discussion and implementations.