git-remote-bzr icon indicating copy to clipboard operation
git-remote-bzr copied to clipboard

Speeding up import of branches?

Open SirVer opened this issue 9 years ago • 1 comments

First, thanks for your excellent work!

I am using this to mirror all branches from merge-proposals for my project from launchpad to GitHub.

I have two directories:

bzr_repo contains a shared repository made with bzr init-repo. I check out the branches I want to mirror into this. • git_repo contains the git repository that pushes to https://github.com/widelands/widelands.

Let's say I want to mirror the branch my_branch. My tool first branches the launchpad source branch into bzr_repo/my_branch. I then execute git remote add my_branch bzr::../bzr_repo/my_branch in the git repository. Doing a fetch on this new remote then triggers the import with continuous updates: "progress revision 4600 ....". This takes a long time, roughly 2 hours.

Now comes my question: If I repeat the same process with another branch my_branch2 that only differs by one commit, the git fetch takes exactly as long again. bzr branch is clever and understands that little needs to be fetched and after the process has terminated, git also understands that only one commit is different (judging by the gitk branch relationship graphs).

Is there no way to speed up importing of my_branch2?

SirVer avatar Jan 02 '16 12:01 SirVer

The problem you describe has been resolved in mnauw/git-remote-bzr@564a7ab9e9adfdf4347cdf454b402828de5802f6 (and preceding commits). It is generally also recommended to use latest HEAD in that repo for various other fixes and features.

Technically, by now making use of shared marks-files, git-remote-bzr is automatically aware of what has been imported already, and so that does not need to happen again when another branch is fetched/imported.

mnauw avatar Oct 23 '16 11:10 mnauw