threads / patch / 57085

patchdoc/config: mark ssh allowedSigners example as literal

Subject: [PATCH] doc/config: mark ssh allowedSigners example as literal

## tl;dr

2 messages between Dec 15, 2021 and Dec 16, 2021. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Jeff King· Dec 15, 2021, 16:23 UTC · lore

The discussion for gpg.ssh.allowedSignersFile shows an example string that contains "user1@example.com,user2@example.com". Asciidoc thinks these are real email addresses and generates "mailto" footnotes for them. This makes the rendered content more confusing, as it has extra "[1]" markers:

  The file consists of one or more lines of principals followed by an
  ssh public key. e.g.: user1@example.com[1],user2@example.com[2]
  ssh-rsa AAAAX1... See ssh-keygen(1) "ALLOWED SIGNERS" for details.
and also generates pointless notes at the end of the page:
  NOTES
        1. user1@example.com
           mailto:user1@example.com
        2. user2@example.com
           mailto:user2@example.com

We can fix this by putting the example into a backtick literal block. That inhibits the mailto generation, and as a bonus typesets the example text in a way that sets it off from the regular prose (a tt font for html, or bold in the roff manpage).

Signed-off-by: Jeff King <peff@peff.net>
---
Possibly this could actually be done in a separate example block, but I
think this looks OK and fixes the most obvious problem.
 Documentation/config/gpg.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to Documentation/config/gpg.txt +1 −1
diff --git a/Documentation/config/gpg.txt b/Documentation/config/gpg.txt
index 4f30c7dbdd..7875f4fccc 100644
--- a/Documentation/config/gpg.txt
+++ b/Documentation/config/gpg.txt
@@ -44,7 +44,7 @@ gpg.ssh.allowedSignersFile::
 	A file containing ssh public keys which you are willing to trust.
 	The file consists of one or more lines of principals followed by an ssh
 	public key.
-	e.g.: user1@example.com,user2@example.com ssh-rsa AAAAX1...
+	e.g.: `user1@example.com,user2@example.com ssh-rsa AAAAX1...`
 	See ssh-keygen(1) "ALLOWED SIGNERS" for details.
 	The principal is only used to identify the key and is available when
 	verifying a signature.
-- 
2.34.1.662.g7157fbae24
Fabian Stelzer· Dec 16, 2021, 09:04 UTC · re: Jeff King · lore

Re: [PATCH] doc/config: mark ssh allowedSigners example as literal

On 15.12.2021 11:23, Jeff King wrote:
Show 46 quoted lines
>The discussion for gpg.ssh.allowedSignersFile shows an example string
>that contains "user1@example.com,user2@example.com". Asciidoc thinks
>these are real email addresses and generates "mailto" footnotes for
>them. This makes the rendered content more confusing, as it has extra
>"[1]" markers:
>
>  The file consists of one or more lines of principals followed by an
>  ssh public key. e.g.: user1@example.com[1],user2@example.com[2]
>  ssh-rsa AAAAX1... See ssh-keygen(1) "ALLOWED SIGNERS" for details.
>
>and also generates pointless notes at the end of the page:
>
>  NOTES
>        1. user1@example.com
>           mailto:user1@example.com
>
>        2. user2@example.com
>           mailto:user2@example.com
>
>We can fix this by putting the example into a backtick literal block.
>That inhibits the mailto generation, and as a bonus typesets the example
>text in a way that sets it off from the regular prose (a tt font for
>html, or bold in the roff manpage).
>
>Signed-off-by: Jeff King <peff@peff.net>
>---
>Possibly this could actually be done in a separate example block, but I
>think this looks OK and fixes the most obvious problem.
>
> Documentation/config/gpg.txt | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/Documentation/config/gpg.txt b/Documentation/config/gpg.txt
>index 4f30c7dbdd..7875f4fccc 100644
>--- a/Documentation/config/gpg.txt
>+++ b/Documentation/config/gpg.txt
>@@ -44,7 +44,7 @@ gpg.ssh.allowedSignersFile::
> 	A file containing ssh public keys which you are willing to trust.
> 	The file consists of one or more lines of principals followed by an ssh
> 	public key.
>-	e.g.: user1@example.com,user2@example.com ssh-rsa AAAAX1...
>+	e.g.: `user1@example.com,user2@example.com ssh-rsa AAAAX1...`
> 	See ssh-keygen(1) "ALLOWED SIGNERS" for details.
> 	The principal is only used to identify the key and is available when
> 	verifying a signature.
>-- 

Thanks, this is obviously good. I don't think for this simple example an extra block is not needed unless we want to document the other options the allowedSigners file has in the git docs as well. I think it's better to reference the ssh-keygen manpage though.

← back to recent threads