[darcs-devel] apply --amend / amend apply
Eric Y. Kow
eric.kow at gmail.com
Sat Apr 14 22:31:43 PDT 2007
Here is perhaps a situation where we might want darcs to be able to
do a wrong thing. I was thinking specifically of the conflict I just
had with David's --lazy repo patches.
1) David submitted a patch with a small conflict (that was my fault; I
had forgotten to push in the offending patch) and so I tacked on a
small conflict resolution to it. Let's call these David1 and Eric1
2) David submits an amended version of David1 that fixes the conflict
and so subsumes David1 and Eric1. Let's call this David2
3) In his newest bundle, David includes some new stuff which depends
on David2, but could just as easily depend on (David1 Eric1).
Let's call this NewStuff.
What I would like to do is to coerce the application of NewStuff onto
the context David1 Eric1
To sum up, we have
... David1 Eric1
... David2 NewStuff
And I want
... David1 Eric1 NewStuff
As far as I can tell, there isn't a proper way to do this in darcs.
You could generate unix diffs and apply them via patch, but then
you either lose the individual darcs patches, or would have to do
things by hand.
Just throwing out sort of a nebulous idea, here: what about an apply
--amend-depends or an amend apply (thus making amend a supercommand à
la query), or even an external darcs-firstaid tool based on a
hypothetical libdarcs?
The basic idea is to apply some patches whilst swapping out some of its
dependencies below:
* Darcs would ensure that everything is consistent, for example,
refusing to amend apply if the patches cannot cleanly apply to
the repository
* Darcs would modify the NewStuff (so it'll be a little bit like
amend-recording NewStuff)
* The patch selection user interface would let you ignore dependencies
* We would warn rather vigourously that this should be used probably
even more sparingly than amend-record. The intention is for this to
be a one-off event, not something which generates a stream of apply
--amends down the line. Best practice as a repository maintainer
might probably be not to do the amend apply yourself, but ask the
patch submitter to do so and resubmit, so as to avoid confusion for
all around.
Would this kind of thing be useful for other people, or is it so limited
that we're better off without the clutter? What should the user
interface for this look like? Would it be very difficult in theory? If
it is difficult in theory, are there restrictions we could apply (e.g.
the user would have to be explicit about what patches to swap out, what
patches to swap in) so that we're not trying to solve an overly general
problem?
I suspect this is the kind of thing our diff/patch based competition
handle very easily.
--
Eric Kow http://www.loria.fr/~kow
PGP Key ID: 08AC04F9 Merci de corriger mon français.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20070415/1c14a824/attachment.pgp
More information about the darcs-devel
mailing list