Subversion in a distributed world
Upcoming SlideShare
Loading in...5
×
 

Subversion in a distributed world

on

  • 10,726 views

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

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

Statistics

Views

Total Views
10,726
Views on SlideShare
9,416
Embed Views
1,310

Actions

Likes
8
Downloads
139
Comments
0

4 Embeds 1,310

http://www.lornajane.net 1186
http://www.slideshare.net 122
http://beta.lornajane.net 1
http://translate.googleusercontent.com 1

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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 "Apache Subversion" as of February 2010
  • http://versioncontrolblog.com/comparison/Bazaar/Git/Mercurial/Subversion/index.html (source of the "terse" quote) uses commands unlike other source control systems'
  • I had good experiences with their IRC channel
  • used by people I want to work for
  • Look out for SVN tags, they'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're still interested in git - stay for Travis' talk!)

Subversion in a distributed world Subversion in a distributed world Presentation Transcript

  • Subversion in a Distributed World
  • About Me
    • 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
  • Source Control
    • Keeping-place for code
    • Centralised or distributed
    • Project archive
    • Collaboration tool
    • Integration point
      • for development
      • for business processes
  • One True Way
  •  
  • The Products
  • 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
  • Subversion: The Roapmap
    • Taken from:
      • http://lwn.net/Articles/381794/
    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.
  • Git Creator Linus Torvalds URL Maintainer Junio Hamano Users Linux kernel Ruby on Rails CakePHP Debian GNOME License GPL Documentation "terse", a lot of documentation for an unfamiliar system
  • 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
  • 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
  • Features
    • Atomic commits
    • File renames
    • Symbolic links
    • Pre/Post event hooks
    • Merge tracking
    • Tags
    • EOL conversions
  • Protocols
    • Everything supports SSH and HTTP(S)
    • Distributed systems support email
    • Bazaar supports FTP
    • Git supports rsync
  • Centralised vs Distributed Source Control
  • Centralised Source Control
  • Centralised Source Control
    • Traditional model
    • Subversion uses this
    • Other products can do it
  • Distributed Source Control
  • Distributed Source Control
  • Distributed Source Control
    • Git, Bazaar and Mercurial are distributed
    • Many repositories
    • Move changes between any or all of these
  • Revisions vs Changes
    • From a Joel Spolsky post:
    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
  • Repo Structure: SVN
    • Top level projects
    • Branches, tags and trunk
    • Can check out and commit at subdirectory level
  • Repo Structure: DVCS
    • Separate repository per project
    • Can only check out the whole thing
    • Controlled at the top level
    • Can safely copy directories :)
  • Referring to Revisions
    • 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
  • Git Hashing
    • 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
    • Ensures consistency
  • 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
  • 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
  • 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
  • http://www.flickr.com/photos/bensonkua/2543171151/ Cherry Picking
  • 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
  • http://www.flickr.com/photos/_heiko/1907664495/ Local is FAST
  • Local Repo: Advantages
    • Its FAST
    • Can see and diff against history while offline
    • Commit offline, then share these later
  • Tools
  • Building Bridges
    • Bridge between SVN repo and local
      • bzr-svn https://launchpad.net/bzr-svn
      • git-svn http://www.kernel.org/pub/software/scm/git/docs/git-svn.html
    • Local distributed-style repo
    • Communicates with central SVN server
    • Pulls complete history
      • diff, log fast and offline
    • Work offline, commit later
  • bzr-svn: Setting the Scene
    • Subversion repository
    • Standard svn checkout in subversion/
    • Bzr checkout in /lorna-repo/lorna-trunk
    • Branch of this in /lorna-repo/lorna-branch
  • 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
  • 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 ---------------------------------------------------------------------
  • Changing State of the Landscape
    • Talk proposed October 2009
    • Accepted December 2009
    • Immature tools the deal-breaker
    • Written March 2010
    • Tools now usable, and improving
  • Web Accessible
    • All these tools are web browseable
    • Either natively or easily
  • Trac
    • Trac now has integration for all these mentioned
    • Can hook in to update track from commits
    • Trac provides code browsing and understands source control
  • http://www.flickr.com/photos/rhk313/2741140421/ Tortoise
  • Tortoise
    • TortoiseSVN - widely used windows gui
      • http://tortoisesvn.tigris.org/
    • TortoiseBzr
      • https://launchpad.net/tortoisebzr
    • TortoiseGit
      • http://code.google.com/p/tortoisegit/
    • TortoiseHg
      • http://tortoisehg.bitbucket.org/
  • Code Hosting and Collaboration
    • Provide repository space
    • Repo browsing, linked projects
    • Forums and mailing lists
    • Wiki (or similar: launchpad has blueprints)
    • Publish downloadable versions
    • Message other collaborators
  • 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)
  • Making Choices
  • Distributed Development
    • Multiple repositories
    • Distribution is foreign to corporations
    • Processes are as important as tools
    • Learning curve
  • My Development Process
    • Based on Subversion
    • Needs process on top of tools to use the best bits in a distributed setup
    • Single repo
    • All branches are available and shared
    • Everything is visible and backed up
  • Permissions
    • SVN has very granular access control
    • Can use any of apache's mechanisms
    • Can path-restrict read access
    • Access control for DVCS mostly use hooks
    • What about access to cloned/forked repositories?
  • Cost of Transition
    • Steeper learning curve
    • Implementation costs
      • tool migration
      • process changes
      • supporting tool migration
      • user training (ongoing!)
    • Hype and dismissive attitudes are unhelpful
  • A Read-only SVN Copy
    • Common workaround
    • Read-only suversion repo
    • Holds latest changes on a nominated git repo
    • Tools can hook in
    • Users can svn:external to it
  • In My World
    • Subversion has its place
      • mature
      • great documentation and ecosystem
      • simple!
    • What about managers, junior devs, designers, contractors?
  • One Recommendation
  • One Recommendation
  • One Recommendation
  • One Recommendation
  • One Recommendation
  • Team and Project
    • Global team of expert geeks - use DCVS (any one)
    • Colocated team of mixed ability - use SVN
    • Everything else is a sliding scale!
    • Consider
      • Your people
      • Your admins
      • The documentation, support and community of your chosen solution
  • Choice
  • Thanks!
    • http://joind.in/1598