mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-04 10:30:23 +00:00
file conflicts: add option to rename (add suffixes) #23
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @marcospb19 on 2/12/2025
Instead of asking
overwrite? (y/n)
Ask
overwrite? (y/n/rename)
Which accepts 'r' as the answer.
Later we can add a flag
--rename
(can bikeshed) to skip this question (same or different PR).Proposed renaming behavior:
The file
path/to/file.ext
should be renamed topath/to/file-1.ext
, but only for the file and folder paths that actually conflict (we can't detect conflicts in advance with how unpacking works right now to ensure it's applied to all files).To clarify: if you add the suffix to
folder-1
, you don't need to add suffixes to files inside of that folder.If
file-1.ext
already exists, bump the number and try that again, this might require multiple tries, try up to99
and after just crash with a decent error message saying that we hit the limit and something strange is probably happening, people shouldn't rely on this behavior cause it's too wasteful and leaves tons of uncompressed archives taking space.Prior discussion: #766.