So a fiction character is maaybe OK, as long as it is clearly fictional name and no one else in the company does that; but other stuff, like actually impersonating other co-workers would be very bad, and should eventually leave to firing.
Anyway, if you simply[1] require commits to be signed with GPG, and enlist what GPG identities are acceptable, you are pretty much set (and you can instead rely on the signature instead of the author/committer metadata to identify the actual author).
[1] "Simply" and GPG signing don't always go hand-in-hand, I admit.
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 +0100Is that "/" an "and", or an "or"? I'd expect only e-mail has to match, leaving you free to change the user name.
It was super unhelpful when trying to do version control forensics. But if I'm being generous, I think maybe he was trying to remind everyone that anyone can put anything in their identity config, and we shouldn't trust whatever is in there for all that much.