[darcs-users] "Partial" patch application

Tommy Pettersson ptp at lysator.liu.se
Mon Jul 31 16:19:32 UTC 2006

On Mon, Jul 31, 2006 at 10:39:13AM -0400, Vyacheslav Akhmechet wrote:
> Is there a way to partially apply a patch?

No. Patches are supposed to be the minimal building blocks
between repositories. It is not always easy to know in advance
how small or big a patch should be, and I too have sometimes
wished for a way to vary the granularity. But I tend to record
small patches, so I most often want a way to group them
together, so that several small patches can be "hidden" inside a
group patch.

> I have a set of files, say a.txt, b.txt in my production branch. I also
> One obvious solution is to revert and record separate patches so there is no
> dependency. However, this is complicated in my case. Can I do partial patch
> application?

The best think I can think of is to remove c.txt in the
development branch (with 'darcs remove', that doesn't delete the
file) and record that as a "temporarily remove c" patch. Then
add it again and record a "bring c back again" patch. Now you
can push the troublesome patch plus the remove c patch to the
production repo, continue to develop c, and later push the bring
c back patch plus whatever more changes it needs to production
when it's ready.

The remove and add file patches will introduce dependencies that
make may otherwise valid cherry pickings impossible, and I also
feel a bit worried about what could happen if you later somehow
get a conflict involving these two patches.

Tommy Pettersson <ptp at lysator.liu.se>

More information about the darcs-users mailing list