Subversion in a  Distributed World
About Me <ul><li>Lorna Mitchell
PHP Developer/Trainer/Consultant at Ibuildings
Host of Dutch PHP Conference 2010
Active with PHPWomen.org
Organiser at PHPNW
Personal blog:  http://lornajane.net
Twitter: @lornajane </li></ul>
Source Control <ul><li>Keeping-place for code
Centralised or distributed
Project archive
Collaboration tool
Integration point </li><ul><li>for development
for business processes </li></ul></ul>
One True Way
 
The Products
Subversion (svn) Creator CollabNet URL Maintainer Apache Users PHP Sourceforge FreeBSD Apache Software Foundation License ...
Subversion: The Roapmap <ul><li>Taken from: </li><ul><li>http://lwn.net/Articles/381794/ </li></ul></ul>Subversion exists ...
Git Creator Linus Torvalds URL Maintainer Junio Hamano Users Linux kernel Ruby on Rails CakePHP Debian GNOME License GPL D...
Bazaar (bzr) Creator Martin Pool URL Maintainer Canonical Users Ubuntu MySQL Inkscape Squid License GPL Documentation Exce...
Mercurial (hg) Creator Matt Mackall URL Maintainer Matt Mackall Users Mozilla OpenOffice.org SymbianOS NetBeans License GP...
Features <ul><li>Atomic commits
File renames
Symbolic links
Pre/Post event hooks
Merge tracking
Tags
EOL conversions </li></ul>
Protocols <ul><li>Everything supports SSH and HTTP(S)
Distributed systems support email
Bazaar supports FTP
Git supports rsync </li></ul>
Centralised vs Distributed Source Control
Centralised Source Control
Centralised Source Control <ul><li>Traditional model
Subversion uses this
Other products can do it </li></ul>
Distributed Source Control
Distributed Source Control
Distributed Source Control <ul><li>Git, Bazaar and Mercurial are distributed
Many repositories
Move changes between any or all of these </li></ul>
Revisions vs Changes <ul><li>From a Joel Spolsky post: </li></ul>With distributed version control, the distributed part is...
Repo Structure: SVN <ul><li>Top level projects
Branches, tags and trunk
Can check out and commit at subdirectory level </li></ul>
Repo Structure: DVCS <ul><li>Separate repository per project
Can only check out the whole thing
Controlled at the top level
Can safely copy directories :) </li></ul>
Referring to Revisions <ul><li>svn:  whole repo increments with every change
git:  generates a SHA1, a 40 character hexadecimal string
bzr:  uses per branch incrementing revision numbers
hg:  sequential revision number AND unique changeset ID in a SHA1 </li></ul>
Git Hashing <ul><li>Every commit has an identifying hash
Hash is of commit and includes information about parent
Any change in any version is seen later, because parental hashes change
Upcoming SlideShare
Loading in...5
×

Subversion in a distributed world

9,560

Published on

This talk examines the features of SVN, Hg, Bzr and git and talks about how they are useful to different types of teams.

Published in: Technology
0 Comments
10 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
9,560
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
141
Comments
0
Likes
10
Embeds 0
No embeds

No notes for slide
  • Ibuildings is recruiting!
  • its about what works for you: your process your team your environment
  • subversion has been around longer, since 2000 the red bean book is free in digital format, or you can buy an actual book &amp;quot;Apache Subversion&amp;quot; as of February 2010
  • http://versioncontrolblog.com/comparison/Bazaar/Git/Mercurial/Subversion/index.html (source of the &amp;quot;terse&amp;quot; quote) uses commands unlike other source control systems&apos;
  • I had good experiences with their IRC channel
  • used by people I want to work for
  • Look out for SVN tags, they&apos;re just a copy
  • CVS: each file had incrementing number git: which can be abbreviated (tag to make this more readable/useful) hg: 40 chars of hex which can be abbreviated
  • NB Versions not equivalent!
  • also beanstalk, unfuddle corporations hosting their distributed systems here that can get very expensive very fast
  • With multiple repositories, the chances of losing data are much smaller. Can work offline Distribution scares businesses, since they like to control where their code goes Processes need to support use of more complicated tools Higher requirements for recruits or more training and support needed for teams
  • (and if you&apos;re still interested in git - stay for Travis&apos; talk!)
  • Subversion in a distributed world

    1. 1. Subversion in a Distributed World
    2. 2. About Me <ul><li>Lorna Mitchell
    3. 3. PHP Developer/Trainer/Consultant at Ibuildings
    4. 4. Host of Dutch PHP Conference 2010
    5. 5. Active with PHPWomen.org
    6. 6. Organiser at PHPNW
    7. 7. Personal blog: http://lornajane.net
    8. 8. Twitter: @lornajane </li></ul>
    9. 9. Source Control <ul><li>Keeping-place for code
    10. 10. Centralised or distributed
    11. 11. Project archive
    12. 12. Collaboration tool
    13. 13. Integration point </li><ul><li>for development
    14. 14. for business processes </li></ul></ul>
    15. 15. One True Way
    16. 17. The Products
    17. 18. Subversion (svn) Creator CollabNet URL Maintainer Apache Users PHP Sourceforge FreeBSD Apache Software Foundation License Apache/BSD style Documentation Excellent, more mature Red Bean Book
    18. 19. Subversion: The Roapmap <ul><li>Taken from: </li><ul><li>http://lwn.net/Articles/381794/ </li></ul></ul>Subversion exists to be universally recognized and adopted as an open-source, centralized version control system characterized by its reliability as a safe haven for valuable data; the simplicity of its model and usage; and its ability to support the needs of a wide variety of users and projects, from individuals to large-scale enterprise operations.
    19. 20. Git Creator Linus Torvalds URL Maintainer Junio Hamano Users Linux kernel Ruby on Rails CakePHP Debian GNOME License GPL Documentation &quot;terse&quot;, a lot of documentation for an unfamiliar system
    20. 21. Bazaar (bzr) Creator Martin Pool URL Maintainer Canonical Users Ubuntu MySQL Inkscape Squid License GPL Documentation Excellent! Aimed at beginners, UI designed to be intuitive
    21. 22. Mercurial (hg) Creator Matt Mackall URL Maintainer Matt Mackall Users Mozilla OpenOffice.org SymbianOS NetBeans License GPL Documentation Good, online book and command line help
    22. 23. Features <ul><li>Atomic commits
    23. 24. File renames
    24. 25. Symbolic links
    25. 26. Pre/Post event hooks
    26. 27. Merge tracking
    27. 28. Tags
    28. 29. EOL conversions </li></ul>
    29. 30. Protocols <ul><li>Everything supports SSH and HTTP(S)
    30. 31. Distributed systems support email
    31. 32. Bazaar supports FTP
    32. 33. Git supports rsync </li></ul>
    33. 34. Centralised vs Distributed Source Control
    34. 35. Centralised Source Control
    35. 36. Centralised Source Control <ul><li>Traditional model
    36. 37. Subversion uses this
    37. 38. Other products can do it </li></ul>
    38. 39. Distributed Source Control
    39. 40. Distributed Source Control
    40. 41. Distributed Source Control <ul><li>Git, Bazaar and Mercurial are distributed
    41. 42. Many repositories
    42. 43. Move changes between any or all of these </li></ul>
    43. 44. Revisions vs Changes <ul><li>From a Joel Spolsky post: </li></ul>With distributed version control, the distributed part is actually not the most interesting part. The interesting part is that these systems think in terms of changes, not in terms of versions
    44. 45. Repo Structure: SVN <ul><li>Top level projects
    45. 46. Branches, tags and trunk
    46. 47. Can check out and commit at subdirectory level </li></ul>
    47. 48. Repo Structure: DVCS <ul><li>Separate repository per project
    48. 49. Can only check out the whole thing
    49. 50. Controlled at the top level
    50. 51. Can safely copy directories :) </li></ul>
    51. 52. Referring to Revisions <ul><li>svn: whole repo increments with every change
    52. 53. git: generates a SHA1, a 40 character hexadecimal string
    53. 54. bzr: uses per branch incrementing revision numbers
    54. 55. hg: sequential revision number AND unique changeset ID in a SHA1 </li></ul>
    55. 56. Git Hashing <ul><li>Every commit has an identifying hash
    56. 57. Hash is of commit and includes information about parent
    57. 58. Any change in any version is seen later, because parental hashes change
    58. 59. Ensures consistency </li></ul>
    59. 60. Hashing: Branch 1 commit 69540cd8d2dda61424982d388976c2b3c95d4278 Author: Lorna <lorna@lornajane.net> Date: Sat Apr 17 20:56:03 2010 +0100 fixes coding standards compatibility commit 482fc8d3de1b523c6aa44d0f0a6b97ced9273499 Author: Lorna <lorna@lornajane.net> Date: Sat Apr 17 20:51:53 2010 +0100 creating the hello world file
    60. 61. Hashing: Branch 2 commit 24ab6108e42f7662cf32c14e0e707c5534dec47c Author: Lorna <lorna@lornajane.net> Date: Sat Apr 17 20:55:14 2010 +0100 extends greeting to universe commit 67681edee47744780010ecf9e085c0f097a32e11 Author: Lorna <lorna@lornajane.net> Date: Sat Apr 17 20:54:36 2010 +0100 formalises world greeting commit 482fc8d3de1b523c6aa44d0f0a6b97ced9273499 Author: Lorna <lorna@lornajane.net> Date: Sat Apr 17 20:51:53 2010 +0100 creating the hello world file
    61. 62. Hashing: Merged Changes commit baa58ead49d46ac10d360e9d83fd6603c0f57061 Author: Lorna <lorna@lornajane.net> Date: Sat Apr 17 20:56:03 2010 +0100 fixes coding standards compatibility commit 24ab6108e42f7662cf32c14e0e707c5534dec47c Author: Lorna <lorna@lornajane.net> Date: Sat Apr 17 20:55:14 2010 +0100 extends greeting to universe commit 67681edee47744780010ecf9e085c0f097a32e11 Author: Lorna <lorna@lornajane.net> Date: Sat Apr 17 20:54:36 2010 +0100 formalises world greeting commit 482fc8d3de1b523c6aa44d0f0a6b97ced9273499 Author: Lorna <lorna@lornajane.net> Date: Sat Apr 17 20:51:53 2010 +0100 creating the hello world file
    62. 63. http://www.flickr.com/photos/bensonkua/2543171151/ Cherry Picking
    63. 64. Cherry Picking Example $ git fetch origin remote: Counting objects: 5, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From /home/lorna/git_examples2/../git_examples 482fc8d..69540cd master -> origin/master $ git cherry-pick 69540cd8d2dda61424982d388976c2b3c95d4278
    64. 65. http://www.flickr.com/photos/_heiko/1907664495/ Local is FAST
    65. 66. Local Repo: Advantages <ul><li>Its FAST
    66. 67. Can see and diff against history while offline
    67. 68. Commit offline, then share these later </li></ul>
    68. 69. Tools
    69. 70. Building Bridges <ul><li>Bridge between SVN repo and local </li><ul><li>bzr-svn https://launchpad.net/bzr-svn
    70. 71. git-svn http://www.kernel.org/pub/software/scm/git/docs/git-svn.html </li></ul><li>Local distributed-style repo
    71. 72. Communicates with central SVN server
    72. 73. Pulls complete history </li><ul><li>diff, log fast and offline </li></ul><li>Work offline, commit later </li></ul>
    73. 74. bzr-svn: Setting the Scene <ul><li>Subversion repository
    74. 75. Standard svn checkout in subversion/
    75. 76. Bzr checkout in /lorna-repo/lorna-trunk
    76. 77. Branch of this in /lorna-repo/lorna-branch </li></ul>
    77. 78. bzr-svn: Adding Content with Bzr $ bzr commit -m &quot;initialising database files and hello.php&quot; Committing to: /home/lorna/.../lorna-repo/lorna-branch/ added db added hello.php added db/setup.sql Committed revision 2. $ bzr log ------------------------------------------------------------ revno: 2 committer: Lorna Mitchell <lorna@lornajane.net> branch nick: lorna-branch timestamp: Sun 2010-04-25 14:46:44 +0100 message: initialising database files and hello.php ------------------------------------------------------------ revno: 1 svn revno: 578 (on /lorna-test) committer: lorna timestamp: Sun 2010-04-25 12:02:32 +0000 message: New project for some source control examples
    78. 79. bzr-svn: Sending Changes to SVN $ bzr push ../lorna-trunk/ All changes applied successfully. Pushed up to revision 2. $ cd ../../subversion $ svn log --------------------------------------------------------------------- r579 | lorna | 2010-04-25 14:46:23 +0100 (Sun, 25 Apr 2010) | 1 line initialising database files and hello.php --------------------------------------------------------------------- r578 | lorna | 2010-04-25 14:02:32 +0100 (Sun, 25 Apr 2010) | 3 lines New project for some source control examples ---------------------------------------------------------------------
    79. 80. Changing State of the Landscape <ul><li>Talk proposed October 2009
    80. 81. Accepted December 2009
    81. 82. Immature tools the deal-breaker
    82. 83. Written March 2010
    83. 84. Tools now usable, and improving </li></ul>
    84. 85. Web Accessible <ul><li>All these tools are web browseable
    85. 86. Either natively or easily </li></ul>
    86. 87. Trac <ul><li>Trac now has integration for all these mentioned
    87. 88. Can hook in to update track from commits
    88. 89. Trac provides code browsing and understands source control </li></ul>
    89. 90. http://www.flickr.com/photos/rhk313/2741140421/ Tortoise
    90. 91. Tortoise <ul><li>TortoiseSVN - widely used windows gui </li><ul><li>http://tortoisesvn.tigris.org/ </li></ul><li>TortoiseBzr </li><ul><li>https://launchpad.net/tortoisebzr </li></ul><li>TortoiseGit </li><ul><li>http://code.google.com/p/tortoisegit/ </li></ul><li>TortoiseHg </li><ul><li>http://tortoisehg.bitbucket.org/ </li></ul></ul>
    91. 92. Code Hosting and Collaboration <ul><li>Provide repository space
    92. 93. Repo browsing, linked projects
    93. 94. Forums and mailing lists
    94. 95. Wiki (or similar: launchpad has blueprints)
    95. 96. Publish downloadable versions
    96. 97. Message other collaborators </li></ul>
    97. 98. Code Hosting Providers GitHub http://github.com/ git Bitbucket http://bitbucket.org/ hg Google Code http://code.google.com/ svn, hg Launchpad https://launchpad.net/ bzr SourceForge http://sourceforge.net/ svn, bzr, hg, git (and cvs)
    98. 99. Making Choices
    99. 100. Distributed Development <ul><li>Multiple repositories
    100. 101. Distribution is foreign to corporations
    101. 102. Processes are as important as tools
    102. 103. Learning curve </li></ul>
    103. 104. My Development Process <ul><li>Based on Subversion
    104. 105. Needs process on top of tools to use the best bits in a distributed setup
    105. 106. Single repo
    106. 107. All branches are available and shared
    107. 108. Everything is visible and backed up </li></ul>
    108. 109. Permissions <ul><li>SVN has very granular access control
    109. 110. Can use any of apache's mechanisms
    110. 111. Can path-restrict read access
    111. 112. Access control for DVCS mostly use hooks
    112. 113. What about access to cloned/forked repositories? </li></ul>
    113. 114. Cost of Transition <ul><li>Steeper learning curve
    114. 115. Implementation costs </li><ul><li>tool migration
    115. 116. process changes
    116. 117. supporting tool migration
    117. 118. user training (ongoing!) </li></ul><li>Hype and dismissive attitudes are unhelpful </li></ul>
    118. 119. A Read-only SVN Copy <ul><li>Common workaround
    119. 120. Read-only suversion repo
    120. 121. Holds latest changes on a nominated git repo
    121. 122. Tools can hook in
    122. 123. Users can svn:external to it </li></ul>
    123. 124. In My World <ul><li>Subversion has its place </li><ul><li>mature
    124. 125. great documentation and ecosystem
    125. 126. simple! </li></ul><li>What about managers, junior devs, designers, contractors? </li></ul>
    126. 127. One Recommendation
    127. 128. One Recommendation
    128. 129. One Recommendation
    129. 130. One Recommendation
    130. 131. One Recommendation
    131. 132. Team and Project <ul><li>Global team of expert geeks - use DCVS (any one)
    132. 133. Colocated team of mixed ability - use SVN
    133. 134. Everything else is a sliding scale!
    134. 135. Consider </li><ul><li>Your people
    135. 136. Your admins
    136. 137. The documentation, support and community of your chosen solution </li></ul></ul>
    137. 138. Choice
    138. 139. Thanks! <ul><li>http://joind.in/1598 </li></ul>
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×