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

Re: reversible binary diff

From
Junio C Hamano <junkio@cox.net>
Date
Aug 26, 2006, 02:14 UTC
Message-ID
<7vr6z4450y.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0608252050140.3683@localhost.localdomain>
Nicolas Pitre <nico@cam.org> writes:
Show 10 quoted lines
> I just noticed that the binary diff format was augmented in order to 
> carry the reverse diff information.
>
> Why was this needed?
>
> I mean, if you want to reverse a binary diff you only need to retrieve 
> the original blob the forward diff was meant to apply against, and it is 
> certainly already available in the object store if the forward diff has 
> been previously applied.  Or has this assumption been wrong for some 
> work flow?

It's been wrong all along, but I do not think it practically matters because I haven't seen anybody exchange binary diffs back and forth.

As long as you use patch to switch between states inside the repository the patch originates from, it is not needed. The change is just there for completeness.

But if you are sending a patch to somebody else, you would need the reverse information. t/t4116 test needs to be updated to use separate repository that has only preimage and apply a patch in reverse there to validate the correct operation. The log message for the commit that introduced the test mentions it, but nobody noticed and took hint ;-).

Previous: Nicolas Pitre
Message 2 of 2 in “reversible binary diff”
  1. Nicolas PitreAug 26, 2006
  2. Junio C HamanoAug 26, 2006

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.