- $ git svn clone -T trunk -b branches -t tags https://svn.jboss.org/repos/teiid teiid.git
- $ git checkout 7.4.x
- $ git checkout -b <name of temporary branch>
- $ git cherry-pick <commit associated w/svn revision>
- $ git svn dcommit -n --commit-url https://svn.jboss.org/repos/teiid/branches/7.4.x/
- $ git diff <commit output from previous command>
- $ git svn dcommit --commit-url https://svn.jboss.org/repos/teiid/branches/7.4.x/
This is a "Happy Path" example, but also very realistic based upon what I've experienced with patching Teiid.
- This is a one time only step that creates a local GIT repo (in your home directory called teiid.git) based upon https://svn.jboss.org/repos/teiid. This step will be time consuming as GIT will process the entire SVN repository during the creation of you local GIT repo. Once completed, this will not need to be repeated. The resulting GIT repo will also be extremely compact compared to an SVN equivilant.
- This will create a tracking branch of the 7.4.x branch that exists in the SVN repository. Note how quickly GIT can switch between branches.
$ time git checkout 7.4.x
Note: checking out '7.4.x'.
HEAD is now at 95ec636... TEIID-1884 fixing final row count when using foward only and fix of unit test to avoid in-process thread during row count.
Checking out 7.1.x: (not showing the switch back to 7.4.x, this is to show time required to switch between branches)
$ time git checkout 7.1.x
Previous HEAD position was 95ec636... TEIID-1884 fixing final row count when using foward only and fix of unit test to avoid in-process thread during row count.
HEAD is now at f6e3a83... SOA-3664 update version of teiid to 7.1.2.GA for inclusion in EDS 5.1 roll up patch update release notes
3. And create a new branch to work on:
$ time git checkout -b timeTestFor7.4.x
Switched to a new branch 'timeTestFor7.4.x'
4. Cherry picking the appropriate commit is easy. Some leg work must be done in order to identify the commit needed. It's not unusual to have to resolve merges at this point. A clean cherry pick (no merges needed) will also retain the original author's information.
5. This is a dry run of the SVN commit. It will output two commit hash's that can be used in step 6.
6. A git diff sanity check of the changes that will be committed to SVN.
7. Same as step five without the "-n" arguement to specify a dry run. The SVN repository will advance a revision and your local GIT repo will be updated.