32
Source Control Landscape Lorna Jane Mitchell PHP London, October 2010

The Source Control Landscape

Embed Size (px)

Citation preview

Page 1: The Source Control Landscape

Source ControlLandscape

Lorna Jane Mitchell

PHP London, October 2010

Page 2: The Source Control Landscape

About Me

Lorna Jane Mitchell Freelance PHP consultant/developer/trainer Speaker and Writer Based in Leeds, UK (in town for FOWA) Homepage: http://lornajane.net Twitter: @lornajane

Page 3: The Source Control Landscape

Source Control

Tool History Subversion The future: DVCS

Page 4: The Source Control Landscape

4

Subversion (svn)

Creator CollabNet

URL http://subversion.apache.org

Maintainer Apache

Users PHPSourceforgeFreeBSDApache Software Foundation

License Apache/BSD style

Documentation Excellent, more matureRed Bean Book

Page 5: The Source Control Landscape

5

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.

Page 6: The Source Control Landscape

6

Git

Creator Linus Torvalds

URL http://git-scm.com/

Maintainer Junio Hamano

Users Linux kernelRuby on RailsCakePHPDebianGNOME

License GPL

Documentation "terse", a lot of documentation for an unfamiliar system

Page 7: The Source Control Landscape

7

Bazaar (bzr)

Creator Martin Pool

URL http://bazaar.canonical.com/

Maintainer Canonical

Users UbuntuMySQLInkscapeSquid

License GPL

Documentation Excellent! Aimed at beginners, UI designed to be intuitive

Page 8: The Source Control Landscape

8

Mercurial (hg)

Creator Matt Mackall

URL http://mercurial.selenic.com/

Maintainer Matt Mackall

Users MozillaOpenOffice.orgSymbianOSNetBeans

License GPL

Documentation Good, online book and command line help

Page 9: The Source Control Landscape

9

Features Atomic commits File renames Symbolic links Pre/Post event hooks Merge tracking Tags EOL conversions

Page 10: The Source Control Landscape

10

Protocols Everything supports SSH and HTTP(S) Distributed systems support email Bazaar supports FTP Git supports rsync

Page 11: The Source Control Landscape

11

Centralised vs Distributed Source Control

Page 12: The Source Control Landscape

12

Centralised Source Control Traditional model Subversion uses this Other products can do it

Page 13: The Source Control Landscape

13

Centralised Source Control

Page 14: The Source Control Landscape

14

Distributed Source Control

Page 15: The Source Control Landscape

15

Distributed Source Control Same function as centralised source control Very different approach Steeper learning curve Key concepts

● local repositories● revisions● branching

Page 16: The Source Control Landscape

16

Local Repository

Clone a whole repo It's FAST Can commit without sharing Can rewrite history

Page 17: The Source Control Landscape

17

Snapshots vs Changesets 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

Page 18: The Source Control Landscape

Snapshots vs Changesets

Subversion commit is a snapshot of the codebase

For a DCVS, it's a set of changes Makes it easier to share changes Can be applied in different orders Cherry-picking

Page 19: The Source Control Landscape

Branching

Branches in DCVS are not just copies Working copy can switch between them Private branching

Page 20: The Source Control Landscape

The Social Aspect

Page 21: The Source Control Landscape

Hosted Code Solutions

Combat the complexity of DCVS Supporting tools e.g. GitHub

Page 22: The Source Control Landscape

22

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

Page 23: The Source Control Landscape

23

Code Hosting Providers

GitHubhttp://github.com/

git

Bitbuckethttp://bitbucket.org/

hg

Google Codehttp://code.google.com/

svn, hg

Launchpadhttps://launchpad.net/

bzr

SourceForgehttp://sourceforge.net/

svn, bzr, hg, git (and cvs)

Page 24: The Source Control Landscape

Tools and Choices

Page 25: The Source Control Landscape

Trac

Trac supports all mentioned products Code browsing Commit messages update issues

Page 26: The Source Control Landscape

GUI Tools

Moving target! Improving IDE support Tortoise* products Limited support for git on windows

Page 27: The Source Control Landscape

27

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

Page 28: The Source Control Landscape

Access Control

SVN has granular access control Can use various apache mechanisms Control access by path DCVS are much newer, access control uses

hooks Can control writes What about reads?

Page 29: The Source Control Landscape

29

Cost of Transition Steeper learning curve Implementation costs

● tool migration● process changes● supporting tool migration● user training (ongoing!)

Hype and dismissive attitudes are unhelpful

Page 30: The Source Control Landscape

30

Making Choices 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

Page 31: The Source Control Landscape

31

Any Questions?

Page 32: The Source Control Landscape

Thanks!

@lornajane

http://lornajane.net