Skip navigation
  1. $ git svn clone -T trunk -b branches -t tags https://svn.jboss.org/repos/teiid teiid.git
  2. $ git checkout 7.4.x
  3. $ git checkout -b <name of temporary branch>
  4. $ git cherry-pick <commit associated w/svn revision>
  5. $ git svn dcommit -n --commit-url https://svn.jboss.org/repos/teiid/branches/7.4.x/
  6. $ git diff <commit output from previous command>
  7. $ 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.

 

  1. 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.
  2. 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.

 

real    0m1.538s

user    0m0.101s

sys    0m0.089s

 

     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

 

real    0m0.375s

user    0m0.116s

sys    0m0.064s

 

   3.  And create a new branch to work on:

 

$ time git checkout -b timeTestFor7.4.x

Switched to a new branch 'timeTestFor7.4.x'

 

real    0m0.135s

user    0m0.058s

sys    0m0.018s

   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.

Filter Blog

By date: By tag: