News for hackers. Stuff that matters.
Re:How I configure my Git identities by kevindamm on Monday November 25, 2024 @07:14AM (#42235595)
I don't think you can -- the key's identity needs to match the name/comment/email it was generated with. You would have to regenerate after every name change to have them all verified (and keep them all in file with the got server afterwards, too).
Re:How I configure my Git identities by tecleandor on Monday November 25, 2024 @08:01AM (#42235921)
I'd say that in general it verifies it with the email, but it depends.

I just did a test with four commits with a signature matching both on user and email, only on email, only on user, and in none of them and:

From GitHub, it validates signatures with the email registered in the commit: If the signature matches the key registered for the GitHub user with that email address, it says "Verified" in a green box. If it doesn't , it says "Unverified" in a yellow box.

So GitHub "Verified" two commits: the one that matches all the fields and the one that only matches the email.

From git CLI, it depends on your configuration.

If you do a `git log --show-signature` at first it will complain with `error: gpg.ssh.allowedSignersFile needs to be configured and exist for ssh signature verification`. You need to set up a file with your trusted ssh signatures.

Once you set that up, it will verify ALL correctly signed commits, even if they don't match the commit email address. Seems like the signature and the commit can have different emails, so to speak: "commited by [email protected] and signed by [email protected]. The signature is valid by [email protected]".

Example I did, changing the email addresses:

  git show --show-signature 11906e1
  commit 11906e14155ae08b7e7e23f26aa9c04913ade5dd
  Good "git" signature for [email protected] with ED25519 key SHA256:9uU6+7pNNzwVEKTecpJE4Bmm2WXaqZXMZRLe9rJZ0ZY
  Author: fake name <[email protected]>
  Date:   Mon Nov 25 13:36:28 2024 +0100
Re:How I configure my Git identities by kevindamm on Wednesday November 27, 2024 @10:19AM (#42256724)
Thanks for the correction. I know I've had GitHub invalidate my credentials before for a mismatch but I didn't know it was only the email that's relevant.
Re:How I configure my Git identities by TeMPOraL on Monday November 25, 2024 @07:21AM (#42235648)
> needs to match the name/comment/email

Is that "/" an "and", or an "or"? I'd expect only e-mail has to match, leaving you free to change the user name.