3. DVCS: Making the Move?
How Atlassian can help...
Matthew Watson
FishEye/Crucible Team Lead, Atlassian
2
4. Why DVCS?
• Lots of people excited by it
• Huge in Open Source
• But what about Commercial in-house development?
• What about the costs of migrating?
3
5. What’s Great about DVCS?
• Work offline
• Easier branching and merging
• Github and Bitbucket
• Do we really need this?
4
7. What’s really cool about DVCS!
• What does ‘D’ in DVCS stand for?
• Distributed
• Commit often, push when ready
• Fast, peer-to-peer, no central server
• Flexibility: Clones vs Branches
5
8. What’s really cool about DVCS?
• What should the ‘D’ in DVCS
stand for?
6
9. What’s really cool about DVCS?
• What should the ‘D’ in DVCS
stand for?
• DAG = Directed Acyclic Graph
Time
• No loops
• Each commit has 1 or more parents
• Commits uniquely identified
6
17. DAG Commits
Bob
38:fb38fed187ab A.java
39:bb0760b60a8b
9
18. DAG Commits
Bob
38:fb38fed187ab A.java
39:bb0760b60a8b
Mary
B.java
40:d0f08ba891a0
9
19. DAG Commits
Bob
38:fb38fed187ab A.java
39:bb0760b60a8b
Mary
B.java
40:d0f08ba891a0
Will
C.java
41:38ff647618b5
9
20. DAG Commits
Bob
38:fb38fed187ab A.java
39:bb0760b60a8b
Mary
B.java
40:d0f08ba891a0 42:7d0e20243949
Will
C.java
41:38ff647618b5
9
21. DAG Commits
Bob
38:fb38fed187ab A.java
39:bb0760b60a8b
Mary
B.java
40:d0f08ba891a0 42:7d0e20243949
Will
C.java
41:38ff647618b5 43:5fcdd3657717
9
22. The Power of the DAG
• Deterministic
• Annotate/blame works!
• Easy and powerful merges - Don’t be scared of long
running branches!
• Easy and powerful branching
10
23. Traceability
• In SVN/CVS etc merges hide
what happened
Time
• In DVCS, the DAG lets you see
exactly what changed
11
25. Workflows, Workflows, Workflows
• Which workflow to use?
• “With Great Power there must also come - Great
Responsibility!” - Spider Man?
• Take your time!
13
26. Feature Branching
• Branching and merging cheap
and easy
Time
• All feature work done on branch
• Can merge to any descendant
14
34. Cross Branch Dependencies
• Can merge to any downstream branch
• Easily merge fixes for releases into
subsequent versions
• Also works for feature branches
• Our code is naturally becoming more
stable
16
35. Migrating to DVCS
• Which DVCS?
• Small team - just go for it!
• Large team - Don’t Fu$%! your devspeed!
• Our goal - Zero downtime
17
36. Sync from SVN
• Git SVN and HgSubversion
• Incremental conversion
• Remap Committers
• mwatson = Matthew Watson <mwatson@atlassian.com>
• Build Processes
18
37. Use Continuous Integration!
• Vital part of dev cycle
• Run same builds against old
and new VCS
• Continuous Validation
19
39. Use Crucible!
• Code reviews against
DVCS Commits
• Developers get used
to the new way
• New Commit ids
• Committers map to
Users
21
40. Make the Switch
• Setup Clones and IDE’s before hand
• Make SVN read-only
• Go DVCS!
22
41. DVCS is Awesome!
• More power = more opportunity to do things faster!
• The DAG gives traceability, powerful branching
and merging, speed
• Migrating is easy!
@mattw_watson #summit11
23
Intro: \nAdvantages of DVCS (git & hg/mercurial) compared to Traditional VCS\nWhat we&#x2019;ve learned about DVCS\nOptions for migrating and our migration\nEnd up thinking migrating to DVCS is awesome idea\nDrop nuggets along the way\n?What VCS&#x2019;s using now?\n?Migrated? Thinking of Migrating?\n
Momentum\n
What do we know is good?\nWork Offline (local commits), easy to create new repo, faster\nEasier branching and merging &#x201C;apparently&#x201D;: Who branches in SVN?\nforks, pull request, OS stuff - new models\n
Distributed:\npush when you want - commit often\ncreate local repos, push to others\nfast, fast history\ndefine clones?\nclones or branches, more flexibility - new workflows (more later)\nNothing compelling yet?\n
* Important: This is what we discovered\n* SVN/CVS: Linear, concurrent changes\n* DAG: Commits built on parent commits - uniquely identified - new commits made by one author only - concurrent commits are merged\n* demonstrate\n
* Linear\n* Overlap unintentionally\n
* Linear\n* Overlap unintentionally\n
* Linear\n* Overlap unintentionally\n
Unintended state\nCI was invented to deal with this\n
Contrast to in SVN, changes made at same time, but appear as logical progression\nDVCS: Commits build on a known state\n
Contrast to in SVN, changes made at same time, but appear as logical progression\nDVCS: Commits build on a known state\n
Contrast to in SVN, changes made at same time, but appear as logical progression\nDVCS: Commits build on a known state\n
Contrast to in SVN, changes made at same time, but appear as logical progression\nDVCS: Commits build on a known state\n
Contrast to in SVN, changes made at same time, but appear as logical progression\nDVCS: Commits build on a known state\n
Lots of merges: yes, but deliberate, tracked, only merge a change once! \nMerging: very powerful - track copies/moves - long running refactoring\nCan &#x201C;branch&#x201D; at any point - each concurrent commit IS a branch - merge to any descendant\n\n
Graph Queries, 20% JIRA integration\nPause\n
distributed nature + DAG = lots of options\nNo-one tells you which one is best!\n\n
Stay with what you know - mimic SVN workflow\n get used to whats possible - devs will experiement\n adapt slowly\n\n
Us: Started using branching -> release & feature branching (all work on releases like this!)\nBranch from earliest common point you might want to merge to\n\n
Review->Build (BB3.1, 20% project)->complete merge/fixVersion & close JIRA\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Review->Build (BB3.1, 20% project)\nFeature branch balance - size - life time - naturally evolve - big work - integrate from stable\n
Works for feature branches too\nDid this on SVN, but as mentioned already - merges only merge new stuff & Traceability\nFeature Branches: can merge to others before integrated to stable\n\n
Options: All in one or gradual\n
Git SVN and HgSubversion allow you to work on a SVN repository using git/hg as a client - also used for converting\nCan pull at will - by setting up a cron job, can continuously pull changes into git/hg - then push them to your hosting service (github/bitbucket)\nCan also remap committer names, exclude file paths, more info on our blogs.\nMigrate any build/release/test processes that rely on the VCS\n\n
\n
RSS feeds of changes, activity streams, URL to changes, Search, Commit Graph\n Get Used to Commit hashes etc.\n
Start doing code reviews against synced DVCS\nDifferences\nEngage developers\n
we very happy, devs sceptical, but now all see benefits\n
Convinced you there is more to DVCS than you might have thought\n