diff options
author | Jeff King <peff@peff.net> | 2015-09-03 10:24:09 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-09-04 00:18:12 +0200 |
commit | 1c9b659d9837fa2bd6ab21edaae94d19c20ac216 (patch) | |
tree | e93fd6cd3682f1b4f74abd201adc55e8048f571b /Documentation/technical/protocol-common.txt | |
parent | Git 2.6-rc0 (diff) | |
download | git-1c9b659d9837fa2bd6ab21edaae94d19c20ac216.tar.xz git-1c9b659d9837fa2bd6ab21edaae94d19c20ac216.zip |
pack-protocol: clarify LF-handling in PKT-LINE()
The spec is very inconsistent about which PKT-LINE() parts
of the grammar include a LF. On top of that, the code is not
consistent, either (e.g., send-pack does not put newlines
into the ref-update commands it sends).
Let's make explicit the long-standing expectation that we
generally expect pkt-lines to end in a newline, but that
receivers should be lenient. This makes the spec consistent,
and matches what git already does (though it does not always
fulfill the SHOULD).
We do make an exception for the push-cert, where the
receiving code is currently a bit pickier. This is a
reasonable way to be, as the data needs to be byte-for-byte
compatible with what was signed. We _could_ make up some
rules about signing a canonicalized version including
newlines, but that would require a code change, and is out
of scope for this patch.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | Documentation/technical/protocol-common.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Documentation/technical/protocol-common.txt b/Documentation/technical/protocol-common.txt index 889985f707..bf30167ae3 100644 --- a/Documentation/technical/protocol-common.txt +++ b/Documentation/technical/protocol-common.txt @@ -62,7 +62,10 @@ A pkt-line MAY contain binary data, so implementors MUST ensure pkt-line parsing/formatting routines are 8-bit clean. A non-binary line SHOULD BE terminated by an LF, which if present -MUST be included in the total length. +MUST be included in the total length. Receivers MUST treat pkt-lines +with non-binary data the same whether or not they contain the trailing +LF (stripping the LF if present, and not complaining when it is +missing). The maximum length of a pkt-line's data component is 65520 bytes. Implementations MUST NOT send pkt-line whose length exceeds 65524 |