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

Grant Husbands darcsusers at grant.x43.net
Wed Jul 22 18:50:06 UTC 2009


(Anyone who wants to follow the conversation should probably read my
replies to Max Battcher and Petr Rockai before this one.)

Eric Kow <kowey at darcs.net> wrote:
> I'd particularly appreciate it if we could summarise any results from
> this on the bug tracker in the end
> http://bugs.darcs.net/issue555

That would be useful, certainly, but I'm exciting enough opposition
that I don't feel I'm the best person for summarising any of this.

> Another option to consider: though this may be straying from the idea of
> implementing a standalone tool, but it seems that darcs-branch could
> outsource any clever bits to the Darcs library (and that we'd have to
> think carefully through extensions to the Darcs library and not just
> hashed-storage to make this work).

Agreed. In fact, here is a proposal:

To greatly simplify any implementation of in-repo branching, we make
Darcs[library] itself able to handle having multiple
(pristine,inventory) pairs, addressable by branch name, with one of
the branches also 'owning' the working copy. As in the proposal, the
magic of hashed_storage makes this work fairly nicely.

We also extend all actions that take a repository to also take a
branch name (defaulting to whichever one 'owns' the working copy),
which simply dictates the root (pristine,inventory) to use. Those
commands that affect the working directory will need altering to only
do so when they are affecting the relevant branch, but many actions
already update the working copy in a separate step, so that should be
easy.

With that done, pushing and pulling between branches works fairly
naturally and without having anything second-guess Darcs patch,
inventory and tag handling. Further, all of the built-in darcs
commands will then work across branches, without pain.

Then, we can still have the outside-of-darcs tool for:
* Managing branches
* Synchronising knowledge-of-branches between repositories
* Switching between branches (which should be simplified by the fact
that Darcs is aware of them)

G.


More information about the darcs-users mailing list