schacon / hg-git

mercurial to git bridge, pushed to directly from the hg-git plugin in Hg
GNU General Public License v2.0
620 stars 71 forks source link

Problem with hg gpush #21

Closed cryos closed 14 years ago

cryos commented 14 years ago

I just tried importing the eigen2 repository, http://bitbucket.org/eigen/eigen2/, and encountered a problem at the hg gpush stage,

http://gist.github.com/119079

This is with mercurial 1.2.1, python 2.6. Please let me know if you need any more details to reproduce. This plugin looks great and I hope to be able to use it. I know that eigen was tough to convert as it is derived from an import fromt the KDE SVN repo.

cryos commented 14 years ago

I spotted the typo - I used the remote git@github.com/cryos/eigen2.git rather than git@github.com:cryos/eigen2.git. I will let you decide whether you would like to add futher error checking to this function or not (would probably be nice). Seems to have worked really well and the conversion/push went well.

There is a typo in the instructions too, I think you mean hg gpush, rather than hg push in your instructions.

ghost commented 14 years ago

please show your .hg/git-config.

btw, this hg->git conversion would be lossy (you will not get the same nodeids after backward git->hg conversion) since hg-git doesn't export unknown extras (this repo has convert_revision extra as a result of svn conversion).

cryos commented 14 years ago

See my comment above - it was a typo in the github remote. Other than the extras that are not converted, would pushing and pulling between git and hg repos still be possible?

ghost commented 14 years ago

I believe yes, unless you are going to gexport full git repo to hg (in other words, you need to have original hg repo as a base to gimport new git commits).

cryos commented 14 years ago

We have just noticed another issue - the 2.0 branch is missing. I thought branches should be supported.

schacon commented 14 years ago

i will look into the missing branch deal - named branches should be there.

durin42 commented 14 years ago

Can you reverify if this is still happening?

cryos commented 14 years ago

It is tough to check, so much has changed in the plugin. I just pulled the latest hg-git, and tried,

hg push git+ssh://git@github.com/cryos/eigen2.git

I got abort: refs/tags/before-hg-migration changed on the server, please pull and merge before pushing. So I set up a new test repo. Tried the push again. It seemed to work OK, but still no 2.0 branch. Reading through the docs I am not even sure if it is supposed to now.

I tried the bookmarking thing mentioned,

hg bookmark -r 2.0 2.0-branch

That worked, but failed if I gave it the same name as the branch. I.e. 2.0. So this is far from ideal, but it is tough to tell if the docs are that up to date. It seems like the some of them still refer to gpush which seems to have been removed.

If you let me know what commands to run in sequence to import a hg repo, push the master and all branches to git and have them show up I will happily try it. It seems like I need a --all, or something like that. The tags still make it, but the branches are very important for quite a few projects where a stable branch is maintained.

cryos commented 14 years ago

It would be great to hear any thoughts you might have on this issue - or pointers to documentation. I would like to use this support more seriously for people who prefer to use Hg but allow us to host the repository using Git. Branches seem to be the missing piece of the puzzle as far as I can see.

abderrahim commented 14 years ago

1- named branches are supported in the sense that they aren't lost in the conversion, but they aren't treated as git branches in the conversion (only bookmarks are). This shouldn't be very difficult to fix though. 2- the refs/tags/* changed on the server is probably because it changed in hg-git (it's not yet stable, and you seem to have migrated from a very old revision). 3- about using hg but host the repo in git, there should be a consensus about using either named branches or bookmarks (using bookmarks is preferred since they emulate the git branching model)

durin42 commented 14 years ago

This should be fixed in the development version. A release will happen once a new dulwich release is made.