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

filter: exclude=d/ should behave alike what exclude=d/** does #3375

Closed
pjw91 opened this issue Jul 24, 2019 · 3 comments
Closed

filter: exclude=d/ should behave alike what exclude=d/** does #3375

pjw91 opened this issue Jul 24, 2019 · 3 comments

Comments

@pjw91
Copy link
Contributor

pjw91 commented Jul 24, 2019

As discussed in the forum, --exclude d/ and --exclude 'd/**' works differently and this difference causes sync/copy mistakenly delete some files on the remote when --fast-list is ON.

Making --exclude=d/ works alike --exclude=d/** would be OK.

@ncw ncw changed the title exclude=d/ should behave alike what exclude=d/** does filter: exclude=d/ should behave alike what exclude=d/** does Jul 29, 2019
@ncw ncw added this to the v1.49 milestone Jul 29, 2019
@ncw ncw modified the milestones: v1.49, v1.50 Aug 27, 2019
@ncw ncw modified the milestones: v1.50, v1.51 Oct 26, 2019
@ncw ncw modified the milestones: v1.51, v1.52 Feb 1, 2020
@ncw ncw modified the milestones: v1.52, v1.53 May 29, 2020
@ncw ncw modified the milestones: v1.53, v1.54 Sep 5, 2020
ncw added a commit that referenced this issue Oct 27, 2020
Rclone uses directory exclusions to cut down the listing it has to do,
so before this fix `--exclude dir/` would make sure nothing in `dir/`
was scanned, **except** if --fast-list was used, in which case only
the directory was excluded and everything within it was included.

This is rather unexpected, so this patch makes `--exclude dir/` be
equivalent to `--exclude dir/**`, meaning that excluding a directory
excludes it and its contents.

We can't do the same for --include without changing the semantics of
filtering slightly.

Fixes #3375
@ncw
Copy link
Member

ncw commented Oct 27, 2020

I've made an implementation of this here

v1.54.0-beta.4847.51e810828.fix-3375-filter-dir on branch fix-3375-filter-dir (uploaded in 15-30 mins)

@ivandeex
Copy link
Member

ivandeex commented Feb 7, 2021

Closed after 4 months of inactivity
@ncw appears that branch fix-3375-filter-dir can be purged

@ivandeex ivandeex closed this as completed Feb 7, 2021
ncw added a commit that referenced this issue Feb 7, 2021
Rclone uses directory exclusions to cut down the listing it has to do,
so before this fix `--exclude dir/` would make sure nothing in `dir/`
was scanned, **except** if --fast-list was used, in which case only
the directory was excluded and everything within it was included.

This is rather unexpected, so this patch makes `--exclude dir/` be
equivalent to `--exclude dir/**`, meaning that excluding a directory
excludes it and its contents.

We can't do the same for --include without changing the semantics of
filtering slightly.

Fixes #3375
@ncw
Copy link
Member

ncw commented Feb 7, 2021

Thanks @ivandeex - I've now merged the above and deleted the branch!

This was referenced Feb 18, 2021
@ivandeex ivandeex mentioned this issue May 18, 2021
38 tasks
negative0 pushed a commit to negative0/rclone that referenced this issue Aug 13, 2021
Rclone uses directory exclusions to cut down the listing it has to do,
so before this fix `--exclude dir/` would make sure nothing in `dir/`
was scanned, **except** if --fast-list was used, in which case only
the directory was excluded and everything within it was included.

This is rather unexpected, so this patch makes `--exclude dir/` be
equivalent to `--exclude dir/**`, meaning that excluding a directory
excludes it and its contents.

We can't do the same for --include without changing the semantics of
filtering slightly.

Fixes rclone#3375
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants