I’ve written a script, correct_lens.lua, to provide a means to non destructively correct the lens information used by darktable. In the past if your camera didn’t correctly identify your lens then the only way to correct it was to use exiftool to modify the image file and rewrite the lens information. correct_lens builds a lookup table of lens string corrections, then applies that to the darktable database information for an image and doesn’t modify the image file at all.
I’m putting this out for testing right now to see if it meets the needs of other users, and to see what I didn’t think of. I’ve tested it and I use it every time I shoot to correct the lens information. However, you might want to back up your library.db file prior to trying it just in case there’s a bug I missed.
The script is at https://github.com/wpferguson/correct-lens. The README has lots of information about the script and how to use it as well as performance information.