SlideShare a Scribd company logo
Code reviews
vs
Pull requests
TIM PETTERSEN | SENIOR DEVELOPER | ATLASSIAN | @KANNONBOY
2006
2007
Atlassian acquires
Cenqua, starts using
Crucible
CODE REVIEW AT ATLASSIAN
Pull requests
Post-commit
Pre-commit
master
for/master
Gerrit
CODE REVIEW AT ATLASSIAN
Creation
How is a review
composed?
History
How does a review
impact your repository?
Criteria
Iteration
How does an author
address feedback?
Collaboration
How do reviewers
leave feedback?
Pull requests
Post-commit
Pre-commit
master
for/master
Gerrit
dev $project-dev@example.com
master
maintainer
PRE-COMMIT REVIEW
PRE-COMMIT REVIEW
// flat fees and taxes
final float customsFee = 5.5f;
final float immigrationFee = 7f;
final float federalTransportTax = .025f;
public float calculateAirfare(float baseFare) {
float fare = baseFare;
fare += immigrationFee + customsFee;
fare *=
return fare;
}
(1 + )federalTransportTax;
PRE-COMMIT REVIEW
From: Tim Pettersen <tim@atlassian.com>
Date: Mon, 12 Sep 2016 10:24:10 +1000
Subject: [PATCH] Calculate federal transport tax correctly
--- a/com/atlassian/airfare/AirfareCalculator.java
+++ b/com/atlassian/airfare/AirfareCalculator.java
@@ -10,7 +10,7 @@
public float calculateAirfare(float baseFare) {
float fare = baseFare;
fare += immigrationFee + customsFee;
- fare *= federalTransportTax;
+ fare *= (1 + federalTransportTax);
return fare;
}
git format-patch HEAD~1 --stdout$
public float calculateAirfare(float baseFare) {
float fare = baseFare;
fare += immigrationFee + customsFee;
- fare *= federalTransportTax;
+ fare *= (1 + federalTransportTax);
return fare;
}
Subject: [PATCH] Calculate federal transport tax
PRE-COMMIT REVIEW
>
>
>
>
>
The braces are unnecessary.
public float calculateAirfare(float baseFare) {
float fare = baseFare;
fare += immigrationFee + customsFee;
- fare *= federalTransportTax;
+ fare *= (1 + federalTransportTax);
return fare;
}
Subject: Re: [PATCH] Calculate federal transport tax
>
>
PRE-COMMIT REVIEW
>
>
>
>
>
>
>
> >
>
Technically true, but I think they add clarity.
>
>
>
>
>
>
>
The braces are unnecessary.
public float calculateAirfare(float baseFare) {
float fare = baseFare;
fare += immigrationFee + customsFee;
- fare *= federalTransportTax;
+ fare *= (1 + federalTransportTax);
return fare;
}
Subject: Re: Re: [PATCH] Calculate federal transport tax
PRE-COMMIT REVIEW
> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Subject: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re:
PRE-COMMIT REVIEW
m
aster
ITERATION
Pull requestsLINUX GIT
git@vger.kernel.orglinux-kernel@vger.kernel.org
Pull requests
Post-commit review
Pre-commit review
master
for/master
Gerrit
Version control agnostic
Simple and decentralized
Easy to keep ‘000s of people in the loop
Plain text diffs
One contributor per patch
Difficult to iterate
Have to manually merge work
PRE-COMMIT REVIEW
Code Reviews vs. Pull Requests
Code Reviews vs. Pull Requests
Code Reviews vs. Pull Requests
master
master
patches & untracked files
commits
branches
specific filesmultiple repos
FLEXIBLE STRUCTURE
ITERATIVE REVIEW IN CRUCIBLE
SCM host
(e.g. Bitbucket)
Review host
(e.g. Crucible)
Dev team
push & pull
code review
slurp
slurp
slurp
slurp
NOT AN SCM HOST
Pull requests
Post-commit review
Pre-commit review
master
for/master
Gerrit
Supports popular CVCS and DVCS
Flexible review content
Easy to iterate
Have to manually merge work
Need a separate SCM host
Hard to enforce process
POST-COMMIT REVIEW
Gerrit
and DIFFY
the Kung Foo
Review Cuckoo
$ git config -f ~/gerrit/etc/gerrit.config gerrit.canonicalWebUrl
http://localhost:8080/
GERRIT IS VERY “GIT”
for/master
master
reviewers approved?
verified (build passing)?
fetch
push
GERRIT FLOW
Dev team
From: Gerrit Code Review - A Quick Introduction
+2
+1
0
-1
-2
$ git push origin HEAD:refs/for/master
# typey type type
$ git commit -am “Review feedback”
Counting objects: 2108776, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (59/59), done.
Writing objects: 100% (86/86), 893.21 KiB, done.
Total 86 (delta 0), reused 0 (delta 0)
! [remote rejected] HEAD -> refs/for/master (squash commits first)
error: failed to push some refs to ‘ssh://...'
“SQUASH COMMITS FIRST”
for/master
push
push --force
push --force
“SQUASH COMMITS FIRST”
From: Gerrit Code Review - A Quick Introduction
Pull requests
Post-commit review
Pre-commit review
master
for/master
Staging area
Sophisticated policy enforcement
FOSS project built in Java, on JGit
Clean commit history
Steep learning curve to use & administer
Iteration is a little awkward
Git only
One contributor per patch
GERRIT
master
master
patches & untracked files
commits
branches
specific filesmultiple repos
BRANCHES ONLY
Code Reviews vs. Pull Requests
ITERATIVE REVIEW IN BITBUCKET
review before merging
Passing build
Reviewer sign-off
Ready for deployment
PULL REQUESTS > CODE REVIEW
IN REVIEW DONEIN PROGRESSOPEN
Branch
created!
Pull request
created!
Pull request
merged!
PULL REQUEST == ISSUE
Two developers about to
press the “Merge” button
master
Pull requestsPULL REQUESTS MAILING LIST / GERRIT
Merge Strategies
--no-ff
--ff-only
--squash --ff-only
--squash
--ff
git merge --ffm
aster
feature/JIR
A
-123
“Fast forward if you can, otherwise
create a merge commit.”
git merge --no-ffm
aster
feature/JIR
A
-123
“Always create a merge commit.”
git merge --ff-only
m
aster
feature/JIR
A
-123
“Only allow fast forwards.”
git merge --squash
“Combine commits on branch into a new commit
on master.”
m
aster
feature/JIR
A
-123
git merge --squash 
“Combine commits on branch into a new commit on master.
Fail if master has any commits that branch doesn’t.”
m
aster
--ff-only
Merge Commit Fast forward Squash
Concise history
Lose context of how
features evolved
Which should I use?
“Ugly” history
Full traceability
Hard to screw up
mostly some
--no-ff --ff-only --squash
No merge commits
Verbose history
Requires rebasing
Sophisticated policy enforcement
Choice of merge strategies
Multiple team members can author code under review
Git & Mercurial
Less flexible review content
PULL REQUESTS
Pull requestsTRADITIONAL CODE REVIEW PULL REQUESTS
Need to review multiple
repos at once
Not on Git
Heavily iterative workflow
Literally everyone else
Dendrophobia
Thanks!
TIM PETTERSEN | SENIOR DEVELOPER | ATLASSIAN | @KANNONBOY
Questions?

More Related Content

PDF
Developers Use Bitbucket and So Can You
PDF
Vol2 no1 peranan fasilitas pelabuhan dalam menunjang kegiatan bongkar muat, a...
PPT
Science Forum Day 5 - Fish Breeding and Genetics Group - Genetic Improvement ...
PDF
Unleashing Docker with Pipelines in Bitbucket Cloud
PDF
Configuration as Code in Bamboo
PDF
A Day in the Life of a HipChat Developer
PDF
Software Delivery at Warp Speed: Five Essential Techniques
PDF
Git Aliases of the Gods!
Developers Use Bitbucket and So Can You
Vol2 no1 peranan fasilitas pelabuhan dalam menunjang kegiatan bongkar muat, a...
Science Forum Day 5 - Fish Breeding and Genetics Group - Genetic Improvement ...
Unleashing Docker with Pipelines in Bitbucket Cloud
Configuration as Code in Bamboo
A Day in the Life of a HipChat Developer
Software Delivery at Warp Speed: Five Essential Techniques
Git Aliases of the Gods!

Viewers also liked (17)

PDF
Black Belt Tips for JIRA Software
PDF
SecOps - Bringing Agility into Security
PDF
How Nespresso Uses JIRA Software for Release Management
PDF
Scrum Control or Kanban Agility? You Can Have both, Using Metrics
PDF
Agile Incident Response and Resolution in the Wold of Devops
PDF
Sink or Swim: How Incident Communication Keeps You Afloat
PDF
A Product Manager's Place in a DevOps World
PPTX
From Start-up to Grown-up – FlixBus's Journey with Trello + Atlassian
PDF
How Archimedes Uses Atlassian Tools Across All Teams
PDF
Automation Awesomeness: Scaling JIRA Service Desk
PDF
Modern Operations at Scale within Viasat – How to Structure Teams and Build A...
PDF
How JIRA Core Helps 300,000 Houses Become Smarter
PDF
How HipChat Ships and Recovers Fast with DevOps Practices
PDF
How Trade Desk Built a Connected Team of 100+ Service Agents
PDF
Brick by Brick: Building Collaboration at The New York Times
PDF
The Key to Great Teams: Understanding the Human Operating System
PDF
Don't be Left Out: Tips for Working in a Remote Team
Black Belt Tips for JIRA Software
SecOps - Bringing Agility into Security
How Nespresso Uses JIRA Software for Release Management
Scrum Control or Kanban Agility? You Can Have both, Using Metrics
Agile Incident Response and Resolution in the Wold of Devops
Sink or Swim: How Incident Communication Keeps You Afloat
A Product Manager's Place in a DevOps World
From Start-up to Grown-up – FlixBus's Journey with Trello + Atlassian
How Archimedes Uses Atlassian Tools Across All Teams
Automation Awesomeness: Scaling JIRA Service Desk
Modern Operations at Scale within Viasat – How to Structure Teams and Build A...
How JIRA Core Helps 300,000 Houses Become Smarter
How HipChat Ships and Recovers Fast with DevOps Practices
How Trade Desk Built a Connected Team of 100+ Service Agents
Brick by Brick: Building Collaboration at The New York Times
The Key to Great Teams: Understanding the Human Operating System
Don't be Left Out: Tips for Working in a Remote Team
Ad

Similar to Code Reviews vs. Pull Requests (20)

PDF
Code reviews vs Pull requests
PDF
Getting Git Right
PDF
Review your code like a Googler
PDF
Git Started With Git
PDF
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
PDF
How Git and Gerrit make you more productive
PPTX
Understanding Github and Version Control System.pptx
PPTX
Git branching policy and review comment's prefix
PPTX
Stable master workflow with Gerrit Code Review
PDF
Gerrit
PDF
Git code reviews
PPTX
Git Pull Requests
PPTX
Intro. to Git and Github
PDF
M.Mozūras - git
KEY
40 square's git workflow
PDF
Git best practices 2016
PDF
Jedi Mind Tricks in Git
PPT
Eclipse Hacker's Guide to the Git Universe
PPTX
Technical Seminar Series: GIT Pull Requests Best Practices
PDF
Git, GitHub and Open Source
Code reviews vs Pull requests
Getting Git Right
Review your code like a Googler
Git Started With Git
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
How Git and Gerrit make you more productive
Understanding Github and Version Control System.pptx
Git branching policy and review comment's prefix
Stable master workflow with Gerrit Code Review
Gerrit
Git code reviews
Git Pull Requests
Intro. to Git and Github
M.Mozūras - git
40 square's git workflow
Git best practices 2016
Jedi Mind Tricks in Git
Eclipse Hacker's Guide to the Git Universe
Technical Seminar Series: GIT Pull Requests Best Practices
Git, GitHub and Open Source
Ad

More from Atlassian (20)

PPTX
International Women's Day 2020
PDF
10 emerging trends that will unbreak your workplace in 2020
PDF
Forge App Showcase
PDF
Let's Build an Editor Macro with Forge UI
PDF
Meet the Forge Runtime
PDF
Forge UI: A New Way to Customize the Atlassian User Experience
PDF
Take Action with Forge Triggers
PDF
Observability and Troubleshooting in Forge
PDF
Trusted by Default: The Forge Security & Privacy Model
PDF
Designing Forge UI: A Story of Designing an App UI System
PDF
Forge: Under the Hood
PDF
Access to User Activities - Activity Platform APIs
PDF
Design Your Next App with the Atlassian Vendor Sketch Plugin
PDF
Tear Up Your Roadmap and Get Out of the Building
PDF
Nailing Measurement: a Framework for Measuring Metrics that Matter
PDF
Building Apps With Color Blind Users in Mind
PDF
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
PDF
Beyond Diversity: A Guide to Building Balanced Teams
PDF
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
PDF
Building Apps With Enterprise in Mind
International Women's Day 2020
10 emerging trends that will unbreak your workplace in 2020
Forge App Showcase
Let's Build an Editor Macro with Forge UI
Meet the Forge Runtime
Forge UI: A New Way to Customize the Atlassian User Experience
Take Action with Forge Triggers
Observability and Troubleshooting in Forge
Trusted by Default: The Forge Security & Privacy Model
Designing Forge UI: A Story of Designing an App UI System
Forge: Under the Hood
Access to User Activities - Activity Platform APIs
Design Your Next App with the Atlassian Vendor Sketch Plugin
Tear Up Your Roadmap and Get Out of the Building
Nailing Measurement: a Framework for Measuring Metrics that Matter
Building Apps With Color Blind Users in Mind
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
Beyond Diversity: A Guide to Building Balanced Teams
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
Building Apps With Enterprise in Mind

Recently uploaded (20)

PPTX
Introduction to Artificial Intelligence
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PPTX
Transform Your Business with a Software ERP System
PPT
Introduction Database Management System for Course Database
PDF
System and Network Administraation Chapter 3
PDF
top salesforce developer skills in 2025.pdf
PPTX
L1 - Introduction to python Backend.pptx
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
AI in Product Development-omnex systems
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
history of c programming in notes for students .pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
Introduction to Artificial Intelligence
How to Choose the Right IT Partner for Your Business in Malaysia
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
ManageIQ - Sprint 268 Review - Slide Deck
Transform Your Business with a Software ERP System
Introduction Database Management System for Course Database
System and Network Administraation Chapter 3
top salesforce developer skills in 2025.pdf
L1 - Introduction to python Backend.pptx
Upgrade and Innovation Strategies for SAP ERP Customers
Understanding Forklifts - TECH EHS Solution
Design an Analysis of Algorithms II-SECS-1021-03
AI in Product Development-omnex systems
Adobe Illustrator 28.6 Crack My Vision of Vector Design
history of c programming in notes for students .pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PTS Company Brochure 2025 (1).pdf.......
CHAPTER 2 - PM Management and IT Context
Odoo POS Development Services by CandidRoot Solutions
Which alternative to Crystal Reports is best for small or large businesses.pdf

Code Reviews vs. Pull Requests