Revision 55dde375129f010004ddbc9d500edfe6f370e026

DarcsBridgeUsage

============ darcs-bridge ============

What is it?

darcs-bridge translates between git and darcs v2 repos, either as a one-off conversion, or incrementally over time.

Aren’t there already tool(s) to do that?

There are several tools that provide some level of conversion between darcs and git, with varying feature-sets:

darcs-fastconvert

darcs-bridge was originally based on darcs-fastconvert written by Petr Ročkai, which provided simple import and export of darcs/git repositories using the fast-import stream format. It did not manage multiple branches or merges

darcs-to-git

Written in Ruby, originally written by Steve Purcell. Gives one-way conversion from Darcs to Git - shelling out to Darcs and Git, to translate Darcs patches into Git commits. Supports incremental importing.

darcs2git

tailor

How does it work?

Internally, darcs-bridge uses the de-facto standard git fast-import stream format to communicate repository states between git and darcs. See the git fast-import man-page <http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html>_ for a description of the format.

TODO: more.

How do I use it?

There are several use-cases for darcs-bridge, we give instructions for each, below:

  1. I want to move from Git to Darcs, and not use Git anymore:

Assume we have a local Git repo: /home/owen/repos/foo_project and we want to create a darcs mirror: /home/owen/repos/foo_project_darcs.

::

cd /home/owen/repos
mkdir foo_project_darcs
(cd foo_project && git fast-export <BRANCH_LIST> -M -C --progress=1) | darcs-fastconvert import foo_project_darcs/master
  1. I want to move from Darcs to Git, and not use Darcs anymore:

  2. I want to create a bridge that allows incremental updates, and use both Git and Darcs:

  3. I want to apply a Git patch to my Darcs repository:

  4. I want to modify the branches that the bridge is managing:

What are the limitations?

Non-tagged merges aren’t handled - this means that any conflicting changes will be exported such that some information is lost (namely, the original changes the conflicting patches made) since conflicting-changes are merged such that their changes are undone; see the darcs FAQ for more information about conflicts: http://wiki.darcs.net/ConflictsFAQ Any resolutions will be exported correctly, so the end-state of the exported repo will be consistent with that of the darcs repo.

What needs work?

Performance - performance is currently sub-optimal, particularly for