

GitHub's Hg-Git mercurial plugin - mattculbreth
http://hg-git.github.com/

======
jherdman
Wow. These guys are on top of their game. I'm impressed!

I've been using Mercurial at work, and generally Git at home. This could
definitely simplify my toolbox a bit. I need to spend some more time with Git,
but right now Mercurial is edging out for me.

------
jhawk28
I wonder if this is related to the GSOC 2009 project?
[http://socghop.appspot.com/student_project/show/google/gsoc2...](http://socghop.appspot.com/student_project/show/google/gsoc2009/hg/t124022472367)

~~~
schacon
It is not related. I happened to really get going on this project at roughly
the same time as the GSOC stuff came out, but the student that was working on
that seems to have stopped.

------
pieter
Presumably this changes the hashes? Is there some tool that converts git sha's
to hg sha's, so you can still do something like `hg log <some git sha someone
gave you>`? I guess that sort of stuff will cause the most confusion, just
like local revision numbers can cause confusion (with hg and bazaar).

~~~
schacon
There is a mapping from Git SHAs to Hg SHAs. Technically we could add a
command to run an Hg log from a Git SHA since we have a one to one mapping,
but it's generally easier to not have to really know what the Git stuff is.
You should be able to work in Hg with all your normal workflow, but push and
pull from a server with a git+ssh protocol instead of an Hg server. It should
be mostly transparent for the Hg user, and a developer using a Git client
should not be able to tell that commits authored by an Hg developer was even
using Hg. The data stored by both systems are not hugely different.

~~~
pieter
OK, but what about sha's you get from others? Someone references a sha in an
email, or on IRC, or you find a reference to something in a bug report, or a
gitweb search..

------
jokull
This is how GitHub is going to win BitBucket. Maybe.

~~~
tumult
Why does one have to defeat the other?

~~~
jokull
Don't have to. My guess is that one is going to come out on top eventually.

~~~
greut
Github seems to already be quite on top of Bitbucket. But both can live
together nobody has to win or lose.

------
maw
Slick, but isn't it only half the job? If I use mercurial to clone from a git
repo, is there a way to publish the work I do on top using mercurial in a way
accessible to git users?

Still, this is a step towards it not mattering which tool you use if you want
or need to collaborate with others—definitely a good thing.

~~~
schacon
Yes, you can push to a Git repository and hg-git will convert the hg commits
you did in the meantime to Git objects and push them upstream. The tool is
losslessly bi-directional. Developers using Git or Hg clients can push and
pull from a Git server without necessarily knowing what client the other
developers are using.

~~~
utx00
what if someone changes git history? some rebasing or something like that? how
does it affect downstream hg clients?

thanks.

~~~
ubernostrum
"what if someone changes git history? some rebasing or something like that?
how does it affect downstream hg clients?"

I was under the impression that even among Git users, editing the history of
something you've already pushed to others/allowed others to pull from is to be
punished by public humiliation.

------
tomjen
Now we only need one that go the other way so I don't have to use git to clone
stuff from github.

