doc: interpret-trailers: explain key format

A trailer key must consist of ASCII alphanumeric characters and
hyphens *only*. Let’s document it explicitly instead of relying on
readers being conservative and only basing their trailer keys on the
documentation examples.[1]

The previous commit provided us with an appropriate paragraph to
describe the key format.

† 1: Technically they would then miss out on using digits in them since
     all of the example keys just use letters and hyphens

Reported-by: Brendan Jackman <jackmanb@google.com>
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
main
Kristoffer Haugsbakk 2026-08-09 22:06:30 +02:00 committed by Junio C Hamano
parent c88d60db44
commit fd39e5a481
1 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,8 @@ Add or parse trailer metadata at the end of the otherwise
free-form part of a commit message, or any other kind of text.

A _trailer_ in its simplest form is a key-value pair with a colon as a
separator. A _trailer block_ consists of one or more trailers. The
separator. The _key_ consists of ASCII alphanumeric characters and
hyphens (`-`). A _trailer block_ consists of one or more trailers. The
trailer block needs to be preceded by a blank line, where a _blank line_
is either an empty or a whitespace-only line. For example, in the
following commit message