[darcs-devel] combining darcs-3 transition with changes to Prim.V1

Ben Franksen ben.franksen at online.de
Mon Feb 22 13:03:16 UTC 2021


We could (perhaps should?) make a few minor but incompatible changes to
Prim.V1 when moving to darcs-3.

(1) Get rid of the ugly setpref patches. This requires special cases
when we do conversion to darcs-3. There are two possible alternatives
for darcs-3: either the setpref command destructively modifies
_darcs/prefs/prefs; or we hardcode a normal file path like .darcs-prefs
which the user is free to track as a regular source file.

(2) More liberal commuting of adjacent hunks. We talked about this
before. Something I implemented years ago. This one is perhaps not worth
the trouble.

(3) A saner way to encode file names. I would like to force them to be
proper unicode strings, forbid control chars (including '\n') and always
UTF8 encode them. Also remove the hideous "white space encoding"
(instead '\n' terminates the file name token).

We may need to create a new Prim.V3 patch type to make these changes in
order to be able to (at least) read the old formats.

The following could be done by just adding more constructors. This makes
them slightly less incompatible in the sense that after we add them we
can still read and modify repos that don't have them. But older darcs
versions cannot even read repos that contain such new prims, so they
still need a new format. So perhaps we may want to include them in the
darcs-3 transition.

(4) Binary patches: these could be vastly improved in speed and memory
consumption by using content defined chunking and "binary hunks" (file,
byte position, bytestring before and after). I have made some real-life
experiments with binaries we use at work (xls files) and the
improvements are quite noticeable.

(5) Hunk moves. This is (almost) fully implemented in one of my
experimental branches. Needs some rebasing and cleanup though, because I
did that years ago. I do have an alternative diff algorithm that detects
them but it is not yet integrated and more like a proof of concept (but
note that this can be added later at any time, as can be the UI).

Cheers
Ben



More information about the darcs-devel mailing list