On Debian 13 with:

`~/.ssh/allowed_signers`:
```
benjamin.loison@CENSORED.fr namespaces="git" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEomyoGWAGCMrc3sb2Vie7lVkMy5NBWvfWxAH/bqGeSw benjamin_loison@benjamin-loison-framework
```

How to make:

```bash
git show COMMIT_HASH --show-signature --quiet
```
```
commit COMMIT_HASH (HEAD -> main, origin/main, origin/HEAD)
Good "git" signature for benjamin.loison@CENSORD.fr with ED25519 key SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8
Author: Benjamin <benjamin.loison@CENSORED.fr>
Date: Wed Jun 17 18:47:45 2026 +0200

CENSORED
```

mention `benjamin_loison@benjamin-loison-framework` in *Good "git" signature for benjamin.loison@CENSORD.fr with ED25519 key SHA256* line?
Jun 25, 1:56pm

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:

  1. The comment is properly associated with the key in allowed_signers. Your current allowed_signers entry is correct:

    text
    benjamin.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.

  2. 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.


Why the Comment Doesn't Appear

Git's --show-signature output is hardcoded to show:

  • The signer's identity (from the signature itself, e.g., benjamin.loison@CENSORED.fr).
  • The key type (e.g., ED25519).
  • The key fingerprint (e.g., SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8).

It does not include the comment from allowed_signers in this line.


Workarounds

1. Use gpg or ssh-keygen to Verify the Key

You can manually verify the key and its comment using:

bash
ssh-keygen -F benjamin.loison@CENSORED.fr -l

or

bash
ssh-keygen -l -f ~/.ssh/allowed_signers

This will show the comment, but it won't integrate with git show --show-signature.


2. Custom Git Alias (Partial Solution)

Create a Git alias to append the comment to the output:

bash
git 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:

bash
git showsig COMMIT_HASH

will append the comment to the output.


3. Patch Git (Advanced)

If you want the comment to appear natively, you would need to:

  • Modify Git's source code (specifically, the check_signature logic in signature.c).
  • Recompile Git. This is not recommended for most users.

4. Use a Wrapper Script

Create a script (e.g., git-show-sig) that:

  1. Runs git show --show-signature --quiet.
  2. Parses the output and appends the comment from 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:

bash
chmod +x git-show-sig

Usage:

bash
./git-show-sig COMMIT_HASH

Summary

  • Git does not natively show the comment from allowed_signers in git show --show-signature.
  • Workarounds: Use a custom alias, script, or manual verification.
  • Best approach: Use a wrapper script or alias to append the comment to the output.
Jun 25, 1:56pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Vibe can make mistakes. Check answers. Learn more