termie / git-bzr-ng

bi-directional git to bzr bridge: never fear bzr again
BSD 3-Clause "New" or "Revised" License
198 stars 47 forks source link

Possible to use existing shared bzr repository already available locally? #49

Open istathar opened 12 years ago

istathar commented 12 years ago

Doing conversions from Bazaar to Git locally.

I already have a "shared repository" at .. relative to the forest of Bazaar branches I have. This is a common pattern, and how you avoid having a full copy of the revisions inside each branch. So, we have a ["shared] Repository ["] at ~/src/project with

~/src/project/.bzr/repository/packs/*.pack

and then many Branches (with Working Trees), each with branch metadata:

~/src/project/mainline/.bzr/branch/...
~/src/project/feature/.bzr/branch/...
~/src/project/fix-64252/.bzr/branch/...

and so on.

So rather than pulling from a remote (ie launchpad) branch, I'm working locally where all the revisions are already present., Using git-bzr-ng to create a git mirror,

$ cd ~/src/project
$ git bzr clone mainline converted

works fine [awesome!], creating ~/src/project/converted with a Git tree in it as expected. However, your design for holding Bazaar revision info quietly inside its .git means that we have a second copy of the same information:

~/src/project/converted/.git/bzr/repo/.bzr/repository/packs./*.pack

Would it be possible instead to use the existing information at:

~/src/project/.bzr/repository/packs/*.pack

? This would seem morally equivalent to git clone's --shared or --reference arguments; I'd be fine with having to manually specify the location, though bzr itself searches parent directories for a repo with the required revisions, so in a way I was surprised that your code overrode that. Fair enough, but if we could share revisions then it would save a lot of disk space.

AfC