SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
San Francisco, USA
Karsten Dambekalns
How Git and Gerrit
make you more productive
Freitag, 10. Juni 11
San Francisco, USA
co-lead of TYPO3 5.0 and FLOW3
34 years old
lives in Lübeck, Germany
1 wife, 3 sons, 1 espresso machine
likes canoeing
Karsten Dambekalns
Freitag, 10. Juni 11
San Francisco, USA
Git
Git is a distributed version control system
•
Freitag, 10. Juni 11
San Francisco, USA
Git
• originally developed by Linus Torvalds
• is a distributed version control system
• every working copy is a complete repository
• very powerful
• can seem more complex than Subversion
• basic operations actually quite simple
Freitag, 10. Juni 11
San Francisco, USA
Git
Clone a repository
$ mkdir FLOW3
$ cd FLOW3
$ git clone --recursive git://git.typo3.org/FLOW3/Distributions/Base.git .
Cloning into ....
remote: Counting objects: 3837, done.
remote: Compressing objects: 100% (2023/2023), done.
remote: Total 3837 (delta 2007), reused 2721 (delta 1465)
Receiving objects: 100% (3837/3837), 3.49 MiB | 28 KiB/s, done.
Resolving deltas: 100% (2007/2007), done.
Freitag, 10. Juni 11
San Francisco, USA
Git
Update from a remote repository
$ git submodule foreach "git checkout master"
-✂-----✂-----✂-----✂-----✂-----✂-----✂-----✂-----✂-----✂-----✂-----✂-
$ git submodule foreach "git pull --rebase"
Entering 'Build/Common'
First, rewinding head to replay your work on top of it...
Fast-forwarded master to 6f27f1784240b414e966ce0e5a12e23cb2f7ab02.
Entering 'Packages/Application/TYPO3'
First, rewinding head to replay your work on top of it...
Fast-forwarded master to 5187430ee44d579ae2bac825e2a069c4cd3f38a4.
Entering 'Packages/Application/TYPO3CR'
First, rewinding head to replay your work on top of it...
Fast-forwarded master to b1f5331aa51d390fa3d973404f31b9fd773f7059.
Entering 'Packages/Application/Twitter'
Current branch master is up to date.
…
Freitag, 10. Juni 11
San Francisco, USA
Git
Commit to a local repository
• it’s your repository, so you can commit anything, anytime
• until published feel free to change history as needed
$ git commit -a -m 'A useful commit message'
[master (root-commit) 419aaa2] foo
1 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 .userchain
Freitag, 10. Juni 11
San Francisco, USA
Git
Push to a remote repository
• after publishing do not change history anymore
$ git push
Counting objects: 82, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (31/31), done.
Writing objects: 100% (57/57), 6.09 KiB, done.
Total 57 (delta 24), reused 21 (delta 7)
To git@github.com:typo3/gerrit.git
+ 6cd4495...a2bcced production -> production
Freitag, 10. Juni 11
San Francisco, USA
Git
Cool features
• local repository allows commits anytime
• local history can be cleaned up before pushing changes
• branches are local, fast and cheap
• changes can be shared easily
• distinguishes author and committer
• powerful history rewriting
Freitag, 10. Juni 11
San Francisco, USA
Code Reviews
Freitag, 10. Juni 11
San Francisco, USA
Code Reviews
• are a quality assurance tool
• all code contains errors, more or less
• it’s easier to spot them with four, six, eight, … eyes
• a review must be passed for code to be integrated
Freitag, 10. Juni 11
San Francisco, USA
Code Reviews
Code Review
is about the looks
• good variable and function names
• CGL compliance
• reasonable program flow
• clean coding
Can be checked by reading the code, can partly be automated
Freitag, 10. Juni 11
San Francisco, USA
Code Reviews
Functional Review
is about the functionality
• do the unit and functional tests pass?
• does the bugfix fix the bug? the feature work?
• is nothing else broken?
Can be checked by testing the code, can partly be automated
Freitag, 10. Juni 11
San Francisco, USA
Gerrit
Gerrit is a code review tool
• developed by Google for Android
• based on Git
• acts as a firewall in front of a Git repository
• is a web-based review tool
• is a SSH server
• is a Git server
• manages Git permissions along the way
• see it at https://review.typo3.org
Freitag, 10. Juni 11
San Francisco, USA
Gerrit
Git standalone
Git & Gerrit
Freitag, 10. Juni 11
San Francisco, USA
Gerrit
Freitag, 10. Juni 11
San Francisco, USA
Gerrit
see user’s changes
unique change id filter by project
Freitag, 10. Juni 11
San Francisco, USA
Gerrit
Freitag, 10. Juni 11
San Francisco, USA
Gerrit
Freitag, 10. Juni 11
San Francisco, USA
Gerrit
Freitag, 10. Juni 11
San Francisco, USA
Gerrit
Communication is Key
• inline comments by double clicking in diff view
• per patch set comments
Freitag, 10. Juni 11
San Francisco, USA
Gerrit
Functional Tests Made Easy
• ready-to-use commands for getting a change provided by
Gerrit
• choice between checkout and cherry pick
• checkout exactly reproduces what was pushed
• cherry-pick adds the change to your current state
Freitag, 10. Juni 11
San Francisco, USA
Gerrit
Functional Tests Made Easy
• after getting the change run tests and/or test manually
• then leave a review in Gerrit
Freitag, 10. Juni 11
San Francisco, USA
Gerrit
Functional review
vote here
Code review
vote here
Explain your vote
if needed / helpful
Freitag, 10. Juni 11
San Francisco, USA
Gerrit
Contributing a Change
• Git needs to be set up (your name and email must
match the Gerrit user)
• Upload your SSH public key to Gerrit
• Make Git push to Gerrit by default
$ git config --global
url."ssh://review.typo3.org".pushInsteadOf git://git.typo3.org
Freitag, 10. Juni 11
San Francisco, USA
Gerrit
Creating the Change-ID
• Gerrit comes with a commit hook to create the ID
• just copy it into every repository
• for submodules use this
$ scp -p -P 29418 review.typo3.org:hooks/commit-msg .git/hooks/
$ git submodule foreach
'scp -p -P 29418 review.typo3.org:hooks/commit-msg .git/hooks/'
Freitag, 10. Juni 11
San Francisco, USA
Gerrit
Prepare & Push the Change
• make your code change
• commit and provide a good commit message
• check your change again
• push to a virtual branch to create a change set
• Gerrit will tell you the URL for the new change
$ git log -p origin/master..HEAD
$ git push origin HEAD:refs/for/master
Freitag, 10. Juni 11
San Francisco, USA
Summary
•Git allows for more efficient work
•Gerrit makes code review comfortable
•central hub for code comments and
change history
•functional tests are easy through
ready-to-use commands
Freitag, 10. Juni 11
San Francisco, USA
Thank You!
• These slides: http://slideshare.net/kfish
• Follow me on twitter: @k_fish
• Give me feedback:
• karsten@typo3.org
• http://joind.in/3550
Freitag, 10. Juni 11

Contenu connexe

Tendances

Introduction to GitHub
Introduction to GitHubIntroduction to GitHub
Introduction to GitHubNishan Bose
 
GerritHub.io - present, past, future
GerritHub.io - present, past, futureGerritHub.io - present, past, future
GerritHub.io - present, past, futureLuca Milanesio
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshareRakesh Sukumar
 
Git and Gerrit Code Review - Tech Talk - 2010_09_23
Git and Gerrit Code Review - Tech Talk - 2010_09_23Git and Gerrit Code Review - Tech Talk - 2010_09_23
Git and Gerrit Code Review - Tech Talk - 2010_09_23msohn
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and GithubWycliff1
 
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14msohn
 
Getting Started with GitHub
Getting Started with GitHubGetting Started with GitHub
Getting Started with GitHubMichael Redlich
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewRueful Robin
 
Git Lab Introduction
Git Lab IntroductionGit Lab Introduction
Git Lab IntroductionKrunal Doshi
 
Github Case Study By Amil Ali
Github Case Study By Amil AliGithub Case Study By Amil Ali
Github Case Study By Amil AliAmilAli1
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHubRick Umali
 
Gitt and Git-flow
Gitt and Git-flowGitt and Git-flow
Gitt and Git-flowMd. Masud
 
Git with bitbucket
Git with bitbucketGit with bitbucket
Git with bitbucketSumin Byeon
 

Tendances (20)

Intro to Git & GitHub
Intro to Git & GitHubIntro to Git & GitHub
Intro to Git & GitHub
 
Introduction to GitHub
Introduction to GitHubIntroduction to GitHub
Introduction to GitHub
 
GerritHub.io - present, past, future
GerritHub.io - present, past, futureGerritHub.io - present, past, future
GerritHub.io - present, past, future
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
 
Git and Gerrit Code Review - Tech Talk - 2010_09_23
Git and Gerrit Code Review - Tech Talk - 2010_09_23Git and Gerrit Code Review - Tech Talk - 2010_09_23
Git and Gerrit Code Review - Tech Talk - 2010_09_23
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
 
A prentation on github
A prentation on githubA prentation on github
A prentation on github
 
Getting Started with GitHub
Getting Started with GitHubGetting Started with GitHub
Getting Started with GitHub
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
 
Gerrit Workshop
Gerrit WorkshopGerrit Workshop
Gerrit Workshop
 
Git Lab Introduction
Git Lab IntroductionGit Lab Introduction
Git Lab Introduction
 
Github Case Study By Amil Ali
Github Case Study By Amil AliGithub Case Study By Amil Ali
Github Case Study By Amil Ali
 
Github basics
Github basicsGithub basics
Github basics
 
Git and Github workshop
Git and Github workshopGit and Github workshop
Git and Github workshop
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
 
Github
GithubGithub
Github
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Gitt and Git-flow
Gitt and Git-flowGitt and Git-flow
Gitt and Git-flow
 
Git with bitbucket
Git with bitbucketGit with bitbucket
Git with bitbucket
 

Similaire à How Git and Gerrit make you more productive

Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with GitThings Lab
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash CourseNilay Binjola
 
Git for standalone use
Git for standalone useGit for standalone use
Git for standalone useIkuru Kanuma
 
Learning git
Learning gitLearning git
Learning gitSid Anand
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configurationKishor Kumar
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github Max Claus Nunes
 
Git Workshop : Getting Started
Git Workshop : Getting StartedGit Workshop : Getting Started
Git Workshop : Getting StartedWildan Maulana
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITPouriaQashqai1
 
Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_gitLuis Atencio
 
Git is a distributed version control system .
Git is a distributed version control system .Git is a distributed version control system .
Git is a distributed version control system .HELLOWorld889594
 

Similaire à How Git and Gerrit make you more productive (20)

GitHub Event.pptx
GitHub Event.pptxGitHub Event.pptx
GitHub Event.pptx
 
Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with Git
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git for standalone use
Git for standalone useGit for standalone use
Git for standalone use
 
Learning git
Learning gitLearning git
Learning git
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
GIT-FirstPart.ppt
GIT-FirstPart.pptGIT-FirstPart.ppt
GIT-FirstPart.ppt
 
Git Workshop : Getting Started
Git Workshop : Getting StartedGit Workshop : Getting Started
Git Workshop : Getting Started
 
Git
GitGit
Git
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git Heaven with Wakanda
Git Heaven with WakandaGit Heaven with Wakanda
Git Heaven with Wakanda
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 
390a gitintro 12au
390a gitintro 12au390a gitintro 12au
390a gitintro 12au
 
Luis atencio on_git
Luis atencio on_gitLuis atencio on_git
Luis atencio on_git
 
Git 101
Git 101Git 101
Git 101
 
Git is a distributed version control system .
Git is a distributed version control system .Git is a distributed version control system .
Git is a distributed version control system .
 

Plus de Karsten Dambekalns

The Perfect Neos Project Setup
The Perfect Neos Project SetupThe Perfect Neos Project Setup
The Perfect Neos Project SetupKarsten Dambekalns
 
Sawubona! Content Dimensions with Neos
Sawubona! Content Dimensions with NeosSawubona! Content Dimensions with Neos
Sawubona! Content Dimensions with NeosKarsten Dambekalns
 
Deploying TYPO3 Neos websites using Surf
Deploying TYPO3 Neos websites using SurfDeploying TYPO3 Neos websites using Surf
Deploying TYPO3 Neos websites using SurfKarsten Dambekalns
 
Profiling TYPO3 Flow Applications
Profiling TYPO3 Flow ApplicationsProfiling TYPO3 Flow Applications
Profiling TYPO3 Flow ApplicationsKarsten Dambekalns
 
Using Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowUsing Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowKarsten Dambekalns
 
The agile future of a ponderous project
The agile future of a ponderous projectThe agile future of a ponderous project
The agile future of a ponderous projectKarsten Dambekalns
 
How Domain-Driven Design helps you to migrate into the future
How Domain-Driven Design helps you to migrate into the futureHow Domain-Driven Design helps you to migrate into the future
How Domain-Driven Design helps you to migrate into the futureKarsten Dambekalns
 
Content Repository, Versioning and Workspaces in TYPO3 Phoenix
Content Repository, Versioning and Workspaces in TYPO3 PhoenixContent Repository, Versioning and Workspaces in TYPO3 Phoenix
Content Repository, Versioning and Workspaces in TYPO3 PhoenixKarsten Dambekalns
 
Transparent Object Persistence (within FLOW3)
Transparent Object Persistence (within FLOW3)Transparent Object Persistence (within FLOW3)
Transparent Object Persistence (within FLOW3)Karsten Dambekalns
 
Transparent Object Persistence with FLOW3
Transparent Object Persistence with FLOW3Transparent Object Persistence with FLOW3
Transparent Object Persistence with FLOW3Karsten Dambekalns
 
Implementing a JSR-283 Content Repository in PHP
Implementing a JSR-283 Content Repository in PHPImplementing a JSR-283 Content Repository in PHP
Implementing a JSR-283 Content Repository in PHPKarsten Dambekalns
 
Knowledge Management in der TYPO3 Community
Knowledge Management in der TYPO3 CommunityKnowledge Management in der TYPO3 Community
Knowledge Management in der TYPO3 CommunityKarsten Dambekalns
 
Implementing a JSR-283 Content Repository in PHP
Implementing a JSR-283 Content Repository in PHPImplementing a JSR-283 Content Repository in PHP
Implementing a JSR-283 Content Repository in PHPKarsten Dambekalns
 
A Content Repository for TYPO3 5.0
A Content Repository for TYPO3 5.0A Content Repository for TYPO3 5.0
A Content Repository for TYPO3 5.0Karsten Dambekalns
 

Plus de Karsten Dambekalns (20)

The Perfect Neos Project Setup
The Perfect Neos Project SetupThe Perfect Neos Project Setup
The Perfect Neos Project Setup
 
Sawubona! Content Dimensions with Neos
Sawubona! Content Dimensions with NeosSawubona! Content Dimensions with Neos
Sawubona! Content Dimensions with Neos
 
Deploying TYPO3 Neos websites using Surf
Deploying TYPO3 Neos websites using SurfDeploying TYPO3 Neos websites using Surf
Deploying TYPO3 Neos websites using Surf
 
Profiling TYPO3 Flow Applications
Profiling TYPO3 Flow ApplicationsProfiling TYPO3 Flow Applications
Profiling TYPO3 Flow Applications
 
Using Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowUsing Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 Flow
 
i18n and L10n in TYPO3 Flow
i18n and L10n in TYPO3 Flowi18n and L10n in TYPO3 Flow
i18n and L10n in TYPO3 Flow
 
FLOW3-Workshop F3X12
FLOW3-Workshop F3X12FLOW3-Workshop F3X12
FLOW3-Workshop F3X12
 
Doctrine in FLOW3
Doctrine in FLOW3Doctrine in FLOW3
Doctrine in FLOW3
 
The agile future of a ponderous project
The agile future of a ponderous projectThe agile future of a ponderous project
The agile future of a ponderous project
 
How Domain-Driven Design helps you to migrate into the future
How Domain-Driven Design helps you to migrate into the futureHow Domain-Driven Design helps you to migrate into the future
How Domain-Driven Design helps you to migrate into the future
 
Content Repository, Versioning and Workspaces in TYPO3 Phoenix
Content Repository, Versioning and Workspaces in TYPO3 PhoenixContent Repository, Versioning and Workspaces in TYPO3 Phoenix
Content Repository, Versioning and Workspaces in TYPO3 Phoenix
 
Transparent Object Persistence (within FLOW3)
Transparent Object Persistence (within FLOW3)Transparent Object Persistence (within FLOW3)
Transparent Object Persistence (within FLOW3)
 
JavaScript for PHP Developers
JavaScript for PHP DevelopersJavaScript for PHP Developers
JavaScript for PHP Developers
 
Transparent Object Persistence with FLOW3
Transparent Object Persistence with FLOW3Transparent Object Persistence with FLOW3
Transparent Object Persistence with FLOW3
 
TDD (with FLOW3)
TDD (with FLOW3)TDD (with FLOW3)
TDD (with FLOW3)
 
Implementing a JSR-283 Content Repository in PHP
Implementing a JSR-283 Content Repository in PHPImplementing a JSR-283 Content Repository in PHP
Implementing a JSR-283 Content Repository in PHP
 
Knowledge Management in der TYPO3 Community
Knowledge Management in der TYPO3 CommunityKnowledge Management in der TYPO3 Community
Knowledge Management in der TYPO3 Community
 
Unicode & PHP6
Unicode & PHP6Unicode & PHP6
Unicode & PHP6
 
Implementing a JSR-283 Content Repository in PHP
Implementing a JSR-283 Content Repository in PHPImplementing a JSR-283 Content Repository in PHP
Implementing a JSR-283 Content Repository in PHP
 
A Content Repository for TYPO3 5.0
A Content Repository for TYPO3 5.0A Content Repository for TYPO3 5.0
A Content Repository for TYPO3 5.0
 

Dernier

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 

Dernier (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

How Git and Gerrit make you more productive

  • 1. San Francisco, USA Karsten Dambekalns How Git and Gerrit make you more productive Freitag, 10. Juni 11
  • 2. San Francisco, USA co-lead of TYPO3 5.0 and FLOW3 34 years old lives in Lübeck, Germany 1 wife, 3 sons, 1 espresso machine likes canoeing Karsten Dambekalns Freitag, 10. Juni 11
  • 3. San Francisco, USA Git Git is a distributed version control system • Freitag, 10. Juni 11
  • 4. San Francisco, USA Git • originally developed by Linus Torvalds • is a distributed version control system • every working copy is a complete repository • very powerful • can seem more complex than Subversion • basic operations actually quite simple Freitag, 10. Juni 11
  • 5. San Francisco, USA Git Clone a repository $ mkdir FLOW3 $ cd FLOW3 $ git clone --recursive git://git.typo3.org/FLOW3/Distributions/Base.git . Cloning into .... remote: Counting objects: 3837, done. remote: Compressing objects: 100% (2023/2023), done. remote: Total 3837 (delta 2007), reused 2721 (delta 1465) Receiving objects: 100% (3837/3837), 3.49 MiB | 28 KiB/s, done. Resolving deltas: 100% (2007/2007), done. Freitag, 10. Juni 11
  • 6. San Francisco, USA Git Update from a remote repository $ git submodule foreach "git checkout master" -✂-----✂-----✂-----✂-----✂-----✂-----✂-----✂-----✂-----✂-----✂-----✂- $ git submodule foreach "git pull --rebase" Entering 'Build/Common' First, rewinding head to replay your work on top of it... Fast-forwarded master to 6f27f1784240b414e966ce0e5a12e23cb2f7ab02. Entering 'Packages/Application/TYPO3' First, rewinding head to replay your work on top of it... Fast-forwarded master to 5187430ee44d579ae2bac825e2a069c4cd3f38a4. Entering 'Packages/Application/TYPO3CR' First, rewinding head to replay your work on top of it... Fast-forwarded master to b1f5331aa51d390fa3d973404f31b9fd773f7059. Entering 'Packages/Application/Twitter' Current branch master is up to date. … Freitag, 10. Juni 11
  • 7. San Francisco, USA Git Commit to a local repository • it’s your repository, so you can commit anything, anytime • until published feel free to change history as needed $ git commit -a -m 'A useful commit message' [master (root-commit) 419aaa2] foo 1 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 .userchain Freitag, 10. Juni 11
  • 8. San Francisco, USA Git Push to a remote repository • after publishing do not change history anymore $ git push Counting objects: 82, done. Delta compression using up to 2 threads. Compressing objects: 100% (31/31), done. Writing objects: 100% (57/57), 6.09 KiB, done. Total 57 (delta 24), reused 21 (delta 7) To git@github.com:typo3/gerrit.git + 6cd4495...a2bcced production -> production Freitag, 10. Juni 11
  • 9. San Francisco, USA Git Cool features • local repository allows commits anytime • local history can be cleaned up before pushing changes • branches are local, fast and cheap • changes can be shared easily • distinguishes author and committer • powerful history rewriting Freitag, 10. Juni 11
  • 10. San Francisco, USA Code Reviews Freitag, 10. Juni 11
  • 11. San Francisco, USA Code Reviews • are a quality assurance tool • all code contains errors, more or less • it’s easier to spot them with four, six, eight, … eyes • a review must be passed for code to be integrated Freitag, 10. Juni 11
  • 12. San Francisco, USA Code Reviews Code Review is about the looks • good variable and function names • CGL compliance • reasonable program flow • clean coding Can be checked by reading the code, can partly be automated Freitag, 10. Juni 11
  • 13. San Francisco, USA Code Reviews Functional Review is about the functionality • do the unit and functional tests pass? • does the bugfix fix the bug? the feature work? • is nothing else broken? Can be checked by testing the code, can partly be automated Freitag, 10. Juni 11
  • 14. San Francisco, USA Gerrit Gerrit is a code review tool • developed by Google for Android • based on Git • acts as a firewall in front of a Git repository • is a web-based review tool • is a SSH server • is a Git server • manages Git permissions along the way • see it at https://review.typo3.org Freitag, 10. Juni 11
  • 15. San Francisco, USA Gerrit Git standalone Git & Gerrit Freitag, 10. Juni 11
  • 17. San Francisco, USA Gerrit see user’s changes unique change id filter by project Freitag, 10. Juni 11
  • 21. San Francisco, USA Gerrit Communication is Key • inline comments by double clicking in diff view • per patch set comments Freitag, 10. Juni 11
  • 22. San Francisco, USA Gerrit Functional Tests Made Easy • ready-to-use commands for getting a change provided by Gerrit • choice between checkout and cherry pick • checkout exactly reproduces what was pushed • cherry-pick adds the change to your current state Freitag, 10. Juni 11
  • 23. San Francisco, USA Gerrit Functional Tests Made Easy • after getting the change run tests and/or test manually • then leave a review in Gerrit Freitag, 10. Juni 11
  • 24. San Francisco, USA Gerrit Functional review vote here Code review vote here Explain your vote if needed / helpful Freitag, 10. Juni 11
  • 25. San Francisco, USA Gerrit Contributing a Change • Git needs to be set up (your name and email must match the Gerrit user) • Upload your SSH public key to Gerrit • Make Git push to Gerrit by default $ git config --global url."ssh://review.typo3.org".pushInsteadOf git://git.typo3.org Freitag, 10. Juni 11
  • 26. San Francisco, USA Gerrit Creating the Change-ID • Gerrit comes with a commit hook to create the ID • just copy it into every repository • for submodules use this $ scp -p -P 29418 review.typo3.org:hooks/commit-msg .git/hooks/ $ git submodule foreach 'scp -p -P 29418 review.typo3.org:hooks/commit-msg .git/hooks/' Freitag, 10. Juni 11
  • 27. San Francisco, USA Gerrit Prepare & Push the Change • make your code change • commit and provide a good commit message • check your change again • push to a virtual branch to create a change set • Gerrit will tell you the URL for the new change $ git log -p origin/master..HEAD $ git push origin HEAD:refs/for/master Freitag, 10. Juni 11
  • 28. San Francisco, USA Summary •Git allows for more efficient work •Gerrit makes code review comfortable •central hub for code comments and change history •functional tests are easy through ready-to-use commands Freitag, 10. Juni 11
  • 29. San Francisco, USA Thank You! • These slides: http://slideshare.net/kfish • Follow me on twitter: @k_fish • Give me feedback: • karsten@typo3.org • http://joind.in/3550 Freitag, 10. Juni 11