minio / mc

Unix like utilities for object store
https://min.io/download
GNU Affero General Public License v3.0
2.86k stars 548 forks source link

mirror: --preserve should not activate --overwrite #4821

Closed vadmeste closed 9 months ago

vadmeste commented 9 months ago

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers under the terms of the Apache 2 license. By creating this pull request I represent that I have the right to license the contributions to the project maintainers under the Apache 2 license.

Description

Users would expect mirror will not override anything unless --overwrite flag is specified. However, currently --preserve will activate --overwrite, which is not needed. This commit will fix this behavior.

Motivation and Context

Fixing unexpected --preserve behavior

How to test this PR?

  1. Mirror a folder to a bucket
  2. Add few chars to a file inside the folder and run mirror again with --preserve flag

Types of changes

Checklist:

harshavardhana commented 9 months ago

Actually, there is a reason for that @vadmeste mc mirror --preserve means overwrite anything on the destination with the latest source. The approach should be that overwrite is allowed automatically if it sees differences since --preserve is meant to be for such scenarios like cp -a

vadmeste commented 9 months ago

My guess is that this is not intuitive and no one is using this already.