vimv
vimv copied to clipboard
Don't overwrite files.
Input:
o1_foo.png
o1_bar.png
o1_baz.png
o2_baz.png
ls | wc -l # 4
vimv transform:
foo.png
bar.png
baz.png
bar.png
result:
foo.png
bar.png
baz.png
Either fail, or present the conflicted files (with possibly the original name as well, bonus points for checksum) only the second time.
Yes, we need something to prevent accidentally deleting conflicted (same name) files.
This also manifests when renaming a list of files that happen to share a running number. For example, from an empty test directory:
echo 01 > 01.txt
echo 02 > 02.txt
echo 03 > 03.txt
Run vimv and use Ctrl-a on each line to change 01 to 02, 02 to 03, and 03 to 04. The result will be a single file remaining in the directory called 04.txt that contains 01 because the operations were performed in order.