Skip to content

Docs: / versus /* or /** - #5043

Closed
edwardxml wants to merge 1 commit into
rclone:masterfrom
edwardxml:patch-17
Closed

edwardxml wants to merge 1 commit into
rclone:masterfrom
edwardxml:patch-17

Conversation

@edwardxml

Copy link
Copy Markdown
Contributor

What is the purpose of this change?

Attempt to put prominently in docs the rsync - rclone filter difference. I was drawn to this by #3375 because I'm not sure if @ncw 's Commit there changes the behaviour.

Was the change discussed in an issue or in the forum before?

There have been several forum posts but the key prompt for me was
#3375

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

@edwardxml

edwardxml commented Feb 18, 2021 •

Copy link
Copy Markdown
Contributor Author

Not especially bright of me using a bullet point in the markup 🙃 but hopefully the means of highlighting the breakout point can be dealt and final fix to punctuation and wording can be sorted once it is clear whether the meaning is correct.

@albertony

Copy link
Copy Markdown
Contributor

I can't say if the meaning is correct or not, but if it is then its a good paragraph to have there.
Bullet point "list" with one entry, I don't know... Maybe instead of bullet point, just prefix it with "Note ..", or even "Note:"? That seems to be used a few places around the docs. Also "Important:" is used (https://rclone.org/commands/rclone_sync/ uses both), but I guess this is more of just a note than something "important"..

PS: I think there is a stray * at the end. Or did you actually intend surrounding with * to have everything in italics?

@ncw

ncw commented Feb 19, 2021

Copy link
Copy Markdown
Member

The change I made in 8897377 is a half way house to dir/ being exactly the same as dir/**

The whole ** thing causes a lot of confusion in general, and with the benefit of hindsight I think dir/ should mean exactly dir/**

From the commit

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.

However making --include dir/ be the same as include dir/** is a backwards incompatible change.

Now maybe I should make that change - I wasn't brave enough in that commit, but maybe I should do it and write it up in the change log.

$ tree .
.
├── dir1
│   ├── a
│   ├── b
│   └── c
├── dir2
│   ├── a
│   ├── b
│   └── c
└── dir3
    ├── a
    ├── b
    └── c

3 directories, 9 files

Demo that --include dir/ and --include dir/** are different now

$ rclone lsf -R . --include "dir1/"
dir1/
$ rclone lsf -R . --include "dir1/**"
dir1/
dir1/a
dir1/b
dir1/c
$ 
$ 

Demo that --exclude dir/ and --exclude dir/** are not different

$ rclone-v1.54.0 lsf -R . --exclude "dir1/"
dir2/
dir3/
dir3/a
dir3/b
dir3/c
dir2/a
dir2/b
dir2/c
$ rclone-v1.54.0 lsf -R . --exclude "dir1/**"
dir2/
dir3/
dir3/a
dir3/b
dir3/c
dir2/a
dir2/b
dir2/c
$ rclone lsf -R . --exclude "dir1/"
dir2/
dir3/
dir3/a
dir3/b
dir3/c
dir2/a
dir2/b
dir2/c
$ rclone lsf -R . --exclude "dir1/**"
dir2/
dir3/
dir3/a
dir3/b
dir3/c
dir2/a
dir2/b
dir2/c

Anyway to answer your question (finally!), I think your text is fine, but I'm not sure it should all be surrounded by *

@edwardxml

edwardxml commented Feb 19, 2021 •

Copy link
Copy Markdown
Contributor Author

Thanks @albertony and @ncw I will look at this over the weekend.

The difference between rsync and rclone is confusing but I can see exactly why you chose to keep the /foo/ syntax for listing optimisation which rsync doesn't need to bother with. I probably prefer the whole thing as it was but then I already went through the pain of figuring out using both rsync and rclone.

The prospect of --exclude and --include behaving differently freaked me almost as much as a process breaking change.

That said, at the end of the day my only real concern is that the documentation exactly follows what the code does.

Yes, my whole * thing was a mess!!

@edwardxml

edwardxml commented Feb 21, 2021 •

Copy link
Copy Markdown
Contributor Author

@ncw I am presuming --exclude... /foo/ being interchangeable with --exclude... /foo/** (except the former can also potentially optimise listing) will apply from 1.54.1?

Should I expect the corresponding change for --include will be baked in from the same build?

Indeed would @ivandeex 's #5023 optimize of --min-age and --max-age listing on Drive be expected to land at the same time?

@ncw

ncw commented Feb 23, 2021

Copy link
Copy Markdown
Member

The difference between rsync and rclone is confusing but I can see exactly why you chose to keep the /foo/ syntax for listing optimisation which rsync doesn't need to bother with. I probably prefer the whole thing as it was but then I already went through the pain of figuring out using both rsync and rclone.

:-)

I think if I was doing it again I would make dir/ and dir/** be identical for include and exclude. Having to add ** after directories is a major source of confusion for new users.

The prospect of --exclude and --include behaving differently freaked me almost as much as a process breaking change.

I think this particular change will be almost unnoticeable, thankfully, otherwise I wouldn't have put it in.

That said, at the end of the day my only real concern is that the documentation exactly follows what the code does.

:-)

I am presuming --exclude... /foo/ being interchangeable with --exclude... /foo/** (except the former can also potentially optimise listing) will apply from 1.54.1?

No from v1.55 (I don't put new features in point releases) and note that --exclude foo/ and --exclude foo/** will now behave identically including optimising directory listings.

Should I expect the corresponding change for --include will be baked in from the same build?

No, I haven't decided whether to make the change for --include - feedback needed! The change for --exclude is safe and almost unoticable. To do the same change for --include would be noticeable and might break stuff.

Indeed would @ivandeex 's #5023 optimize of --min-age and --max-age listing on Drive be expected to land at the same time?

That would be a v1.55 feature.

Note that the docs wouldn't go live until v1.55 either.

@ncw

ncw commented Mar 13, 2021

Copy link
Copy Markdown
Member

Are you happy with the text @edwardxml ? If so I'll merge what we've got so far!

@ivandeex

Copy link
Copy Markdown
Member

@edwardxml ping

@ivandeex ivandeex mentioned this pull request May 18, 2021
38 tasks done
@ivandeex

Copy link
Copy Markdown
Member

This pull request is abandoned for 3 months since 2021-02-23

@ivandeex

Copy link
Copy Markdown
Member

@edwardxml
Friendly ping. Did you forget about your PR?

@edwardxml

Copy link
Copy Markdown
Contributor Author

@edwardxml
Friendly ping. Did you forget about your PR?

Hi @ivandeex I'm just absolutely bogged down with real life.

Not likely to return to it for a while but would then need to update myself with the issues again.

I could have no objection to anybody picking it up or closing the PR to clean up clutter.

All the very best.

@ivandeex

Copy link
Copy Markdown
Member

This PR is waiting for volunteers.
cc @ncw @albertony

@ivandeex ivandeex added this to the Help Wanted milestone Jun 12, 2021
@ivandeex
ivandeex marked this pull request as draft June 12, 2021 19:49
@ivandeex

ivandeex commented Jul 12, 2021 •

Copy link
Copy Markdown
Member

Closing abandoned pull requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants