[darcs-devel] Idea: a new type of patch

Ian Lynagh igloo at earth.li
Fri Apr 29 09:04:03 PDT 2005


On Wed, Apr 27, 2005 at 04:54:37PM +0200, Juliusz Chroboczek wrote:
> Hi,
> 
> Looking at darcs-git's behaviour on large imports, I'm wondering if we
> couldn't introduce a new kind of patch: ImportHunk, of the form
> 
>   ImportHunk !Int PackedString

Do you want this to have an on-disk form, or just be generated from a
git repo?

Assuming we want an on-disk form, we'd also have to have the length of
the PS and the number of lines it covers in the description, i.e.

Hunk' (start_line :: Int) (lines :: Int) (len :: Int) new

We could also allow it to remove lines in the same way (hence my
renaming of it). There are advantages and disadvantages; (un)applying
should be faster, but if we want to show the user the patch in the Hunk
form then we'll need to convert it.


Relatedly, here are the repo format things I'd previously noted down as
things I think should be changed:

Hunks are a pain to deal with when we don't want to lines/unlines
everything. Instead, we want:
    Hunk foo 1
    +foo
    #no newline
for what is now
    Hunk foo 1
    -
    +foo

Should the patch extension be changed?

Need size in filename or elsewhere to support compressed files > 2G
(also need to stop relying on Int, and we would have problems when
pointers are 32 bits anyway).

_patches/YYYYMMDDxxxxx -> _patches/YYYYMMDD/YYYYMMDDxxxxx
(or perhaps drop the duplication?)

Do we have the necessary versioning in the repo and client to make these
migrations as easy as possible?


Thanks
Ian





More information about the darcs-devel mailing list