git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Han-Wen NienhuysNext: Han-Wen Nienhuys
Message 2 of 5 in “darcs2git.py - convert darcs repository using gfi”
  1. Han-Wen NienhuysFeb 11, 2007
  2. Shawn O. PearceFeb 12, 2007
  3. Han-Wen NienhuysFeb 13, 2007
  4. git-fast-export ?Han-Wen Nienhuys, Feb 18, 2007
  5. Shawn O. PearceFeb 19, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.