Re: darcs2git.py - convert darcs repository using gfi
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Feb 12, 2007, 01:14 UTC
- Message-ID
- <20070212011401.GK31488@spearce.org>
- In-Reply-To
- <eqoaf7$loq$1@sea.gmane.org>
Han-Wen Nienhuys <hanwen@xs4all.nl> wrote:
> The python script attached is a try at providing a sane > conversion from Darcs to GIT. It tries to map darcs conflict > resolutions onto git branch merges.
Impressive.
> Regarding GFI, it's a breeze to work with; my compliments to its > author.
Hey, thanks! ;-)
Show 5 quoted lines
> My only gripe is the need to specify a branch for each commit. > Darcs uses changeset based storage. It doesn't really have branches, > but it does record divergent changes and merges of resulting > conflicts. Hence, it's not clear which refs/head/BRANCH should be > used when creating a commit object.
Just make something up. Or don't use refs/heads, instead use your own directory e.g. refs/patches/. Then you can delete the entire directory when you are done importing.
> So, my feature request: please make the "commit" command always accept > a "from" command
This restriction was a safety valve. fast-import itself would be OK if I permitted a from all of the time. A bug in cvs2svn caused multiple froms to be emitted for the same branch, and that wasn't correct, so fast-import crashed on it rather than silently accepting the data corruption.
Its actually one of those things that is nice to remove, as its 3 lines of code that just need to be deleted. ;-)
> and make the "refs" argument optional.
This is harder than it sounds. fast-import internally is built around the assumption of a branch, which has a name, and which lives in the branch LRU. With the "from" command restriction lifted you can just import every single commit onto the same hardcoded branch name (e.g. DARCS_HEAD) then delete it when you are done (e.g. rm .git/DARCS_HEAD). That's basically the same thing as an optional ref argument.
-- Shawn.