JavaEdge 2008: Your next version control system


Published on

The next generation of VCS has a clear target ahead of them: making branching and merging easier. Until recently, Subversion was dominating the world of Version Control Systems, but now, Distributed Version Control Systems are growing in popularity and everywhere you go you hear about Git or Mercurial, and how they make branching and merging a breeze. But the Subversion team isn't going down quietly, they have a new weapon: the 1.5 version. Learn about the next generation of Version Control Systems is planning to solve your problems.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

JavaEdge 2008: Your next version control system

  1. 1. 1<br />Your next Version Control System<br />Gilad Garon<br />December 18th 2008<br />
  2. 2. Agenda<br />Introduction<br />Branching<br />Merging<br />Subversion 1.5 <br />Distributed Version Control<br />2<br />
  3. 3. Introduction<br />What’s every VCS user worst nightmare?<br />Nope. It’s…<br />3<br />
  4. 4. Agenda<br />Introduction<br />Branching<br />Merging<br />Subversion 1.5 <br />Distributed Version Control<br />4<br />
  5. 5. Development Cycle <br />Our repository layout should behave like our development cycle:<br />Development Phase<br />Testing Phase<br />Release Final Product<br />Our VCS should accommodate us and not the other way, no matter what’s our development process.<br />5<br />
  6. 6. Single Development Line<br />One branch holds all phases of the develop cycle.<br />6<br />
  7. 7. Development Line with Support Line<br />7<br />Pros<br />Cons<br />
  8. 8. Development Line with Support Line<br />One branch holds our development code.<br />A second branch holds our production code for continued support.<br />8<br />
  9. 9. Development Line with Support Line<br />9<br />Pros<br />Cons<br />
  10. 10. Three Level Build<br />A classic layout for a three phase development cycle.<br />Release candidates are for the testing phase and support phase. <br />The production branch is sterile.<br />10<br />
  11. 11. Development Line with Support Line<br />11<br />Pros<br />Cons<br />
  12. 12. Multiple Feature Support Build #1<br />Feature branches allow for even more code separation on complex projects<br />12<br />
  13. 13. Multiple Feature Support Build #2<br />13<br /><ul><li>Release Candidates can be closed when development cycle is complete</li></li></ul><li>Development Line with Support Line<br />14<br />Pros<br />Cons<br />
  14. 14. Branching is good for you<br />Branches are great for code separation.<br />Branches are cheap<br />Branches are easy to createSo, what’s the catch?<br />15<br />
  15. 15. Agenda<br />Introduction<br />Branching<br />Merging<br />Subversion 1.5 <br />Distributed Version Control<br />16<br />
  16. 16. Merging<br />What the?!<br />Override everything!<br />Seems Familiar?<br />17<br />
  17. 17. Why merges are hard?<br />Requires knowledge of the code<br />Resolving conflicts by hand takes time<br />Large projects require some planning<br />Can cause logical bugs which aren’t easily detected<br />18<br />
  18. 18. Making merges easier<br />Merge daily!<br />Let the VCS do the merge for you<br />Don’t merge at the last minute, allocate merging time in your time table.<br />Keep tabs on your code, keep notes on your changes.<br />19<br />
  19. 19. Merge Tracking<br /><ul><li>Merge tracking means that the VCS remembers what was merged and when.
  20. 20. No more revision calculations
  21. 21. Cherry Pick your changes
  22. 22. See incoming changes
  23. 23. Refactor code without fear </li></ul>My Hero!<br />20<br />
  24. 24. Common Myths<br /><ul><li>Branching is easy?
  25. 25. Merges are hard?
  26. 26. Daily merges helps?
  27. 27. Automatic merges are dangerous?
  28. 28. Merging takes days of preparation?</li></ul>21<br />
  29. 29. Agenda<br />Introduction<br />Branching<br />Merging<br />Subversion 1.5<br />Distributed Version Control<br />22<br />
  30. 30. What’s New?<br />Merge tracking<br />Sparse checkouts<br />Interactive conflict resolution<br />Changelist support<br />Speed improvements, cancellation response improvements<br />Bug Fixes<br />23<br />
  31. 31. Merge Tracking<br />Create a branch<br />Work on your branch<br />Update your branch with trunk’s changes<br />svn copy -m "Creating a feature branch of /project-x/trunk."<br />svn checkout… work …svn commit - m “committing my work." <br />svn merge --- Merging r20 through r45 into '.': U <br />24<br />
  32. 32. Merge Tracking<br />What has been merged so far?<br />Which changes are available from trunk? <br />svn propget svn:mergeinfo . /trunk:20-45<br /># or <br />svn mergeinfo r20r21…r44r45<br />svn mergeinfo --show-revs eligible r46r47<br />25<br />
  33. 33. Merge Tracking<br />Merging back your branch:<br />What’s the catch? <br />No support for renames moves<br />Mergeinfo is sometimes generated when no merge was done<br />$ cd /workspace/project-x/trunk$ svn merge --reintegrate Merging differences between repository URLs into '.': … changes list …# build, test, verify, ... $ svn commit -m “Merging feature-z back into trunk!" <br />26<br />
  34. 34. More New Features<br />Sparse checkouts<br />Interactive conflict resolution<br />Changelist support<br />$ svn checkout URI --depth=[empty,files,immediates,infinity]# command support - checkout, switch, update, status, info<br />$ svn up U project-x/trunk/GridView.javaConflict discovered in 'project-x/trunk/'.Select: (p) postpone, (df) diff-full, (e) edit, (s) show all options:<br />$ svn changelist bug-fix-1 GridView.javaPath '' is now a member of changelist 'bug-fix-1'.$ svn status --- Changelist ‘bug-fix-1': M<br />27<br />
  35. 35. Upgrading to Subversion 1.5 Server <br />Backup everything<br /> Install Subversion 1.5 Server<br />Upgrade existing repositories with:<br />Populate indexes (Optional):<br />Upgrade clients<br />Pray to god<br />28<br />$ svnadmin upgrade REPOS_PATH<br />$ svn-populate-node-origins-index REPOS-PATH<br />
  36. 36. TortoiseSVN 1.5<br />29<br />TortoiseSVN is upgraded to support Subversion 1.5<br />The Merge process is simplified and merge tracking is supported<br />The repository now more resembles the Windows explorer<br />Changelist support is supported<br />Hook Scripts and Issue Trackers are supported<br />
  37. 37. TortoiseSVN 1.5 Merge<br />30<br />
  38. 38. New Feature Compatibility Table<br />31<br />
  39. 39. Agenda<br />Introduction<br />Branching<br />Merging<br />Subversion 1.5 <br />DistributedVersion Control<br />32<br />
  40. 40. What is DVCS?<br />Distributed VCS does NOT mean the physical distribution of the repository over several machines.<br />Distributed VCS means the repository is located on your machine.<br />33<br />
  41. 41. Terminology<br />In DVCS we…<br />Do not check out from the repository, we clonethe repository.<br />Do not update our working copy, we pullchanges from other repositories.<br />Do not check in our changes,we pushchanges to other repositories.<br />34<br />
  42. 42. Advantages<br />You are the repository<br />Performance, no network overhead.<br />Work offline, work where ever you want.<br />Experiment, no commit rights required.<br />Local Commits, the repository is in your workspace.<br />Flexible repository topology<br />35<br />
  43. 43. Disadvantages<br />But…<br />Sparse checkouts are not fully supported if at all.<br />Most vendors do not support branching, you must clone.<br />Merge Tracking needs to mature a bit.<br />More suited to Open Source projects than commercial.<br />36<br />
  44. 44. Centralized Workflow<br />37<br />
  45. 45. Decentralized Workflow<br />38<br />
  46. 46. Decentralized with shared mainlineWorkflow<br />39<br />
  47. 47. Decentralized with GatekeeperWorkflow<br />40<br />
  48. 48. Git<br /><ul><li>Project started on April 2005
  49. 49. Invented by Linus Torvalds to replace BitKeeper
  50. 50. Toolkit design
  51. 51. Used in - Linux Kernel, VLC, Ruby On Rails, Fedora, Android
  52. 52. IDE Support - Eclipse, NetBeansIntelliJ (Native)</li></ul>Subversion is the devil, use Git.<br />41<br />
  53. 53. Git Shell<br />42<br />
  54. 54. Gitk<br />43<br />
  55. 55. Git Pros & Cons<br />44<br />Pros<br />Cons<br />
  56. 56. Bazaar<br /><ul><li>Project started on March 2005
  57. 57. Started as a branch of Arch
  58. 58. Sponsored by Canonical (Ubuntu)
  59. 59. Used in - Ubuntu, MySQL, Drupal, APT, Linux Foundation
  60. 60. IDE Support - Eclipse, IntelliJ (Native)</li></ul>45<br />
  61. 61. Tortoise Bazaar<br />46<br />
  62. 62. Bazaar Pros & Cons<br />47<br />Pros<br />Cons<br />
  63. 63. Mercurial<br /><ul><li>Project started on April 2005
  64. 64. Very Similar to Subversion
  65. 65. Adopted by Sun Microsystems
  66. 66. Used in - Mozilla, NetBeans, OpenJDK, OpenSolaris
  67. 67. IDE Support - Eclipse, NetBeans,IntelliJ</li></ul>48<br />
  68. 68. Mercurial Serve<br />49<br />
  69. 69. Tortoise Mercurial<br />50<br />
  70. 70. Mercurial Pros & Cons<br />51<br />Pros<br />Cons<br />
  71. 71. Comparison<br />52<br />
  72. 72. Conclusion<br />And the Winner is?<br />Experiment with the tools<br />Choose the tool which works with your workflow<br />53<br />
  73. 73. References<br />Subversion<br />Home Page:<br />Tortoise:<br />SVNKit:<br />Eclipse Plug-in:<br />NetBeans Plug-in:<br />Git<br />Home Page:<br />msysgit (Git Windows) :<br />Eclipse Plug-in:<br />NetBeans Plug-in:<br />54<br />
  74. 74. References<br />Mercurial<br />Home Page:<br />TortoiseHG:<br />Eclipse Plug-in:<br />Bazaar<br />Home Page:<br />IDE Plug-ins:<br />55<br />
  75. 75. Thank <br />You !<br />56<br />