bugrenameutils - Bugs: bug #64247, qmv to support rename operation...

 
 

bug #64247: qmv to support rename operation consisting of capitalization changes only

Submitter:  porg
Submitted:  Wed 24 May 2023 02:58:27 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 24 May 2023 02:58:27 PM UTC, original submission:  

My User Goal


Rename operation consisting only of capitalization changes in some characters but otherwise remaining the same filename.

Reproduction


1) I have a bunch of image files to be used on my website which follow the format:


Main topic - Sub topic OrdinalNumberLetterCombo remark at the end.png


2) I decided that `remark at the end` shall become `Remark at the end`, that is:

  • It shall start with an uppercase instead of a lowercase letter.


3) Hence renamed accordingly with qmv in its followup screen which uses the editor `nano` in my case:



Android v4 action bar basics.webp
           ↓
Android v4 Action bar basics.webp


Avoiding visual noise 1b annotated.webp
                         ↓
Avoiding visual noise 1b Annotated.webp


Avoiding visual noise 2 context.webp
                        ↓
Avoiding visual noise 2 Context.webp


4) When submitting that rename changes the rename operation fails with:



Plan contains errors.

  [ ... Lists of all the failed src → dest file pairs ... ]

  Destination file exists, cannot rename/copy

Entering interactive mode.
qmv>


Environment

  • qmv (renameutils) 0.12.0 installed via [brew](https://brew.sh)
  • macOS 11 Big Sur
  • Filesystem: APFS Case-insensitive


Questions / Assumptions

  1. Maybe your heuristics to determine whether a line contains a change or not do not consider pure capitalization changes yet?
  2. Or nr1 is identified as a change indeed, but when asking the case-insensitive filesystem, it tells you "file already exists"?


Proposals

  • Allow such an operation. Also on case-insensitive filesystems.
    • The extra safety criteria would be that if the destination column contains a duplicate the app aborts anyhow, but if the destination column has no dupes, so the dupes only occur on one or more of the `source → destination` pairs, those get processed as intentional.
    • The solution for this to work on a case-insensitive filesystem would be to  `mv desired-name.txt Desired-Name.txt.TMP`  in a first pass and then  `mv Desired-Name.txt.TMP Desired-Name.txt`  in order to avoid writing in place which may loose metadata (on some OS/filesystems).
  • Either just do this by default.
  • Or if deemed too dangerous then at least offer an explicit argument like   `--allow-mere-capitalization-changes`.
    • Short argument `-i` which is quite common on Unix CLI apps for "case-insensitive" in qmv is already used for "interactive", and -c already for "Sort by ctime (time of last modification)". So `-I` or `-C` could be the short form argument.
porg

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by porg (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code