Is there a way to convert a darcs project with multiple branches (i.e., more than two darcs repositories containing different but related sets of patches) to a single git repository, so that each darcs repo is transferred to a distinct branch in the git repo?
Solutions considered:
(1) The darcs convert command offers two recipes for exporting darcs to git:
a. one-time export:
$ cd repo
$ git init ../mirror
$ darcs convert export | (cd ../mirror && git fast-import)
This converts only one repo, one branch.
b. incremental export using marksfiles (to maintain a git mirror of a darcs repository):
$ cd repo
$ git init ../mirror
$ touch ../mirror/git.marks
$ darcs convert export --read-marks darcs.marks --write-marks darcs.marks |
(cd ../mirror &&
git fast-import --import-marks=git.marks --export-marks=git.marks)
Using (b), if I had only one other darcs repo as a branch, I might hope to continue with
$ cd ../mirror
$ git branch branch1
$ git checkout branch1
$ cd ../repo
$ darcs pull ../repo-branch1
and then repeat the darcs convert export
step.
But with two other branches, this does not seem likely to work, since pulling ../repo-branch2 would merge together the patches of branch1 and branch2.
(2) Darcs-bridge [2]. Incomplete, unmaintained since 2013, and "still named darcs-fast-convert", recommended only for a one-time conversion in either direction (darcs->git or git->darcs)
The darcs-bridge page itself [2] recommends using the 'darcs convert' command built into darcs 2.10.
However, it can handle branches (with some work):
See use-case 2 in [2]:
$ git init my_project_git
$ darcs-fastconvert export myproject myproject-branch1 |
(cd my_project_git && git fast-import && git checkout master)
This will create the git repo with two branches: (darcs) myproject -> (git) master (darcs) myproject-branch1 -> (git) myproject-branch1 with a common prefix, but no merges detected.
Use case 5 in [2] describes a way to change the list of branches that the darcs-bridge is managing.
"What are the limitations?" and "What needs work?" in [2] seem to be saying (hard for me to understand) that darcs merges are not correctly converted unless special tagging is used -- tagging which must be done before the merge, so it is now impossible for me to do.
(3) Darcs-fastconvert (on which darcs-bridge is based): according to [2], did not manage multiple branches
(4) darcs-to-git: acc. to [2], does not support branches
(5) darcs2git: acc. to [2], does not support branches
(6) tailor: acc. to [2], does not support branches easily, has been discontinued in favor of darcs-fastconvert
References:
[1] Darcs-Convert: http://darcs.net/Using/Convert)
[2] Darcs-Bridge: http://darcs.net/DarcsBridgeUsage)