git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gpg.ssh.defaultKeyCommand docs bug?
@ 2023-10-06 17:14 matthew sporleder
  2023-10-09 20:43 ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: matthew sporleder @ 2023-10-06 17:14 UTC (permalink / raw)
  To: Git Mailing List

https://git-scm.com/docs/git-config#Documentation/git-config.txt-gpgsshdefaultKeyCommand

This command that will be run when user.signingkey is not set and a
ssh signature is requested. On successful exit a valid ssh public key
prefixed with key:: is expected in the first line of its output. This
allows for a script doing a dynamic lookup of the correct public key
when it is impractical to statically configure user.signingKey. For
example when keys or SSH Certificates are rotated frequently or
selection of the right key depends on external factors unknown to git.

---

The command does not actually work (for me, git version 2.42.0) with
key:: prefixed.

It only works if I cat the public key as-is.

I only figured this out because the docs previously said it took the
format of ssh-add -L, which also doesn't not contain key::.

I am using this script for my "dynamic" key discovery:
#!/bin/sh
f=$(ssh -G $(git remote get-url $(git remote|head -1)|awk -F':' '{
print $1 }') |grep -E '^identityfile'|sed 's#^identityfile ##g')
cat $(eval realpath ${f}.pub)

Thanks,
Matt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-11 23:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-06 17:14 gpg.ssh.defaultKeyCommand docs bug? matthew sporleder
2023-10-09 20:43 ` Jeff King
2023-10-11 18:16   ` matthew sporleder
2023-10-11 23:41     ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).