David Roundy writes:
    On Fri, Sep 02, 2005 at 03:07:51PM -0700, Bill Trost wrote:
    > So, I propose that a binary patch consist of a sequence of the
    > 5-tuple
    >
    >   (old-start, old-length, new-start, new-length, bitmask)
    >
    > Applying a binary patch consists of doing the following with each
    > 5-tuple:
    >
    >   1. Truncating or zero-extending the bitmask and source
    >   region....
    >
    >   2. XORing the bitmask and source region....

    > Presuming I'm not completely out in left field, it seems like
    > integrating the format into darcs promptly would be useful, just
    > to ease the backward-compatibility burden. The bleeding-edge
    > version of darcs could start generating full-body XORs soon
    > thereafter....

    Indeed that sounds like a good plan of attack.

    Bill, were you interested in implementing some of this support? i.e.
    are you either a haskeller or one who'd be interested/willing to
    learn haskell?

I did a major project in SML/NJ back as a gradual student, and
have taken a look at Erlang recenly, so I was a little surprised
when I took a look at the code for "darcs get" and found it nearly
impenetrable. I've since read the _Gentle Introduction to Haskell_, and
think I was having a problem with the I/O system and the fact that I was
reading the source in a proportional font, which makes the layout even
more confusing. I'm going to look for a Haskell book tomorrow.

As to your first question -- clearly, I'm thinking about it, but I'm
not at all convinced I'll get there in a timely fashion. I won't be
offended or surprised if someone beats me to it.

Regarding the actual proposal, there's the question of the actual file
format for this new binary patch format before someone actually starts
coding.  Here's an off-the-cuff proposal:

        binary-diff FILENAME DIFF-ALGORITHM
        old-start START
        old-length LENGTH
        new-start START
        new-length LENGTH
        *HEXHEXHEX
        *...
        ...repeat with "old-start" for each chunk...

I added DIFF-ALGORITHM so that "darcs optimize" has an easy way of
deciding if there's something to optimize -- it's not actually needed
for applying the patch.

Bill

_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel

Reply via email to