[darcs-users] Defining patch types modularly

David Roundy droundy at abridgegame.org
Sun Mar 28 11:18:47 UTC 2004


On Sat, Mar 27, 2004 at 04:04:39PM +0100, Marnix Klooster wrote:
> Hello all,

Hello.

> ANATOMY OF A PATCH
> 
> The first observation that I make is that any patch as it currently
> exists in darcs can conceptually be separated in the following parts:

I'm afraid this is where I get stuck...

>  - change GUID, description, and more administrative details

In the rest of this, you seem to be talking about primitive patches, and
primitive patches don't in general have descriptions.

>  - pointer to the previous patch in the repository, and thereby
>    indirectly to the entire context of the patch
>  
>  - patch procedure: type (e.g., replace) and arguments (e.g.,
>    original, replacement)

I'm not entirely clear what you mean by arguments here.  In the case of

hunk ./foo 4
-hello
+world

which would be the arguments? I presume it would be the
"-hello\n+world\n", since that is the original and replacement.

>  - patch scope: the part of the tree that is potentially affected by
>    the patch

I presume this would be the ./foo 4 in the above example?

>  - diff: like a 'diff' output, but also capable of describing adding,
>    renaming, and deleting files and directories.

??? I don't see that this is part of the patch at all... either that or it
is the patch itself.

> The next observation is that the diff is theoretically redundant:
> given a repository of patches, we can sequentially compute the diff of
> all patches.  But in practice we don't want to do that for reasons of
> efficiency.  And it turns out that we can use this diff effectively
> for a number of things.

Here I get really confused.  What is the diff? Is it the "-hello\n+world\n"
in the above example? If so, how can it be redundant... i.e. what would we
calculate it from? Or is this diff section something new that you are
proposing to add?

Basically, this is where I got stuck, since I don't know what you
mean by the "diff" of a patch.
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list