[darcs-users] cheap in-repo local branches (just needs implementation)

Grant Husbands darcsusers at grant.x43.net
Wed Jul 22 11:28:47 UTC 2009


Eric Kow <kowey at darcs.net> wrote:
[...]
> So darcs users have been asking about in-repo branches for a while.
>
[To paraphrase the design: Darcs does not become branch-aware but a
separate tool alters Darcs internal state to simulate it.]

As much as I don't want to kill a chance at having branches in Darcs,
I think this approach would be wrong. I think the apparent simplicity
is that of an incomplete design rather than that of something that is
actually simple..

So I'll list some problems:
1. When you unpull old patches or reorder patches, Darcs alters
existing patch files. This will break other branches that share the
same files.
2. Similarly, when you pull patches in different contexts, you end up
with slightly-different patches with the same name.
3. With enough unpulling on one branch, you probably break the root
for another branch, by removing the shared inventory behind the head.
4. Pushing and pulling between branches would be very hard to
implement without heavy Darcs involvement. The method in the proposal
will not work, as Darcs in either branch can't necessarily understand
the context produced by the other branch.
5. Updating the working copy correctly for many branch operations
entails knowing how to handle all of the darcs patches that are
different between the branches. Even if you force the user to have no
working copy changes, what about the unversioned extra files,
especially in renamed folders?
6. As noted in the proposal, it's not known how to make it play nicely
with lazy fetching.
7. The branch-knowledge synchronisation requires almost as much
knowledge about how to handle remote Darcs repos as Darcs has.

So, I think I'd rather not have branches than have a strange hybrid
with all sorts of gotchas. Each issue can probably be individually
addressed, but I don't believe this approach will ever lead to
sensible and intuitive branching, in the same way a system built in to
Darcs could.

G.


More information about the darcs-users mailing list