Re: Git/Mercurial interoperability (and what about bzr?) (was: Re: [VOTE] git versus mercurial)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Theodore Tso
Date: Tuesday, October 28, 2008 - 2:31 pm

On Tue, Oct 28, 2008 at 08:12:34PM +0100, Miklos Vajna wrote:

The code I was referring to was called hg-fast-export, which is part
of the "fast export" tools that front-end into git fast-import.  The
git repository can be found here:

	http://repo.or.cz/w/fast-export.git
	git://repo.or.cz/fast-export.git

I ended up using a very customized version of that script to convert
the hg e2fsprogs repository to git.

In the past I've looked at the possibility of creating a
bi-directional, incremental gateway between hg and git repositories.
The main thing which makes this difficult is that hg stores tags
in-band inside the change-controlled .hgtags file.  This means that if
you cut a release, tag it, and then create a commit to further modify
the repository, the new commit is descended from the tag commit,
whereas in git, the tag is a "bookmark" --- perhaps signed via GPG,
but not part of the revision history.

I think the git method is much more sane, but what it means is that
topologically, the commit tree for git and hg can never be identical.
It also means that if you add a tag to a git tree after making several
commits on that branch, how you reflect that in the hg repository is
highly problematic.  Do you rewrite the branch?  Do you add the tag
later on, disturbing the parent-child relationship of later commits?
How do you keep track of when a tag hg repository topology if you are
trying to maintain a bidirectional mapping between commits?

It's not impossible, but it makes it much more difficult, since in the
hg world, tag commits can be inserted between arbitrary commits.  This
also means that if you want to create a bidrectional gateway between
hg and git, it has to be a single gateway so it can keep track of this
state information.  If you try to have multiple gateways they would
need to synchronize on when a tag entered the hg universe, and with
what commit ID (and what timestamp).

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[VOTE] git versus mercurial, walt, (Sat Oct 25, 9:28 pm)
Re: [VOTE] git versus mercurial, walt, (Tue Oct 28, 5:31 am)
Re: [VOTE] git versus mercurial, Johannes Schindelin, (Tue Oct 28, 7:28 am)
Re: Git/Mercurial interoperability (and what about bzr?) ( ..., Johannes Schindelin, (Tue Oct 28, 7:59 am)
Re: Git/Mercurial interoperability (and what about bzr?) ( ..., Theodore Tso, (Tue Oct 28, 2:31 pm)
Re: [VOTE] git versus mercurial, Miles Bader, (Wed Oct 29, 1:15 am)
Re: [VOTE] git versus mercurial, Shawn O. Pearce, (Wed Oct 29, 12:11 pm)
Re: [VOTE] git versus mercurial, Boyd Lynn Gerber, (Wed Oct 29, 12:36 pm)
Re: [VOTE] git versus mercurial, Johannes Schindelin, (Wed Oct 29, 12:48 pm)
Re: [VOTE] git versus mercurial, Boyd Lynn Gerber, (Wed Oct 29, 12:51 pm)
Re: Git/Mercurial interoperability (and what about bzr?), Florian Weimer, (Sat Nov 1, 1:06 am)
Re: Git/Mercurial interoperability (and what about bzr?), Jakub Narebski, (Sat Nov 1, 3:33 am)
Re: Git/Mercurial interoperability (and what about bzr?), Florian Weimer, (Sat Nov 1, 3:44 am)
Re: Git/Mercurial interoperability (and what about bzr?), Florian Weimer, (Sat Nov 1, 4:10 am)
Re: Git/Mercurial interoperability (and what about bzr?), Jakub Narebski, (Sat Nov 1, 5:26 am)
Re: Git/Mercurial interoperability (and what about bzr?), Linus Torvalds, (Sat Nov 1, 10:51 am)