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

Re: What's in git.git

From
Junio C Hamano <junkio@cox.net>
Date
May 10, 2006, 04:41 UTC
Message-ID
<7vd5emze3h.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0605092117240.3718@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 8 quoted lines
> On Tue, 9 May 2006, Junio C Hamano wrote:
>> 
>> Junio C Hamano:
>>       binary patch.
>>       binary diff: further updates.
>
> Btw, am I just smoking stuff, or is this going to be fundamentally 
> problematic for "git-apply -R" if we ever want to support that?

It is problematic but not more than the current index + "Binary files differ" output. If you have both pre and postimage then you do not need the binary data.

The forward application is done assuming you have the preimage (but not necessarily postimage), and when you do not have postimage the binary data is used. When going reverse we should assume you have the postimage (but not necessarily preimage), but the pack-object format xdelta is not reversible so if you do not have preimage that matches the index, with the current output format you lose.

If we care enough, we could add a reverse delta from postimage to preimage to the output, but I am not sure if it is worth it.

> But at least in theory we might well want to do "-R" eventually.

Yes, but even without binary, -R has a funny implication when copy-edit patch is involved. What if a patch copy-edits to create a new file B based on old A, and also modifies A in-place, and somehow the postimages of A and B you already have are not consistent with what that patch does? Application with -R would produce two versions of A and you would get a conflict. I guess showing a combined diff would be a helpful way to resolve that ;-).

Previous: Linus TorvaldsNext: Linus Torvalds
Message 5 of 14 in “What's in git.git”
  1. Junio C HamanoMay 10, 2006
  2. Linus TorvaldsMay 10, 2006
  3. Linus TorvaldsMay 10, 2006
  4. Linus TorvaldsMay 10, 2006
  5. Junio C HamanoMay 10, 2006
  6. Linus TorvaldsMay 10, 2006
  7. Randal L. SchwartzMay 10, 2006
  8. Linus TorvaldsMay 10, 2006
  9. Nicolas PitreMay 10, 2006
  10. Alex RiesenMay 10, 2006
  11. Linus TorvaldsMay 10, 2006
  12. Junio C HamanoMay 10, 2006
  13. Martin LanghoffMay 10, 2006
  14. Jakub NarebskiMay 10, 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.