To make git show --show-signature display the comment (in your case, benjamin_loison@benjamin-loison-framework) from your ~/.ssh/allowed_signers file in the signature verification line, you need to ensure that:
The comment is properly associated with the key in allowed_signers.
Your current allowed_signers entry is correct:
textbenjamin.loison@CENSORED.fr namespaces="git" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEomyoGWAGCMrc3sb2Vie7lVkMy5NBWvfWxAH/bqGeSw benjamin_loison@benjamin-loison-framework
The comment (benjamin_loison@benjamin-loison-framework) is already appended to the key.
Git uses the allowed_signers file for verification.
Git respects the allowed_signers file for signature verification, but the comment is not natively displayed in the output of git show --show-signature. The comment is only used for internal trust verification.
Git's --show-signature output is hardcoded to show:
benjamin.loison@CENSORED.fr).ED25519).SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8).It does not include the comment from allowed_signers in this line.
gpg or ssh-keygen to Verify the KeyYou can manually verify the key and its comment using:
bashssh-keygen -F benjamin.loison@CENSORED.fr -l
or
bashssh-keygen -l -f ~/.ssh/allowed_signers
This will show the comment, but it won't integrate with git show --show-signature.
Create a Git alias to append the comment to the output:
bashgit config --global alias.showsig '!f() { git show "$1" --show-signature --quiet | sed "s/Good \"git\" signature for \(.*\) with \(.*\) key \(.*\)/Good \"git\" signature for \1 with \2 key \3 (benjamin_loison@benjamin-loison-framework)/"; }; f'
Now, running:
bashgit showsig COMMIT_HASH
will append the comment to the output.
If you want the comment to appear natively, you would need to:
check_signature logic in signature.c).Create a script (e.g., git-show-sig) that:
git show --show-signature --quiet.allowed_signers.Example:
bash#!/bin/bash commit_hash=$1 sig_line=$(git show "$commit_hash" --show-signature --quiet | grep "Good \"git\" signature") comment=$(grep "benjamin.loison@CENSORED.fr" ~/.ssh/allowed_signers | awk '{print $NF}') echo "$sig_line ($comment)"
Make it executable:
bashchmod +x git-show-sig
Usage:
bash./git-show-sig COMMIT_HASH
allowed_signers in git show --show-signature.Vibe can make mistakes. Check answers. Learn more