[Bf-committers] HOWTO transplant development branches coming from git-svn to git.blender.org

Mitchell Stokes mogurijin at gmail.com
Sun Nov 17 21:28:26 CET 2013

Here's what I did:

 * Create a copy of my git-svn repo to avoid messing it up (I will refer to
this as copy-repo).
 * cd to the copied repo
 * Make the blender folder the root of the repot with: git filter-branch
--subdirectory-filter blender/ -- --all
 * cd into your new Blender repo
 * Add your old repo as a remote: git remote add old <path-to-copy-repo>
 * Checkout a branch you want to transplant: git checkout old_branch (git
should find it from the remote)

Now we need to rebase the history, which for me was kind of painful, so
someone might have a better solution, but here is what I did:
 * git rebase master -i
 * Select all the commits that aren't part of my branch and delete them
 * I then had a merge conflict with every revision due to the scons folder
now being a module (this could probably be fixed with another git
 * I just used git mergetool, chose local, and did git rebase --continue (I
only had 15 revisions, so this didn't take too long)

This only handles one branch at a time, but that also means I can pull them
over as needed. I'm not very knowledgeable with git, and there could be an
easier way, but this seems to be a little simpler for smaller branches.

--Mitchell Stokes

On Sun, Nov 17, 2013 at 10:36 AM, Julien RIVAUD (_FrnchFrgg_) <
frnchfrgg at free.fr> wrote:

> Hi everyone,
> I'd like to give you notice of a somewhat advanced git HOWTO for people
> that used previout git mirrors of blender (as the mirror by jesterKing).
> The HOWTO is here:
> http://wiki.blender.org/index.php/User:Frnchfrgg/Transplant
> This HOWTO aims to salvage developement branches made with SVN mirrors,
> that are impossible to rebase. The HOWTO is long and you'll need some
> git knowledge, but you'll be well guided throughout.
> A lot of the cleaning part directly comes from the experience I gained
> working on the git.blender.org conversion.
> To know if this is for you, check the following:
> * MANDATORY Did you use to develop for Blender in a Git repository
> either cloned from jesterking's SVN mirror or directly from git-svn ?
> (other SVN mirrorring solutions might also be handled with
> modifications, but not manual periodic dumps of SVN)
> and any of:
> * Is the branch that much intertwinned with trunk from git-svn (several
> merges with conflict resolutions) that rebasing is too painful ? (Note
> that while rebasing you'd have to know how to use the -Xsubtree=blender
> option, unless your SVN clone doesn't have the leading blender/ directory)
> * Did you commit to files with CR-LF line endings so that conflicts
> happen all the time with git.blender.org while rebasing and the
> -Xrenormalize rebase option doesn't help ?
> * Do you want to try a wicked smart way to transplant history ?
> I'm hoping this will be of good use for some of you, and am mostly
> available to help on #blendercoders.
> Cheers,
> _FrnchFrgg_
> P.S.: I devised that method to fix the multiview branch of dfelinto that
> was seriously entangled with Nathan's mirror and had ~400 commits to
> salvage including merges from trunk, so rebasing was nigh impossible and
> cherry-picking by hand (resolving all conflicts anew) was a nightmare.
> Of course you can always use the conversion as a base to rework your
> branch into a set of clean, sorted, progressive and reviewable commits.
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

More information about the Bf-committers mailing list