Proton Drive CLI: Content-aware conflict detection for `filesystem upload -c merge`
Implement content-aware (checksum-based) conflict detection in the merge mode so that byte-identical files are skipped, avoiding redundant uploads, storage duplication, and version history pollution.
Problem
The Proton Drive CLI (filesystem upload -c merge) resolves file conflicts by filename only, not by file content. This means byte-identical files (matching checksums) are re-uploaded as new revisions instead of being recognized as unchanged and skipped.
Reproduction
- Set up a local directory
~/testwith files - Have corresponding
/my-files/teston Proton Drive containing some identical files - Run:
proton-drive filesystem upload -c merge ~/test /my-files - Files with identical SHA1 hashes are uploaded again as new revisions
Expected behavior
Files with matching checksums should be detected as unchanged and skipped. Only files with different content should create new revisions.
Actual behavior
All files in the target directory are uploaded regardless of content match. Version history shows duplicate entries with identical hashes, and storage is consumed redundantly (e.g., one ~4.38 MB file stored twice).
Impact
- Unnecessary storage consumption (duplicate revisions for identical content)
- Cluttered version history with meaningless duplicate entries
- Wasted bandwidth on re-uploading unchanged files
- Poor sync efficiency, especially for large directories with many unchanged files