[darcs-users] Merging several patches into one

Alberto Bertogli albertito at gmail.com
Tue Jun 20 21:17:12 UTC 2006


On Tue, Jun 20, 2006 at 12:19:43PM -0500, Richard A. Smith wrote:
> Right. I do that as well but lets say feature X is a bit involved and 
> takes 3 days to do it with a couple of revs to get right.  During that 
> time say you have generated 10 patches each with its own subparts of the 
> feature.
> 
> Do this 3 times.  So now you have 30 new patches pushed out to the repo. 
>  Other people pull all of them but eventually you think that feature 2 
> still has some problems.  Sorting out what patches for other to unpull 
> can be somewhat confusing.  Especially if its been a month since you 
> wrote those patches.

I do that sometimes, mostly using diff+patch for that (although
sometimes, when changes are small, using unrecord is a good choice).

Let's say I have a main repository, and a "new-feature" one. I would
periodically pull from main into new-feature (to minimize chances of
conflicts, this is nothing strange).

Then when I decide it's time to apply the changes from new-feature into
main, I would do a clean get from main in a temporary repository, do a

diff -ruN --exclude=_darcs tmp new-feature > nf.patch
cd tmp
patch -p1 ../nf.patch
darcs record

And now I have a single record in tmp for all the work in new-feature.
Then I would push it to main using one of the usual ways.


If you do this work a lot, something like Andrew Morton patch scripts or
quilt might help you. I've used the former in the past (before I
switched to darcs) and they are great tools for this kind of work. I
still use them every once in a while.

Thanks,
		Alberto






More information about the darcs-users mailing list