git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git rev-list fails to verify ssh-signed commits (but git log works)

From
MGMax Gautier <max.gautier@redhat.com>
Date
Feb 8, 2023, 15:56 UTC
Message-ID
<Y+PGRaiTTaZ/DtlJ@work-laptop-max>
Hi.

I was trying to implement a pre-push hook to verify my commits are properly signed before pushing them, and stumbled upon the following output (which looks like a bug to me):

$ git rev-list @{u}..HEAD --format='%G? %H' commit 9497d347b048dbea7f527624f815f7926594c4bc error: gpg.ssh.allowedSignersFile needs to be configured and exist for ssh signature verification N 9497d347b048dbea7f527624f815f7926594c4bc commit 2466c5b3c0f2053b3cdadf4af299aab35e74aa0c error: gpg.ssh.allowedSignersFile needs to be configured and exist for ssh signature verification N 2466c5b3c0f2053b3cdadf4af299aab35e74aa0c commit ded83bc7f31df14b2e9a8d7bdfa1e95eee2bf5c1 error: gpg.ssh.allowedSignersFile needs to be configured and exist for ssh signature verification N ded83bc7f31df14b2e9a8d7bdfa1e95eee2bf5c1 commit 16d17277c608d995ad4d0b495d029c753509930c error: gpg.ssh.allowedSignersFile needs to be configured and exist for ssh signature verification N 16d17277c608d995ad4d0b495d029c753509930c

While git log works and is able to retrieve the signatures

$ git log @{u}..HEAD --format='%G? %H' G 9497d347b048dbea7f527624f815f7926594c4bc G 2466c5b3c0f2053b3cdadf4af299aab35e74aa0c G ded83bc7f31df14b2e9a8d7bdfa1e95eee2bf5c1 G 16d17277c608d995ad4d0b495d029c753509930c

I get the error even though I have the following config : $ git config --list | grep 'allowed' gpg.ssh.allowedsignersfile=~/.config/git/MY_SIGNER_KEYS # by the way the actual config entry in ~/.config/git/config is # #[gpg "ssh"] # allowedSignersFile = ~/.config/git/MY_SIGNER_KEYS

$ cat ~/.config/git/MY_SIGNER_KEYS mg@max.gautier.name,max.gautier@redhat.com sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIL3W2Y4eAF92ySEW6ZE7d8Q+GXvP2G5quvN0zM+f1jGUAAAAB3NzaDphbGw= mg@max.gautier.name,max.gautier@redhat.com sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIGBP0XfpNXRoFBIW9uEgfnCrrjgvzxr0taOYy0A03DtKAAAABHNzaDo=

Am I missing something obvious ? Or is it git rev-list running in such a context than it can't find the allowedSignersFile ?

Thanks
-- 
Max Gautier
Software Engineer, Open Services Group, Emerging Technologies
Red Hat
max.gautier@redhat.com
Next: Jeff King
Message 1 of 20 in “git rev-list fails to verify ssh-signed commits (but git log works)”
  1. Max GautierFeb 8, 2023
  2. Jeff KingFeb 8, 2023
  3. Junio C HamanoFeb 8, 2023
  4. Junio C HamanoFeb 8, 2023
  5. gpg-interface: lazily initialize and read the configurationJunio C Hamano, Feb 8, 2023
  6. Ævar Arnfjörð BjarmasonFeb 9, 2023
  7. Junio C HamanoFeb 9, 2023
  8. Ævar Arnfjörð BjarmasonFeb 9, 2023
  9. Jeff KingFeb 9, 2023
  10. Junio C HamanoFeb 9, 2023
  11. gpg-interface: lazily initialize and read the configurationJunio C Hamano, Feb 9, 2023
  12. Jeff KingFeb 26, 2023
  13. Junio C HamanoFeb 27, 2023
  14. Ævar Arnfjörð BjarmasonMar 8, 2023
  15. Jeff KingMar 9, 2023
  16. Junio C HamanoMar 9, 2023
  17. Jeff KingMar 10, 2023
  18. Jeff KingFeb 9, 2023
  19. Junio C HamanoFeb 9, 2023
  20. Junio C HamanoFeb 8, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.