[darcs-devel] [darcs #499] wishlist: pulling intersection of two repositories

David Roundy via RT bugs at darcs.net
Sun Aug 28 05:15:59 PDT 2005


Sun Aug 28 08:15:57 2005: New ticket: 499.
Transaction: Ticket created by droundy at darcs.net
       Queue: Darcs
     Subject: wishlist: pulling intersection of two repositories
       Owner: Nobody
  Requestors: droundy at darcs.net
      Status: new
 Ticket <URL: http://bugs.darcs.net/.//Ticket/Display.html?id=499 >

I've been thinking about Junio's idea for collaborative maintainership,
which I forwarded to the darcs-devel mailing list a while back, and I think
it's worth implementing.  The basic idea is that if one could pull only
patches that are in both of two (or more) repositories, one could set up a
nice comaintainership system where the "central" repository always has all
the patches that both maintainers have agreed on.  I have two ideas how
this could be implemented.


Plan A has two stages:

1) A multiple-source pull:

darcs pull repoA repoB repoC

would pull the union of all patches in repoA, repoB and repoC.  This would
be handy for a single maintainer who wants to pull interactively from a
number of contributors.  We'd perhaps modify defaultrepo to hold the whole
list of repos, or perhaps add another item to _darcs/prefs/ which would be
"otherdefaultrepos" or something like that.

This darcs pull would be a bit tricky, as we'd have some interesting merge
scenarios to handle.  I don't think it's anything too complicated, but we'd
need either to generalize a few of our utility functions
(merge_with_us_and_pending, get_common_and_uncommon) or perhaps apply them
repeatedly.

It might also be nice to make the interactive UI display which repository
the patch came from.

2) Add an --intersection flag to pull.

The --intersection flag would cause pull to only grab patches that are in
all the repositories.  This would actually be a lot easier than the union,
since we wouldn't have to worry about the issue of merging patches from
different source repositories.  Which makes one wonder whether I'm doing
something foolish.  But it *does* seem like the union-version
multiple-source pull would be a very useful thing to have...


Plan B would be to not add a multiple-source pull at all, but instead add
an --intersect-with flag so you could run

darcs pull --intersect-with=repoB --intersect-with=repoC repoA

which would pull from repoA only those patches that are also in repoB and
repoC.  This could be done moderately straightforwardly with something like
the PatchMatch infrastructure.


I'd be interested in hearing opinions on these features (plan A vs plan B,
or if someone has a better plan), and also if someone were willing to
volunteer to implement one of them, since I don't expect to have time to
implement this any time soon.
-- 
David Roundy
http://www.darcs.net







More information about the darcs-devel mailing list