SlideShare a Scribd company logo
Version Control –Version Control –
Patterns & PracticesPatterns & Practices
Chris OldwoodChris Oldwood
ACCU Conference 2014ACCU Conference 2014
@chrisoldwood / gort@cix.co.uk@chrisoldwood / gort@cix.co.uk
Pending CommitsPending Commits
 ArchitecturesArchitectures
 WorkspaceWorkspace
 BranchingBranching
 MergingMerging
 CommittingCommitting
 BuildingBuilding
 LabellingLabelling
 ArchaeologyArchaeology
ArchitecturesArchitectures
SourceSafe + Robocopy = DVCSSourceSafe + Robocopy = DVCS

NAS
(VSS)
Desktop
(VSS)
Laptop
(VSS)
Office
(VSS)
ROBOCOP
Y
Check-In
WorkspaceWorkspace
BranchingBranching
Integration/Development BranchIntegration/Development Branch
1 2 3 4 5
Release BranchRelease Branch
3 4 5 6 7
A B
Stable
Volatile
Feature/Task/Private BranchFeature/Task/Private Branch
3 4 5 6 7
A B C
More Stable
More Volatile
ShelvingShelving
1 2 3
ShelvingShelving
1 2 4 5 6
3
No Branch (Feature Toggles)No Branch (Feature Toggles)
1a 2 1b 3 1c
Always Ready to Ship
MergingMerging
Integration PainsIntegration Pains
3 4 5 6 7
X Y Z
A B
Cherry PickingCherry Picking
3 4 5 6 7
A CB
CommittingCommitting
BuildingBuilding
Gatekeeper WorkflowsGatekeeper Workflows
3 4 5 6 7
X Y
B
Alice
Bob
C
GK
Z
D
LabellingLabelling
Branching From a LabelBranching From a Label
3 4 5 6 7
A B
v1 X Y
v1.1
ArchaeologyArchaeology
LiteratureLiterature
Questions?Questions?
Blog:Blog:
http://chrisoldwood.blogspot.comhttp://chrisoldwood.blogspot.com
@chrisoldwood / gort@cix.co.uk@chrisoldwood / gort@cix.co.uk

More Related Content

PPT
Waltzing with Branches [Agile o/t Beach]
PPT
Waltzing with Branches [ACCU]
PPTX
Feature toggles
PDF
DataOps for the Modern Data Warehouse on Microsoft Azure @ NDCOslo 2020 - Lac...
PDF
Microservices and Friends
PDF
Dualtec Open Stack Meeting: Agilidade + Cloud
PDF
Building a modern SaaS in 2020
PDF
Consistent Development Environment with Vagrant and Chef
Waltzing with Branches [Agile o/t Beach]
Waltzing with Branches [ACCU]
Feature toggles
DataOps for the Modern Data Warehouse on Microsoft Azure @ NDCOslo 2020 - Lac...
Microservices and Friends
Dualtec Open Stack Meeting: Agilidade + Cloud
Building a modern SaaS in 2020
Consistent Development Environment with Vagrant and Chef

Similar to Version Control - Patterns and Practices (20)

PDF
Topics in Verification: Reuse, Coverage, Regression Engineering, Planning, Qu...
KEY
Why Architecture in Web Development matters
PDF
Continuous Integration and Deployment Best Practices on AWS
PDF
Continuous Delivery and Zero Downtime: What your architecture needs to succeed
PDF
Kubo (Cloud Foundry Container Platform): Your Gateway Drug to Cloud-native
PDF
Kubo (Cloud Foundry Container Platform): Your Gateway Drug to Cloud-native
PPTX
Lessons learned from migrating a legacy web app to azure
PDF
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
PDF
Microsoft SQL Server Testing Frameworks
PPTX
Tech huddle paas_session
PDF
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
PDF
DevOps Note
PDF
quality_forum
DOC
Alejandro_Laverdet - EN
PDF
Spryker meetup-distribute-your-spryker-deployment-with-docker-and-kubernetes
PPT
SQL Server 2008 Integration Services
PPTX
X-celerate 2019: Iterating fast with the MERN Stack
PDF
Switching SaaS Hosting From dedicated virtual machines to container-based clu...
PDF
Progressive Deployment & NoDeploy
PDF
Docker Enables DevOps
Topics in Verification: Reuse, Coverage, Regression Engineering, Planning, Qu...
Why Architecture in Web Development matters
Continuous Integration and Deployment Best Practices on AWS
Continuous Delivery and Zero Downtime: What your architecture needs to succeed
Kubo (Cloud Foundry Container Platform): Your Gateway Drug to Cloud-native
Kubo (Cloud Foundry Container Platform): Your Gateway Drug to Cloud-native
Lessons learned from migrating a legacy web app to azure
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
Microsoft SQL Server Testing Frameworks
Tech huddle paas_session
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
DevOps Note
quality_forum
Alejandro_Laverdet - EN
Spryker meetup-distribute-your-spryker-deployment-with-docker-and-kubernetes
SQL Server 2008 Integration Services
X-celerate 2019: Iterating fast with the MERN Stack
Switching SaaS Hosting From dedicated virtual machines to container-based clu...
Progressive Deployment & NoDeploy
Docker Enables DevOps
Ad

More from Chris Oldwood (14)

PPTX
The __far* Side
PPTX
Monolithic Delivery
PPTX
A Test of Strength
PPT
In The Toolbox - LIVE!
PPT
Test-Driven SQL
PPT
Continuous Delivery
PPT
Becoming a Bitter Programmer
PPT
Using xUnit as a Swiss-Aarmy Testing Toolkit
PPT
xUnit Style Database Testing
PPT
Robust Software
PPT
Requiem (For Windows XP)
PPT
(Re)Reading the Classics
PPT
Recycle Bin 101
PPT
The Art of Code
The __far* Side
Monolithic Delivery
A Test of Strength
In The Toolbox - LIVE!
Test-Driven SQL
Continuous Delivery
Becoming a Bitter Programmer
Using xUnit as a Swiss-Aarmy Testing Toolkit
xUnit Style Database Testing
Robust Software
Requiem (For Windows XP)
(Re)Reading the Classics
Recycle Bin 101
The Art of Code
Ad

Recently uploaded (20)

PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
ISO 45001 Occupational Health and Safety Management System
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
ai tools demonstartion for schools and inter college
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Digital Strategies for Manufacturing Companies
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Transform Your Business with a Software ERP System
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPT
Introduction Database Management System for Course Database
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
ISO 45001 Occupational Health and Safety Management System
CHAPTER 2 - PM Management and IT Context
ai tools demonstartion for schools and inter college
How to Choose the Right IT Partner for Your Business in Malaysia
Digital Strategies for Manufacturing Companies
Upgrade and Innovation Strategies for SAP ERP Customers
Design an Analysis of Algorithms II-SECS-1021-03
Transform Your Business with a Software ERP System
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
How to Migrate SBCGlobal Email to Yahoo Easily
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Navsoft: AI-Powered Business Solutions & Custom Software Development
Introduction Database Management System for Course Database
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PTS Company Brochure 2025 (1).pdf.......
Understanding Forklifts - TECH EHS Solution
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)

Version Control - Patterns and Practices

Editor's Notes

  • #2: Brief overview of the topic and myself – the 7 VCS used so far (different one each time), still many unused Acts as a time-machine, and almost as contentious as the text editor This talk tries to address the cargo cult behaviour around branching strategies
  • #3: Quick walkthrough of the schedule (it generally follows the software development lifecycle)
  • #4: Centralised versus distributed Online versus self-hosted (dedicated VCS team) Some have first class concepts for labels and branches, others it’s a convention Shims muddy the waters, e.g. git-svn
  • #5: Use local clones for history and as a local branch Check-in (again) to master NAS (with proper comment) Use robocopy to sync clones again Not a sane setup!
  • #6: Private workspace – work in isolation and make your own mess. Multiple workspaces are an alternative to switching the same workspace to different branches. ClearCase – snapshot (local) vs. dynamic (network) views. Ideally the workspace should contain everything to get started (e.g. build + unit tests). Usually workspace = branch, but can contain many branches (e.g. ClearCase config specs).
  • #7: Contentions subject, highly dependent on the organisation (survival rules can determine the strategy). Branches have policies, when a code change and policy are incompatible we can choose to branch. But branching is often a reaction to a weak development process – other ways to mitigate the risk.
  • #8: The default branch when VCS doesn’t support branching. Called different names - trunk/main/master. A common “Enterprise” anti-pattern is one integration branch per project.
  • #9: Reaction to code freeze – branch to avoid holding up development of version N+!. Ideally trunk still needs to be stable prior to branching – no last minute high-risk changes that might be pulled. Need integration branch when starting from a label. Very few, carefully reviewed changes expected - only essential changes.
  • #10: Branch for a specific feature (task) – often volatile in nature, e.g. a spike. Or the developer may be volatile, e.g. new joiner. Not necessary a single-developer branch, can allow multiple people to work more freely. Easy to throw away with no residual effects.
  • #11: Very short-lived branch, effectively only one commit. Put current changes to one side and integrate again later when dust has settled. Supported natively by some, called stashing in Git, branch from working copy is an alternative in SVN.
  • #13: Break task down into much, much smaller tasks. New code and refactorings don’t require toggling off, only changes (low risk, but not no risk) Need to schedule clean-up after toggled on permanently. Toggles can be compile-time (#ifdef) or runtime (.config entries). Supports truly-continuous integration.
  • #14: What’s the collective non for a group of developers? A merge conflict. Define “merge” as applying deltas to the content (merge/rebase applies to metadata). Avoid it, although every integrate is a mini-merge, but much more manageable. Integrate often especially when not using integration branch directly. Always merge from stable (release) -> volatile (development). Cherry picking is the reverse of this. Attitude – start by considering “theirs” to be correct and “mine” to be wrong – Seagull Merge. Tooling – two and three-way merging. Semantic merging. XML – merge as text often easier.
  • #15: The release merge is easier due to small focused changes. The feature branch merge can be harder because of the potential volume for change, e.g. refactoring.
  • #16: Undesirable, but often a reaction to an overly long testing phase. Small, focused commits make it easier to cherry pick as changes are isolated. Heavy refactoring makes this much harder as the likelihood for dependent changes increases. Changes can get lost on the merge back at the end. Record a merge at the end as nothing has changed code-wise but the loop should be closed.
  • #17: Define commit as “publishing”, so that’s commit + push in Git. What to commit – source only (preferable), build artefacts (only as an optimisation, e.g. shared libraries). Diff all files to make sure the changes contains no mistakes and “reads” correctly. Message should be short – the code says how the commit message says why. Use of “and” is a smell that the commit should perhaps be split into multiple change-sets. Provide a link to any supporting documentation, e.g. JIRA number – integration with other tools.
  • #18: Commit should trigger the continuous integration server. Might need delay for non-atomic commits. Optimistic workflow assumes commits are correct and should be ready to ship. The only breakage should be environmental or long-running tests that can be elided by developers. Build number should be auto-generated and baked into artefacts where possible. Wipe workspace if you can afford it, else clean thoroughly to give same effect – no uncommitted hacks should taint the build.
  • #19: Pessimistic workflow uses feature branches and build machine attempts to integrate.
  • #20: Label to trace a deployed build back its constituent source parts. Only need to label deployed builds as internal builds are not usually reported against. More of an issue when you have multiple releases in the wild, e.g. beta testers, multiple live product versions, hotfixs.
  • #22: Tracing back through time to work out what or why something was done – the narrative. Or perhaps mining trends within the codebase. Blame – should be named “excavate”. Investment needs to be put in at commit time to reward later in the day.
  • #23: SCM Patterns book – old (doesn’t even mention SVN!) but still useful. Free chapter (7) from Practical Perforce about software evolution. Martin Fowler’s blog has posts about branches and toggles.
  • #25: No books, just a blog