A proven path for migrating from clearcase to git and or subversion
The Virtual Git Summit - Subversion to Git - A Sugar Story
-
Upload
john-mertic -
Category
Technology
-
view
1.303 -
download
0
description
Transcript of The Virtual Git Summit - Subversion to Git - A Sugar Story
Subversion to Git: A Sugar Story
John Mertic
©2012 SugarCRM Inc. All rights reserved.
Who Am I?
! John Mertic ! Contact Info
! http://jmertic.wordpress.com
! Twitter: @jmertic ! [email protected]
( SugarCRM ) ! [email protected] ( PHP )
! Community Manager for SugarCRM ! http://www.sugarcrm.com ! http://www.sugarforge.org ! Twitter: @sugarcrmdev
2/1/2012
@2012 SugarCRM Inc. All rights reserved. 2
Why we started looking past Subversion
! Merging was painful ! Couldn’t easily work on multiple releases at once ! Couldn’t do feature branch integration easily ! Merging cost us several days of downtime plus integration
testing ! No good way of doing pre-commit reviews
! Tried using Review Board for post-commit reviewing, but was ineffective
! Pre-commit reviews required manual posting of diff files and manual merging
! Overall, felt Subversion could scale to match our growing team.
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 3
Why git?
! Wanted to move towards a DVCS tool to support our growing team
! Best quality of tools and IDE plugins across the various DVCS tools.
! Many team members already familiar with git, which helped train other team members
! GitHub
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 4
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 5
Approaches to SVN to Git Migration
! Physically migrate existing SVN repository ! Helps maintain history ! Allows you to quit SVN cold
turkey
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 6
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 7
The approach we took
! Start fresh with git ! Allowed us to re-think our code structure ! Got rid of lots of old and unused code ! Avoided the problems of doing a migration
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 8
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 9
Create new git repo
Export SVN working
copy
Import SVN export into
newly created git
repo
Have devs change from svn
checkouts to git clones
Setup SVN mirroring
from GitHub
Why GitHub?
! Wanted offsite secure code hosting provider ! Very easy to use web based management of
repository ! ACL ! Simple file changes can be done online ! Visual history management
! SVN read ( and now write ) access for legacy clients ! Pull requests and forking made simple
! Enables pre-commit reviewing easily
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 10
How did it go initially?
! #wins ! Average time to do a merge went down to about an hour
! Fewer conflicts ! Apply a fix to multiple branches now takes a minute
! No longer a manual process ! #fails
! Had to rethink our initial branching strategy ! More on this later
! Challenging for developers working on older and newer releases at the same time ! Resolved once older releases went away
! Learning curve for git tools ! Took around 6 months before team was really proficient
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 11
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 12
What have we gained?
Pull Requests!
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 13
Advantages of Pull Requests
! More natural approach to pre-commit code reviewing ! Uses git forks to enable pushing commits up to main
repository ! Enables true two-way peer review
! Inline commenting ! Can directly track submitter and reviewer ! Easy for submitter to update pull request
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 14
New initiatives due to Pull Requests
! Open+ Developer Program ! Enables our VAR and ISV partners to have direct access to
the Sugar codebase. ! They can contribute fixes directly to us that we can review
and accept into the product ! Community Branch
! Allows our community members to make pull requests against our open source version, that we pull into the product
! Both initiatives has resulted in over 100 code contributions over the last year, over 5x as much as the previous year.
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 15
Change in branching strategy
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 16
What we did back in SVN
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 17
Now what we can do with git
! Feature branches that aren’t painful to merge ! Bug fix dumping ground branch that we can pull fixes
from to build maintenance releases
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 18
Git branching strategy
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 19
Takeaways
! Git solved the scalability needs that Subversion didn’t ! Enables more distributed development with less integration
time ! Allows us to define our branching strategy less around the
tool and more around the process ! Moving to Git without migrating old commits was a
#win ! Unshackled us from the SVN paradigm of the past
! GitHub is a kick butt tool ! Provides tools to make code reviews better and fit more into
the natural flow of development ! Easily enables community around your codebase
1/25/12 ©2011 SugarCRM Inc. All rights reserved. 20
Questions?
©2011 SugarCRM Inc. All rights reserved.