hg-git call for tests

Abderrahim Kitouni a.kitouni at gmail.com
Fri Aug 7 15:51:27 CDT 2009


Hi all,

I feel now that hg-git is in a state where it is really useable without needing
to understand its internals.

So I'd like it to receive more testing before being oficially released. You can
report bugs to http://bitbucket.org/abderrahim/hg-git/issues/

What is hg-git?
It is a Mercurial extension that adds the ability to work on Git repositories.
It also allows using a Git server as a collaboration point for a team with
developers using both Git and Mercurial.

What to expect?
If you are comfortable with hg and have already used git, hg-git should feel
natural. (If not file a bug :-)) For example, to clone a git repository over
git or ssh:

	hg clone git://github.com/schacon/hg-git.git
	hg clone git+ssh://git@github.com/schacon/hg-git.git

Pushing to git is a bit trickier, as git requires that any commit is
referenced, you will need to bookmark/tag the things you're pushing.

Generally, you don't need to worry about this. If you have the bookmark
extension enabled, hg-git will create a bookmark for every git branch.

hg-git will also create git-style (local) tags for every path in your hgrc (in
the form <remote name>/<branch name>).

The fetch extension won't work since it relies on named branches, but I'm
thinking about doing something about this. For now, you can use something like
'hg merge default/master'

How to get it?

    hg clone http://bitbucket.org/abderrahim/hg-git

and add
[extensions]
git = /path/to/hg-git

to your hgrc. You also need dulwich [1], it's recommended that you get the
latest version from git, I've setup an hg mirror here :

     hg clone http://bitbucket.org/abderrahim/dulwich

If you're brave enough ...

I have a patch series adding mainly support for submodules and using git
fast-import to speed the conversion to git.

   hg qclone http://bitbucket.org/abderrahim/hg-git-patches
(some patches are guarded, you don't need them).

Using fast-import is easy, you just need to add 

[git]
fast-import = True

to your hgrc.

If you want to try submodules, you need the latest developement version of
dulwich. The .gitmodules file is converted to an .hgsub (it's still not
perfect, but it can read git-submodule generated files) and you should be able
to use the resulting repository normally (there may be still some bugs).

If you have any feature requests, these are also welcome ;-)

[1] http://samba.org/~jelmer/dulwich

Cheers,
Abderrahim


More information about the Mercurial mailing list