Apidays New York 2024 - The value of a flexible API Management solution for O...
Distributed Versioning Tools, BeJUG 2010
1. Craft In Development
DVCS in practice
JoVoordeckers
jo.voordeckers@pursuit.be
@jovoordeckers
blog.pursuit.be
Louis Jacomet
ljacomet@gmail.com
@ljacomet
2. Craft In Development
Agenda
‣ Why revision control
‣ DVCS explained
‣ Workflows and practices
‣ What DVCS bring
‣ DVCS Compared
‣ Tools & plugins
‣ Project hosting
‣ Q & A
3. Craft In Development
About: Louis Jacomet
‣ 2002 - 2009 - Consultant at Axen
‣ 2009 - Freelance at Craft In Development
‣ Relevant experiences:
‣ Banking 2005 - 2008
‣ Migration of repository from Harvest to SVN => Happy Users!
‣ Administration of SVN, including branching and merging strategies
‣ Tried different ways of structuring workflow with branches, reviews,
gates in a team of up to 30 developers where quality was an issue
=> Unhappy Admin in search of a better world
‣ Git user ( mostly in front of SVN) for about a year
4. Craft In Development
About: Jo Voordeckers
‣ 2002 .. 2005 - Partner at Imagine-IT
‣ 2006 .. 2007 - Senior Software Engineer at Dolmen
‣ 2007 .. 2008 - Technical Project Leader at Dolmen
‣ 2008 - Founded Pursuit Consulting
‣ Java and RIA development contracting & consultancy
‣ iPhone developer: 1 commercial app in the store
‣ User of Mercurial (6 months), SVN (3 years) and CVS (5 years)
‣ Speaker at:
‣ JavaOne, Devoxx, BeJUG, IT Works, SAI
6. Craft In Development
Why revision control
‣ Tracks history and evolution of software projects
‣ Recover from mistakes
‣ Work on multiple product versions in parallel (prod, features, ...)
‣ (Consistent file set)
‣ Synchronize with collaborators
‣ Backup
‣ Common versioning systems
‣ RCS, CVS, SVN
‣ ClearCase, Perforce, TeamFoundation Server
27. Craft In Development
DVCS Sweet spot
‣ A lot faster (10 to 150x)
‣ Very scalable (developers and repo size)
‣ History searching and filtering
‣ Cheap branching, near-instant switching
‣ Effortless merges
‣ Works off-line
‣ As many backups as users (clones) from the central repository
‣ Flexible developer workflow
‣ (Import existing CVS, SVN, … repositories with entire history)
‣ (Metadata is stored in a single .hg or .git folder)
30. Craft In Development
Internal workflows
‣ Trunk for development or stable only?
‣ Feature branches
‣ Yes or No?
‣ Short or long lived?
‣ Multiple versions
‣ Tags only or branches and hot fixes standard?
‣ How to make sure a fix is everywhere?
‣ Commits
‣ Anyone anytime or reviews and green light?
31. Craft In Development
Firm and soft branches
release 1
release 2
Trunk
Feat A
Feat A’
F
i
r
m
S
o
f
t
32. Craft In Development
DVCS and workflows
‣ Internal workflows
‣ All supported
‣ Distributed workflows
‣ Personnal workflow
‣ Merge or rebase
36. Craft In Development
Distributed workflows
Dictator Blessed
Lieutenant
Lieutenant
Developer Developer Developer Developer
Adapted from http://http://whygitisbetterthanx.com/
37. Craft In Development
Personal workflow
‣ Your choice
‣ Multiple options available
‣ Allows committing on parallel tasks isolated
‣ Commit is no longer public by default
‣ Choose what goes public
‣ Original workflow
‣ Sanitized workflow
44. Craft In Development
Git vs Hg
Native code (faster) Python + native code
Linux and MacOS supported
msysgit or Cygwin on Windows
All platforms
easy server on Linux/MacOS
server requires work on Windows
“hg serve” allows serving from
any platform easily
GitX on Mac MacHG
IntelliJ, (Eclipse), (Netbeans) Netbeans, Eclipse, IntelliJ 9
45. Craft In Development
Git vs Hg
Infers rename/copy by history “hg copy”, “hg rename”
Based on similarity of file content “hg addremove -s”, can also infer
Very good SVN integration,
incompatible with git sharing
SVN integration
Many commands, strange params
Easier to learn, commands match
SVN
Terse manpage doc, improved over
time
Quality and modern docs
Commits identified by SHA1 only
Local human readable ID, global
SHA1
46. Craft In Development
Git vs Hg
Unlimited parents merge Only 2-way merge
Periodic “git-gc” auto or on demand No maintenance
Private branch namespace + mapping Shared branch namespace
Private user makes public Public history by default
Can destroy history on demand Immutable history,
History usually still accessible except “hg rebase”
Prune to fully delete, explicit
49. Craft In Development
Finding a revision with bisect
‣ Binary search for a commit
‣ Can be scripted for a fully
automated search
50. Craft In Development
Git as SVN front-end
‣ Fully clone a SVN repository - might take some time
‣ Full clone of a sub project inside the repository supported
‣ Init and fetch only part of history
‣ Take only a specific path (trunk, a branch, ...)
‣ Note: quite hard to fetch later earlier commits
‣ Daily work
‣ rebase to maintain linear history for commits pushed back
‣ Git does not track directories, so it will not send remove dirs to SVN
‣ enabled through --rmdir
51. Craft In Development
References
‣ Mercurial
‣ HG Intro - http://hginit.com/
‣ Small project workflow - http://petevidler.com/series/mercurial/
‣ HG book - http://hgbook.red-bean.com/
‣ GIT
‣ GIT Community book - http://book.git-scm.com/
‣ Pro GIT book - http://progit.org/
‣ Google’s Analysis - http://code.google.com/p/support/wiki/DVCSAnalysis
‣ http://betterexplained.com/articles/a-visual-guide-to-version-control/