Promoting the use of Mercurial; was: Re: gnome dvcs survey results

Theodore Tso tytso at mit.edu
Sun Jan 11 15:20:53 CST 2009


On Sun, Jan 11, 2009 at 08:18:24PM +0100, Arne Babenhauserheide wrote:
> >
> > Well, an hg user will want to take new commits that originated from
> > git and pull them into their bridge repo, right?  If you have that
> > functionality, it's absolutely **trivial** to implement
> > push-from-git-to-bridge.  
> 
> How so? 
> 
> I'm a bit wary of the word "trivial". 
> 
> The only really easy implementation I can think of is to have a shell script 
> which does 
> 
> $ hg -R <bridge-repo> git pull <git-repo>
> 
> But that isn't "push from git to hg", especially not over the wire; I need a 
> local git clone for that "script" to work. 

You're going to need a local git clone in order to be able to pull new
git commits into your hg reposition.  Again, let's go back to the
sample scenario.  An hg user wants to participate in Ruby on Rails
development; Ruby on Rails development uses a git repository.  So in
order for hg user to track Ruby on Rails development, first the hg
user will need to convert the Rails git repository to hg, and then it
will need to fetch incremental new git commits and convert them to hg.

Now, first of all, I'll note that all of the DSCM conversion utilities
assume there is local repo on the machine.  This includes "hg
convert", which requires a local git clone if you wish to do an
git-to-hg conversion.  I would believe that for any bidirectional
gateway, you will need a hg *and* a git repository on the local
machine.  Again, DSCM's are very different from svn or CVS.  The
client/server protocol for hg and git are designed to implement a
"clone" or "pull/push" operation.  They aren't designed to do anything
else, so a bidirectional gateway will almost certainly require local
clones.  And the proof of that is all of the unidirectional conversion
routines all require both DSCM's repository to exist on the local
machine; and they all use the DSCM's machinery (i.e., the hg-to-git
and git-to-hg conversion utilities require both git and hg installed
on the machine.)

But if you don't believe me, go ahead and try to build one differently....

       	   	 	     	      	  - Ted


More information about the Mercurial mailing list