Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scriv.user_nick appears to be invalid as a Git config option #130

Closed
mdickinson opened this issue Jun 8, 2024 · 2 comments
Closed

scriv.user_nick appears to be invalid as a Git config option #130

mdickinson opened this issue Jun 8, 2024 · 2 comments

Comments

@mdickinson
Copy link

mdickinson commented Jun 8, 2024

The configuration docs say:

If you don't like the name it finds for you, you can set a name as the scriv.user_nick git setting.

But when I try this, I get an error from Git:

mdickinson@lovelace ~ % git config --global scriv.user_nick "mdickinson"
error: invalid key: scriv.user_nick

From the Git docs, I see:

The variable names are case-insensitive, allow only alphanumeric characters and -, and must start with an alphabetic character.

which leads me to believe that it's the underscore that's the issue here. If I try instead:

git config --global scriv.user-nick "mdickinson"

then the configuration succeeds, but of course then scriv doesn't pick this up.

Looking at other standard Git options, it appears the prevailing convention is camelCase, so maybe user_nick should be changed to userNick?

Scriv version: 1.5.1
Git version: 2.45.2

kurtmckee added a commit to kurtmckee/pr-scriv that referenced this issue Mar 24, 2025
git rejects the `scriv.user_nick` setting because of the underscore.

If specified in a command like:

```
git config get scriv.user_nick
```

git will reject the name as invalid and fail with exit code 1.

If present in a git config file, git will fail to parse the file
and fail with exit code 128.

The git reference manual has documented that only alphanumeric
and hyphen characters are allowed since at least git 2.0.5,
which was released in 2014 (11 years ago at the time of writing).

https://git-scm.com/docs/git-config/2.0.5#_configuration_file

No attempt has been made to provide backward compatibility
with the `scriv.user_nick` setting (with an underscore)
because it has been impossible for users to use the key name.

Fixes nedbat#130
@nedbat
Copy link
Owner

nedbat commented Mar 30, 2025

This is fixed in commit ac21ff9

@nedbat nedbat closed this as completed Mar 30, 2025
@nedbat
Copy link
Owner

nedbat commented Mar 30, 2025

This is now released as part of scriv 1.6.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants