[darcs-users] some special amend-records

Ganesh Sittampalam ganesh at earth.li
Sun Mar 24 00:26:02 UTC 2013


Hi Piyush,

On 22/03/2013 10:40, Piyush P Kurur wrote:

> Instead if we were to change the order of (1) and (2), we get a cousin
> of amend-record (neither subsumes the other). Call it record-amend for
> time being. So the algorithm to record-amend should be
> 
> 
> (1) Cherry pick the changes to the working copy of the repository. Let
>     us call this picked patch p.
> 
> (2) Go over the list of patches in the reverse order (i.e. p4 then p3
>     then p2) as long as p commutes over them.
> 
> (3) When the user says stop then merge p and the current patch.
> 
> It looks like the record-amend that I said need no change in the patch
> data type (or I might be missing something). It seems to be applicable
> in use cases like, adding a missing file, or fixing a typo in the
> commit message etc where the current amend-record does not work. Does
> it make sense to have this variant even in the presence of rebase?

Unfortunately it's not generally safe in darcs to edit the dependencies
of a patch without changing the identity of the patch itself. This isn't
a really fundamental tenet of patch theory, but it is quite important
for the current implementation at least.

In your example, p3 depends on p2. I assume the dependency is implicit -
i.e. some change in p3 does not commute with some change in p2 - rather
than being explicitly added with --ask-deps.

That means that darcs will assume that any repository that has p3 also
has p2. So if you can change p2 -> p2' without changing p3 -> p3', you
will really confuse darcs.

As David identifies in his follow-up email, this situation isn't really
ideal. There's definitely a lot of scope for augmenting or changing
darcs to make the workflow better in this kind of scenario.

Cheers,

Ganesh




More information about the darcs-users mailing list