Subject: Re: [PATCH] Add hg-to-git conversion utility.

From: "Shawn O. Pearce" <[email-masked]>
Date: Fri, 12 Jan 2007 17:15:25 -0500

Stelian Pop <[email-masked]> wrote:
> hg-to-git.py  is able to convert a Mercurial repository into a git one,
> and preserves the branches in the process (unlike tailor)

Cool!

You've already written the converter, but you may want to look at
using git-fast-import as the backend interface to Git.  I think
your code may come out shorter, be clearer, and will run faster.

For example Simon Schubert's cvs -> git converter was written in
one night (last night) in Ruby using git-fast-import as the backend
(Simon already had the heavy lifting CVS portions done).  I peeked
at his source and its quite readable, though maybe that's just the
Ruby talking.  ;-) Simon is apparently trying to import FreeBSD's
CVS repository to Git.  A non-trivial task.

Chris Lee also has an svn -> git converter that uses gfi as its
backend. Its only 150 or so lines of Python and is also quite
readable.  Chris is apparently trying to import KDE to Git.
An equally non-trivial task.

I think the common thread between the two implementations is
that there's less process forking and less manipulation of ugly
environment variables.  So the import runs faster and its a little
easier to organize the code.

The gitweb (and mirror URLs) for gfi is available here:

  http://repo.or.cz/w/git/fastimport.git

Post 1.5.0 I'm going to nudge Junio to get gfi added to the main
git.git repository.  (Right now I don't want to distract him from
the release.)

-- 
Shawn.