Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Virtual Git Summit - Subversion to Git: A S...

John Mertic
February 01, 2012

The Virtual Git Summit - Subversion to Git: A Sugar Story

After many years of faithful use of Subversion as our version control system of choice, we found the need for something more flexible that could better scale with the many code trees we manage across our engineering organization. In this talk, I’ll talk about how using Subversion for version control wasn’t doing it for us anymore, the move to using Git and GitHub (and the challenges along the way), and the various wins we have gained as an engineering organization and with our partner and community developers.

John Mertic

February 01, 2012
Tweet

More Decks by John Mertic

Other Decks in Technology

Transcript

  1. 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
  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
  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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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