[darcs-users] Re: Branch names?

Nathaniel Smith njs at pobox.com
Mon May 2 06:16:38 UTC 2005


Daniel Carrera <dcarrera <at> digitaldistribution.com> writes:
> I hope someone here might clarify something for me. I've been comparing 
> Monotone and Darcs. Monotone has "branch names":
> 
> http://www.venge.net/monotone/docs/Branches.html#Branches
> 
> You know, things like net.sourceforge.myproject. It suggests that this 
> cumbersome notation is necessary for a distributed project. But it Darcs 
> doesn't seem to have any such need, in spite of being just as 
> distributed as Monotone.
> 
> I was hoping that someone could clarify why Monotone needs those branch 
> names and how Darcs manages to circumvent that need.

Darcs conflates the concepts of "storage location" (also known as "repo") and
"branch".  Monotone does not; in monotone, one repo can store arbitrarily many
branches.  In darcs, sending patches between repos is an act of modification;
you are merging between one branch and another.  In monotone, repositories are
stateless; communication simply shares information, and merging is a separate
operation.  Ergo, in darcs, the location of a repo is a unique identifier for
it, and if the location should change, so does the branch name.  In monotone,
branches migrate freely, so they need some sort of persistent unique name.

There are a variety of consequences of this, that I should probably write up
more carefully.  Darcs is simpler in one sense; it has only one concept
("repo+branch") where monotone has two ("repo", "branch").  Monotone is simpler
in another; in monotone you never have to worry about who hosts information,
whether it will go away, doing something special on your server when making a
new branch, making a local mirror of any branches you'll need while
disconnected, etc.  This is a shamefully short summary of a deep and subtle
issue; my apologies, but hopefully it will give some idea of the issue...

There's also probably some sort of irony in the haskell-based system being the
one with a stateful design, and the c++-based system being the one with a
declarative/non-mutating design, but dunno how much to make of that :-).


FWIW, we also plan to switch monotone branch naming over to look like
sourceforge.net/foo, since it seems clear everyone likes it better :-)

-- Nathaniel





More information about the darcs-users mailing list