git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] pack-protocol: clarify LF-handling in PKT-LINE()

From
Jeff King <peff@peff.net>
Date
Sep 3, 2015, 08:26 UTC
Message-ID
<20150903082657.GB20786@sigill.intra.peff.net>
In-Reply-To
<20150903082409.GA20786@sigill.intra.peff.net>
On Thu, Sep 03, 2015 at 04:24:09AM -0400, Jeff King wrote:
Show 13 quoted lines
> diff --git a/Documentation/technical/protocol-common.txt b/Documentation/technical/protocol-common.txt
> index 889985f..bf30167 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).

I noticed that this section leaves vague the question of "what is a binary pkt-line". All of the PKT-LINE calls I tweaked in the grammar are for non-binary instances. The only binary ones are described in the sideband discussion of the "Packfile data" section, and there we do not have a grammar.

So I think the result is reasonably clear, but I have far too much intimate knowledge of git's protocol to be a good judge.

-Peff
Previous: Jeff KingNext: Junio C Hamano
Message 3 of 7 in “pack-protocol: document newline behavior in push commands”
  1. pack-protocol: document newline behavior in push commandsJeff King, Sep 3, 2015
  2. pack-protocol: clarify LF-handling in PKT-LINE()Jeff King, Sep 3, 2015
  3. Jeff KingSep 3, 2015
  4. Junio C HamanoSep 3, 2015
  5. Junio C HamanoSep 3, 2015
  6. Jeff KingSep 4, 2015
  7. Junio C HamanoSep 4, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.