diff mbox series

[v2] Documentation: clarify whitespace rules for trailers

Message ID 20220830105046.324041-1-christian.couder@gmail.com (mailing list archive)
State Accepted
Commit b46dd1726c139c930d7b4b7c3262e3f2699987d3
Headers show
Series [v2] Documentation: clarify whitespace rules for trailers | expand

Commit Message

Christian Couder Aug. 30, 2022, 10:50 a.m. UTC
Commit e4319562bc (trailer: be stricter in parsing separators, 2016-11-02)
restricted whitespaces allowed by `git interpret-trailers` in the "token"
part of the trailers it reads. This commit didn't update the related
documentation in Documentation/git-interpret-trailers.txt though.

Also commit 60ef86a162 (trailer: support values folded to multiple lines,
2016-10-21) updated the documentation, but didn't make it clear how many
whitespace characters are allowed at the beginning of new lines in folded
values.

Let's fix both of these issues by rewriting the paragraph describing
what whitespaces are allowed by `git interpret-trailers` in the trailers
it reads.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
Changes since v1:

  - rebased on top of 6c8e4ee870 (The sixteenth batch, 2022-08-29),
  - added my "Signed-off-by: ...",
  - clarified that there can be no whitespace before the token,
  - clarified that "any number of regular space and tab characters are
    allowed between the token and the separator".

 Documentation/git-interpret-trailers.txt | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Junio C Hamano Aug. 30, 2022, 5:20 p.m. UTC | #1
Christian Couder <christian.couder@gmail.com> writes:

>   - rebased on top of 6c8e4ee870 (The sixteenth batch, 2022-08-29),
>   - added my "Signed-off-by: ...",
>   - clarified that there can be no whitespace before the token,
>   - clarified that "any number of regular space and tab characters are
>     allowed between the token and the separator".
>
>  Documentation/git-interpret-trailers.txt | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

Looks good.  Thanks.  Will queue.

>
> diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt
> index 956a01d184..6d6197cd0a 100644
> --- a/Documentation/git-interpret-trailers.txt
> +++ b/Documentation/git-interpret-trailers.txt
> @@ -60,10 +60,12 @@ non-whitespace lines before a line that starts with '---' (followed by a
>  space or the end of the line). Such three minus signs start the patch
>  part of the message. See also `--no-divider` below.
>  
> -When reading trailers, there can be whitespaces after the
> -token, the separator and the value. There can also be whitespaces
> -inside the token and the value. The value may be split over multiple lines with
> -each subsequent line starting with whitespace, like the "folding" in RFC 822.
> +When reading trailers, there can be no whitespace before or inside the
> +token, but any number of regular space and tab characters are allowed
> +between the token and the separator. There can be whitespaces before,
> +inside or after the value. The value may be split over multiple lines
> +with each subsequent line starting with at least one whitespace, like
> +the "folding" in RFC 822.
>  
>  Note that 'trailers' do not follow and are not intended to follow many
>  rules for RFC 822 headers. For example they do not follow
diff mbox series

Patch

diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt
index 956a01d184..6d6197cd0a 100644
--- a/Documentation/git-interpret-trailers.txt
+++ b/Documentation/git-interpret-trailers.txt
@@ -60,10 +60,12 @@  non-whitespace lines before a line that starts with '---' (followed by a
 space or the end of the line). Such three minus signs start the patch
 part of the message. See also `--no-divider` below.
 
-When reading trailers, there can be whitespaces after the
-token, the separator and the value. There can also be whitespaces
-inside the token and the value. The value may be split over multiple lines with
-each subsequent line starting with whitespace, like the "folding" in RFC 822.
+When reading trailers, there can be no whitespace before or inside the
+token, but any number of regular space and tab characters are allowed
+between the token and the separator. There can be whitespaces before,
+inside or after the value. The value may be split over multiple lines
+with each subsequent line starting with at least one whitespace, like
+the "folding" in RFC 822.
 
 Note that 'trailers' do not follow and are not intended to follow many
 rules for RFC 822 headers. For example they do not follow