# bzr to git syncing

6 messages from 2009-06-29 to 2009-08-31. Participants: David Reitter, Alex Bennee, Sverre Rabbelier, Ian Clatworthy.
Thread: https://gitlist.dev/t/19966

## David Reitter, 2009-06-29 19:12

Subject: bzr to git syncing
Message-ID: <F84D4C0F-1CEF-4853-84DB-B7927CBE62B3@gmail.com>
URL: https://gitlist.dev/e/F84D4C0F-1CEF-4853-84DB-B7927CBE62B3%40gmail.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.

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, 2009-08-28 16:02

Subject: Re: bzr to git syncing
Message-ID: <b2cdc9f30908280902m22d594bam3c70259d4c296e52@mail.gmail.com>
URL: https://gitlist.dev/e/b2cdc9f30908280902m22d594bam3c70259d4c296e52%40mail.gmail.com
In-Reply-To: <F84D4C0F-1CEF-4853-84DB-B7927CBE62B3@gmail.com>

```
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, 2009-08-28 16:19

Subject: Re: bzr to git syncing
Message-ID: <fabb9a1e0908280919o412baeb1ka69968a93297ca59@mail.gmail.com>
URL: https://gitlist.dev/e/fabb9a1e0908280919o412baeb1ka69968a93297ca59%40mail.gmail.com
In-Reply-To: <b2cdc9f30908280902m22d594bam3c70259d4c296e52@mail.gmail.com>

```
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, 2009-08-28 17:47

Subject: Re: bzr to git syncing
Message-ID: <b2cdc9f30908281047p76c12029u21b100ae6d88fe93@mail.gmail.com>
URL: https://gitlist.dev/e/b2cdc9f30908281047p76c12029u21b100ae6d88fe93%40mail.gmail.com
In-Reply-To: <fabb9a1e0908280919o412baeb1ka69968a93297ca59@mail.gmail.com>

```
2009/8/28 Sverre Rabbelier <srabbelier@gmail.com>:
> 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, 2009-08-28 17:49

Subject: Re: bzr to git syncing
Message-ID: <fabb9a1e0908281049t64f06a2r5efa114c7bcdc468@mail.gmail.com>
URL: https://gitlist.dev/e/fabb9a1e0908281049t64f06a2r5efa114c7bcdc468%40mail.gmail.com
In-Reply-To: <b2cdc9f30908281047p76c12029u21b100ae6d88fe93@mail.gmail.com>

```
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. 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, 2009-08-31 07:49

Subject: Re: [Vcs-fast-import-devs] bzr to git syncing
Message-ID: <4A9B8097.4050702@canonical.com>
URL: https://gitlist.dev/e/4A9B8097.4050702%40canonical.com
In-Reply-To: <fabb9a1e0908281049t64f06a2r5efa114c7bcdc468@mail.gmail.com>

```
Sverre Rabbelier wrote:
> 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.

```
