nedbat / scriv

Changelog management tool
https://scriv.readthedocs.io
Apache License 2.0
260 stars 29 forks source link

Replace invalid config key scriv.user_nick with scriv.userNick #131

Open mdickinson opened 5 months ago

mdickinson commented 5 months ago

This PR is a proposed fix for #130: it replaces scriv.user_nick with scriv.userNick.

It's rather hard to write a regression test for the issue, since the error only occurs when invoking git itself, but I've tightened up the FakeGit.set_config method to reject most config keys that Git wouldn't allow. The GIT_CONFIG_KEY regex is based on my best guesses from reading the git-config docs: as I understand it, section names allow alphanumeric characters, "-" and ".", subsection names allow almost any character, and the key name must start with an alphabetic character and contain only alphabetic characters and "-".

I believe no backwards compatibility mechanism is needed here: it looks as though the old config key scriv.user_nick isn't accepted by Git, so presumably no-one is using this feature successfully. I did wonder whether this represents a recent change in Git, but I haven't managed to find any evidence that that's the case.