Repository navigation
sync: add pattern-based transfer ordering - #9766
Merged
Merged
Conversation
Allow --order-by to rank files using comma-separated rclone path globs. Patterns are evaluated in order, unmatched files are placed last, and path ordering makes ties deterministic. Fixes rclone#3975
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change do?
Adds pattern-based transfer ordering with syntax such as
--order-by 'pattern,*.tar.gz,*.md5'.Patterns use rclone's existing filter-pattern parser. Files are ranked by the
first matching pattern, unmatched files come last, and full-path ordering makes
ties deterministic. Invalid or missing patterns fail during option parsing.
The documentation covers matching, tie behavior, and the comma limitation.
AI assistance disclosure: OpenAI Codex assisted with implementation and
verification. I read the repository's AI-assisted contribution guidance, ran
the checks below against current
master, and take responsibility for thesubmitted change.
Verification performed:
go test -count=1 ./fs/filter ./fs/syncgo vet ./fs/syncgo test -race -count=10 -run TestNewLess ./fs/sync/make quicktest BUILD_SOURCEBRANCHNAME=order-by-patternsgolangci-lint run ./...(v2.12.2, clean LF checkout): 0 issuesmarkdownlint-cli2v0.18.1): 0 errors--check-first --transfers 1: observeda.tar.gz,b.tar.gz,a.md5,b.md5,notes.txtbad pattern globLinked issue
Fixes #3975
For new or changed backends
Not applicable; this changes sync ordering only.
Checklist