Hacker News new | past | comments | ask | show | jobs | submit login
First release of mmv for over 30 years (github.com/rrthomas)
111 points by sc3d on March 15, 2021 | hide | past | favorite | 33 comments



I am the new maintainer of the venerable-yet-still-modestly-popular batch renaming utility, mmv (Debian popcon has 1.5k installs). I was astonished to find that other than a couple of bug fixes and a handful of portability patches by the Debian maintainers over the years, the code had remained pretty much untouched since 1990—quite an achievement by its original author, Vladimir Lanin, and his testers and helpers.

I picked up mmv because, having used it for years myself, I noticed that it deliberately refused to rename directories. There seemed to be no technical reason it could not do this, so I lifted the restriction.

I then took the opportunity to unifdef the code, ANSIfy it, add a modern command-line parser with gengetopt, use autotools and gnulib to make it more portable (including to Windows for the first time—the original version ran on DOS!), and remove custom code (including a memory allocator!) that is unnecessary on modern systems.

I also removed the fragile support for interactive renaming, which didn't cope with various odd filenames; this functionality is already well-served by renameutils, and a more recent program also called mmv.

The result is 60% the length of the original, most of the savings being from removing the DOS port. With a bit of luck, good for another 30 years!


Can you talk about the experience of starting to maintain it and gain acceptance for new commits from debian upstream? I've got my eye on a few little pieces of software to start working on but am afraid to make the leap.


Seconded, I would be extremely interested to hear this due to some code I have been working on that has been effectively abandoned.


I've done this before, usually you just contact the upstream maintainer, get access to the project either from them or via the abandoned projects takeover process of the project hosting provider, make a new release and file a bug with the Debian maintainer documenting the new release and new maintainer.


Interesting. The original maintainer has not responded to me at all, so it sounds like I'll have to do the latter.

Thank you for the input!


FTR, I've filed a request for the Debian package maintainer to update to your fork of mmv:

https://bugs.debian.org/985325


how does mmv do interactive renaming? i personally like the approach by qmv, which loads the filenames into a text editor where you can interactively change the names. combined with a powerful search and replace that's quite efficient and it allows you to preview the results because the actual renaming is not done until you exit the editor.


Interesting! Was there any test suite of some sort to help guide your work? I'm guessing something that's 30yo will have lots of unexpected usages and expectations.


It would be useful if the readme said what this program actually does.


This is a general issue with GitHub repos - people write awesome software and then their Curse of Knowledge causes them to think people open the repo and immediately know what it does. I wonder how much good open source gets ignored by less than amateur computer science folks like me.


This project predates github repos. The README file was renamed from a READ.ME file in the original source distribution. Finding out what a piece of software is worked differently back then. Not sure how though.


Its clearly missing the file_id.diz file


Looks like FILE_ID.DIZ appeared in the 90s and this software predates it.


You would read the printed manual


Or the magazine article...


You would type in the code from the listing at the end of the article.


those were the times. PEEKS and POKES and a list of numbers. ah, fond memories


Or maybe it included a textfile with the .nfo extension, which contained an ASCII-art skull.


I would just like to piggyback on this and say that in addition to this, an image or two goes a long way people. Especially if your program has a GUI!


This rings so true to me as well. I cant keep track of all the things ive passed up looking at or using because the readme gave no info on what it is actually supposed to do.


I agree, in the meantime the following quotes are directly from their groff manpage[0]:

> mmv - move/copy/append/link multiple files by wildcard patterns

> Rename files ending in .html.en, .html.de, etc. to ending in .en.html, .de.html, etc. in the current directory:

> mmv '*.html.??' '#1.#2#3.html'

[0]: https://github.com/rrthomas/mmv/blob/master/mmv-include.man


One of the two issues open is "Rewrite README" made by the maintainer fourteen hours ago.


"man mmv" tells it all.


I don't have mmv installed so that doesn't do a great deal.


A BIG thank you for this! A phenomenally useful little utility that saved my day more than once.

PS: back in the day, I'd read somewhere that the Linux equivalent of DOS's REN was "mv". So then I tried:

   mv *.CPP *.cc


I definitely read the same thing sopmewhere, but was always afraid to try anything too ambitious, especially with wildcards. My first impression of them was "these seem like a good way to mess up or lose a lot of files very quickly."

I wasn't exactly wrong!


Very efficient disasters!


ouch!


You know how you can catch the scent of a smell that instantly brings back memories? Seeing mmv on here is just like that bringing me back to hacking on DOS in the early 90s in my parents' basement at all hours of the night prior to going (and many times skipping) school. Kudos to you on pushing this utility forward!


I dig that. I’ve got two boxes of Apple ][ 5-1/4” diskettes sealed pretty tightly. I think the sight of their labels and _the smell_ will be tremendously evocative whenever I choose to open them next.


    <pedantic>
Is this a license violation or did Reuben Thomas get Vladimir Lanin's permission? The mmv license is rather strict:

Mmv is freeware. That means that the entire package of software and documentation is copyrighted, and may not be distributed with any modifications or for any charge (without the author's explicit written permission). Other than that, it may be used and distributed freely.


See https://github.com/rrthomas/mmv/blob/master/COPYING : the author changed it to GPL.


I like how it doesn't even state what it's for on the readme.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: