Hi Nick,
I would very much like rclones handling of duplicate names to be predictable, visible and error out whenever there is a risk of unexpected data loss. I thought this was already general approach except for the notifications during sync, that is why I made this feature proposal.
While testing my fix I, however, realized that there are many situations where duplicates names are being ignored without notice and without a common set of rules.
I therefore consider it misleading to introduce a flag like --ignore-duplicates, because it would give a wrong impression of rclones behavior in all the situations where the flag isn’t used e.g. rclone cat remote:hello
Taking all of this into account I propose a revised change that is more in line with rclones current behavior, which is an improved wording of the current NOTICE to something like this:
NOTICE: someDuplicateName: Duplicate name found in source - ignoring %type%. Use rclone dedupe to find and fix duplicate names
and a fix of the duplicate name comparison in copy/sync/move to detect when a file and folder has the same name.
Here is a small example showing both in action:
> echo "Hello Duplicate File!" > ./testfolder1/hello
> echo "Hello Duplicate Folder!" > ./testfolder2/hello/duplicates
> rclone copy ./testfolder1 remote: -v --stats=0
2023/02/01 12:02:38 INFO : hello: Copied (new)
> rclone copy ./testfolder2 remote: -v --stats=0
2023/02/01 12:02:44 INFO : hello/duplicates: Copied (new)
> rclone lsl remote:
23 2023-02-01 12:02:29.539000000 hello
25 2023-02-01 12:02:32.135000000 hello/duplicates
> rclone copy remote: ./testfolder3 -v --stats=0
2023/02/02 14:40:32 NOTICE: hello: Duplicate name found in source - ignoring file. Use rclone dedupe to find and fix duplicate names
2023/02/02 14:40:33 INFO : hello/duplicates: Copied (new)