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

Re: [PATCH 2/2] git-format-patch: Document format for binary patch

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 25, 2021, 18:25 UTC
Message-ID
<xmqqft0jw0nn.fsf@gitster.g>
In-Reply-To
<678c0fa9-8ae5-f8ae-b93a-3d68c7c11c8f@gmail.com>
Bagas Sanjaya <bagasdotme@gmail.com> writes:
Show 23 quoted lines
> On 25/03/21 00.53, Junio C Hamano wrote:
>> I do not think this is all that useful; it clutters the description
>> for a reader who is not interested in reimplementing an encoder or a
>> decoder from the document.
>> And it is way too insufficient for a reader who wants to reimplement
>> an encoder or a decoder.  For example,
>>   - It does not say anything about what the delta is and how it is
>>     computed.
>>   - The 'z' is redundant; the more important is to say that the
>> first
>>     byte signals how many bytes are on that line and it is a mere
>>     artifact that we cram up to 52 bytes on a line.
>>   - It does not say anything about how the binary patch ensures that
>>     it is reversible (i.e. can be given to "git apply -R").
>> Thanks.
>> 
> Hmmm...
>
> I write this patch from "naive" observation of git format-patch's
> behavior when given binary files in the commit.
>
> Perhaps someone which is more familiar in base85 {en,de}coder and binary
> patch in general can write better documentation than what I send here.

I do not mind reviewing an update to an existing document or a new document in Documentation/technical/ somewhere, if somebody is motivated enough to write the details to a degree that would allow reimplementation of the encoder and the decoder. I just do not think it belongs to the end-user-facing document of "format-patch", whose target is users of the "format-patch" command, not reimplementors of the command.

Previous: Bagas Sanjaya
Message 7 of 7 in “Diff format documentation for git-format-patch”
  1. 0/2 Diff format documentation for git-format-patchBagas Sanjaya, Mar 24, 2021
  2. 1/2 git-format-patch: Include diff-generate-patch documentationBagas Sanjaya, Mar 24, 2021
  3. Junio C HamanoMar 24, 2021
  4. 2/2 git-format-patch: Document format for binary patchBagas Sanjaya, Mar 24, 2021
  5. Junio C HamanoMar 24, 2021
  6. Bagas SanjayaMar 25, 2021
  7. Junio C HamanoMar 25, 2021

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.