threads / discuss / 19966

bzr to git syncing

Subject: bzr to git syncing

## tl;dr

6 messages between Jun 29, 2009 and Aug 31, 2009.

replies: 5people: 4as markdown or json

David Reitter· Jun 29, 2009, 19:12 UTC · lore

Does anyone have experience syncing a Bzr repository to git? I would ideally want two-way syncing, but even the bzr->git route would be a start.

We're starting with a Git repo that was converted from CVS and it being kept up to date. The CVS repo will be converted to Bzr sooner or later, and at that point we'd need to sync from that one. We would need to keep the revision IDs coherent, i.e. not re-convert.

I have looked at the git-bzr scripts that go the fast-im/export route; this fails unfortunately (bzr side I think). Also, I'm not sure if that would preserve revids.

It strikes me that patches / merge bundles would be cleaner way to do this.

(If you care: The background of this is that Emacs is switching to Bzr, but my downstream project, Aquamacs, and a bunch of Emacs devs want to use git themselves, so I'm trying to find someone who can do this.)

Thanks in advance for your suggestions.
Alex Bennee· Aug 28, 2009, 16:02 UTC · re: David Reitter · lore

Re: bzr to git syncing

2009/6/29 David Reitter <david.reitter@gmail.com>:
> Does anyone have experience syncing a Bzr repository to git?
> I would ideally want two-way syncing, but even the bzr->git route would be a
> start.

I've a sneaking suspicion a breakage has been introduced to either the git-bzr script or the bzr fast-import module. I say this as I have successfully pulled from a bzr repo into git before but having need to do it today and I get a crash in fast-import.

A few quick questions:
* What versions of git/bzr are you using (me: git 1.6.4, bzr 1.17)?
* Which git-bzr script are you using (me:
http://github.com/mcepl/git-bzr/tree/master)?

I've attached the fast-import crash I'm seeing. Are you seeing the same sort of failure?

-- Alex, homepage: http://www.bennee.com/~alex/ http://www.half-llama.co.uk

Sverre Rabbelier· Aug 28, 2009, 16:19 UTC · re: Alex Bennee · lore

Re: bzr to git syncing

Heya,
On Fri, Aug 28, 2009 at 09:02, Alex Bennee<kernel-hacker@bennee.com> wrote:
> I've attached the fast-import crash I'm seeing. Are you seeing the
> same sort of failure?

The program you used to generate the stream (I assume git-bzr?) is generating an invalid mode, git understands '100644', '100755', '120000', and '160000'; the mode in the stream, '040000', is not something we understand.

-- 
Cheers,

Sverre Rabbelier
Alex Bennee· Aug 28, 2009, 17:47 UTC · re: Sverre Rabbelier · lore

Re: bzr to git syncing

2009/8/28 Sverre Rabbelier <srabbelier@gmail.com>:
Show 10 quoted lines
> Heya,
>
> On Fri, Aug 28, 2009 at 09:02, Alex Bennee<kernel-hacker@bennee.com> wrote:
>> I've attached the fast-import crash I'm seeing. Are you seeing the
>> same sort of failure?
>
> The program you used to generate the stream (I assume git-bzr?) is
> generating an invalid mode, git understands '100644', '100755',
> '120000', and '160000'; the mode in the stream, '040000', is not
> something we understand.

Yeah, it seems in bzr land it mean new directory which we don't care about. The following patch makes it work. Apologies for failure to inline but Gmail would just corrupt it if I tried.

I also had to patch the ref check code to accept bzr style branch names but I suspect that patch should be kept out of the repo.

-- 
Alex, homepage: http://www.bennee.com/~alex/
http://www.half-llama.co.uk
Sverre Rabbelier· Aug 28, 2009, 17:49 UTC · re: Alex Bennee · lore

Re: bzr to git syncing

Heya,
[+vcs-fast-import-devs]
On Fri, Aug 28, 2009 at 10:47, Alex Bennee<kernel-hacker@bennee.com> wrote:
Show 16 quoted lines
> 2009/8/28 Sverre Rabbelier <srabbelier@gmail.com>:
>> On Fri, Aug 28, 2009 at 09:02, Alex Bennee<kernel-hacker@bennee.com> wrote:
>>> I've attached the fast-import crash I'm seeing. Are you seeing the
>>> same sort of failure?
>>
>> The program you used to generate the stream (I assume git-bzr?) is
>> generating an invalid mode, git understands '100644', '100755',
>> '120000', and '160000'; the mode in the stream, '040000', is not
>> something we understand.
>
> Yeah, it seems in bzr land it mean new directory which we don't care
> about. The following patch makes it work. Apologies for failure to
> inline but Gmail would just corrupt it if I tried.
>
> I also had to patch the ref check code to accept bzr style branch
> names but I suspect that patch should be kept out of the repo.
This seems like a fine case for the new 'feature' command on bzr's export side.
-- 
Cheers,

Sverre Rabbelier
Ian Clatworthy· Aug 31, 2009, 07:49 UTC · re: Sverre Rabbelier · lore

Re: [Vcs-fast-import-devs] bzr to git syncing

Sverre Rabbelier wrote:
Show 15 quoted lines
> Heya,
> 
> [+vcs-fast-import-devs]
> 
> On Fri, Aug 28, 2009 at 10:47, Alex Bennee<kernel-hacker@bennee.com> wrote:
>> 2009/8/28 Sverre Rabbelier <srabbelier@gmail.com>:
>>> On Fri, Aug 28, 2009 at 09:02, Alex Bennee<kernel-hacker@bennee.com> wrote:
>>>> I've attached the fast-import crash I'm seeing. Are you seeing the
>>>> same sort of failure?
>>> The program you used to generate the stream (I assume git-bzr?) is
>>> generating an invalid mode, git understands '100644', '100755',
>>> '120000', and '160000'; the mode in the stream, '040000', is not
>>> something we understand.
>> Yeah, it seems in bzr land it mean new directory which we don't care
>> about.
> This seems like a fine case for the new 'feature' command on bzr's export side.

Hmm - I only added that 040000 stuff late last week and it *should* only be output if you explicitly ask for extended metadata from bzr fast-export via the --no-plain option? If that's not the case, please raise a bug here: https://bugs.launchpad.net/bzr-fastimport.

Ian C.

← back to recent threads