From: Junio C Hamano <gitster@pobox.com>
To: Rob Browning <rlb@defaultvalue.org>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: [PATCH] signature-format.txt: explain and illustrate multi-line headers
Date: Thu, 14 Oct 2021 10:17:01 -0700 [thread overview]
Message-ID: <xmqq5ytzcyr6.fsf@gitster.g> (raw)
In-Reply-To: 87zgrcgpez.fsf@trouble.defaultvalue.org
Rob Browning <rlb@defaultvalue.org> writes:
> One question I had was whether git's requirement was strictly a space,
> or if it was following the rfc-822 convention where (if I remember
> correctly) a tab is equivalent, i.e. the LWSP production in the grammar.
We use a single SP when writing and we accept a single SP when
reading. See commit.c::add_extra_header() for the writing side, and
commit.c::read_commit_extra_header_lines() for the reading side.
Unlike in RFC-822 style e-mail headers,
* keywords in our object headers are not followed by a colon;
* the value carried on our object header is not a "logically a
single line of characters".
* our headers do not go through their "unfolding" (i.e. removal of
CRLF eol markers to form a single long line, while preserving the
WSP that immediately followed the CRLF). We instead remove the
SP that signalled the line as a continuation of the previous line
to keep the original line structure.
With so little similarity, there is no reason for us to mimick their
"folding" rule.
We limit to the SP and not LWP for another reason. Because the
exact byte sequence in the object (including the header part of
"commit" and "tag" objects) determines the name of the object, it
avoids ambiguity to make sure we do not allow unnecessary
"flexibility" in the way the same thing can be expressed. If the
same signature is attached to a pair of otherwise identical commits
in their headers, one with SP signaling continued lines, the other
using HT (or random permutations of choice between SP/HT---making
2^N variants for a N line signature block), we would needlessly
create many variants of the "same" commit, which is not ideal.
next prev parent reply other threads:[~2021-10-14 17:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-09 16:33 [PATCH 1/1] signature-format.txt: add space to fix gpgsig continuation line Rob Browning
2021-10-11 16:41 ` Jeff King
2021-10-11 20:04 ` Junio C Hamano
2021-10-12 2:08 ` Jeff King
2021-10-12 16:54 ` Junio C Hamano
2021-10-13 2:06 ` [PATCH] signature-format.txt: explain and illustrate multi-line headers Junio C Hamano
2021-10-14 5:12 ` Rob Browning
2021-10-14 17:17 ` Junio C Hamano [this message]
2021-10-15 1:27 ` Rob Browning
2021-10-15 15:58 ` Junio C Hamano
2021-10-15 23:29 ` Rob Browning
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=xmqq5ytzcyr6.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=rlb@defaultvalue.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).