Repository navigation
Conversation
albertony
left a comment
There was a problem hiding this comment.
I think this looks good. No test, but maybe that's ok here (opt-in, not the most central code). I have a small comment regarding name of the flag, but its not a stopper, more thinking out loud...
There was a problem hiding this comment.
Naming things... We seem to spell out words like "directory" for most flags, and even for crypt backend we have this rather long --crypt-directory-name-encryption. However, its not very consistent, as for config we have two flags --temp-dir and --cache-dir. So I'm thinking if this should be --report-directories, or could it simply be --directories?
There was a problem hiding this comment.
Either of those would be fine with me! My thought was that dirs is consistent with --create-empty-src-dirs (the closest comparable flag) and also that shorter is better when it comes to flag names. But I am happy to change it!
There was a problem hiding this comment.
Ah, right, that is one command flag using the short, and plural, "dirs". I looked primarily at global and backend flags, I think. So it is even more mixed than I initially thought.
There was a problem hiding this comment.
He, he!
--report-dirs I think is OK! At some point I want to put these flags on sync/copy/move and for that --dirs is too generic.
724f990 to
4b12257
Compare
fixes rclone#6440 Before this change, check and cryptcheck would not inform the user of directory differences (for example, an empty directory that exists only on the src.) After this change, a new --report-dirs flag allows alerting users of such differences. Note that directories will be reported regardless of whether they are empty. They will be included in the total error count, but counted and summarized separately, and not included in output files. --report-dirs is ignored when --checkfile is in use.
4b12257 to
d19ee91
Compare
ncw
left a comment
There was a problem hiding this comment.
This is a nice feature - thank you for implementing it and sorry it has been hanging around so long!
I don't think this is reporting to the report files is it? And if we do that we should make sure directories get reported with a trailing / so users can tell them apart from files.
I think it should probably have a test.
I put some other things inline.
Thank you
| var ( | ||
| download = false | ||
| oneway = false | ||
| ReportDirs = false |
There was a problem hiding this comment.
This should be small r - ReportDirs
There was a problem hiding this comment.
He, he!
--report-dirs I think is OK! At some point I want to put these flags on sync/copy/move and for that --dirs is too generic.
| } | ||
| defer close() | ||
|
|
||
| opt.ReportDirs = check.ReportDirs |
There was a problem hiding this comment.
We shouldn't need this - it should be in the return of check.GetCheckOpt already.
There was a problem hiding this comment.
I could have sworn there was a reason for needing to do this... but 10 months later I can't remember what it was! I guess I'll try removing it and see if anything breaks 😅
| Fdst, Fsrc fs.Fs // fses to check | ||
| Check checkFn // function to use for checking | ||
| OneWay bool // one way only? | ||
| ReportDirs bool // report dir differences in addition to files |
There was a problem hiding this comment.
This changes the rc interface, so the docs need fixing up here
Line 721 in 94997d2
It does not currently report to the output files (this is mentioned in the commit message.) Do you think it should? All the other comments made sense -- will fix and add a test. |
I think that would probably be more useful if it appears in the output files
👍 |
What is the purpose of this change?
Before this change,
checkandcryptcheckwould not inform the user of directory differences (for example, an empty directory that exists only on the src.)After this change, a new
--report-dirsflag allows alerting users of such differences.Note that directories will be reported regardless of whether they are empty. They will be included in the total error count, but counted and summarized separately, and not included in output files.
--report-dirsis ignored when--checkfileis in use.Was the change discussed in an issue or in the forum before?
Checklist