Converting from git loses branch names

Brendan Cully brendan at kublai.com
Wed Dec 3 18:26:15 UTC 2008


On Wednesday, 03 December 2008 at 10:28, Greg Ward wrote:
> On 02 December 2008, David Soria Parra said:
> > No. Git actually has a different notion of a "branch". They are pointers
> > to commits in the history, but the actual branch information is not stored
> > in the changesets. In mercurial branch names are assigned to a changeset and
> > therefore an immutable part of a changeset. If convert would convert the git
> > branches it would result in immutable branches, which might not be desired.
> > Therefore, as mercurial doesn't have same way of doing branching as git,  
> > it is
> > not 'converted'. So it's expected behaviour
> 
> Hmmm.  That is unfortunate.  Clearly I don't sufficiently understand
> either git or Mercurial; I guess I'll have to spend some time thinking
> about this before I can comment intelligently.  
> 
> So for now, please excuse me if I just whine and moan: waahhh!! I made
> *one* *little* *mistake* in trying out git before trying out
> Mercurial.  Now I've decided I like Mercurial more, but because I
> cannot convert my git repos to Mercurial without losing information,
> I'm stuck with git for those two projects.  Blech.
> 
> Can anyone think of a nice way to convert a git repository, keeping
> all branch names?  I might try to do it manually, i.e. repeat each git
> operation (commit or branch) as a Mercurial operation.  The tricky bit
> is getting that information out of git.
>        Greg

I haven't tried it, but using convert.hg.clonebranches=1 might
help. It's supposed to dump each branch into its own clone. The
branch-as-clone model is much closer to git branches.



More information about the Mercurial mailing list