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

Re: [PATCH] pack-protocol: fix first-want separator in the examples

From
Junio C Hamano <gitster@pobox.com>
Date
May 14, 2012, 16:32 UTC
Message-ID
<7vmx5aiuz1.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1336779893-23636-1-git-send-email-cmn@elego.de>
Carlos Martín Nieto <cmn@elego.de> writes:
> Just after this, in the push section, it separates by NUL
> again. Running git-receive-pack locally looks like it's actually NUL
> SP, but I'm guessing that the SP comes from a printf that doesn't take
> being first into account, so I left it alone.

That leading SP was a misguided one step in the right direction ;-) to always delimit both ends with SP, so that strstr(capabilities, " cap ") can see if capability 'cap' is advertised. So the protocol definition that says "capability-list follows NUL" is correct, but capability-list can have extra SPs on either end (or in between tokens for that matter), and what you observed has an extra SP at the beginning.

It was misguided because the capability finding code has to be able to read output from older implementations that didn't try to be helpful to strstr(capabilities, " cap ") style parsers; in other words, if all the implementations advertised their capabilities that way from day one, it would have helped, but retrofitting that does not help very much.

Previous: Carlos Martín Nieto
Message 2 of 2 in “pack-protocol: fix first-want separator in the examples”
  1. pack-protocol: fix first-want separator in the examplesCarlos Martín Nieto, May 11, 2012
  2. Junio C HamanoMay 14, 2012

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.