pack-protocol: clarify LF-handling in PKT-LINE()
commit1c9b659d9837fa2bd6ab21edaae94d19c20ac216
authorJeff King <peff@peff.net>
Thu, 3 Sep 2015 08:24:09 +0000 (3 04:24 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 3 Sep 2015 22:18:12 +0000 (3 15:18 -0700)
treee93fd6cd3682f1b4f74abd201adc55e8048f571b
parent16ffa6443e279a9b3b63d7a2bebeb07833506010
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>
Documentation/technical/pack-protocol.txt
Documentation/technical/protocol-common.txt