From: matthew sporleder <msporleder@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: gpg.ssh.defaultKeyCommand docs bug?
Date: Fri, 6 Oct 2023 13:14:49 -0400 [thread overview]
Message-ID: <CAHKF-AvUxH1Ar3Xijjb4_8N+_kssPHZVHqQSAE9kDGRfTYHyxw@mail.gmail.com> (raw)
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
next reply other threads:[~2023-10-06 17:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-06 17:14 matthew sporleder [this message]
2023-10-09 20:43 ` gpg.ssh.defaultKeyCommand docs bug? Jeff King
2023-10-11 18:16 ` matthew sporleder
2023-10-11 23:41 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHKF-AvUxH1Ar3Xijjb4_8N+_kssPHZVHqQSAE9kDGRfTYHyxw@mail.gmail.com \
--to=msporleder@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).