SlideShare a Scribd company logo
1 of 34
Introduction to Gerrit


    Dariusz Łuksza
     dariusz@luksza.org
          @dluksza
Git?!
    Copyright © 2012 Dariusz Łuksza
What is Gerrit?


      Git server

      Gerrit
HTTP serverSSH server




                     Copyright © 2012 Dariusz Łuksza
Why use code view?
●   Early catch of common errors:
    –   NullPoinerException
    –   Code duplication
    –   Deprecated code use
    –   Typos
●   Code design review
●   Improve team knowledge about project
●   Can be used as knowledge base


                                      Copyright © 2012 Dariusz Łuksza
Who uses Gerrit?




                   Copyright © 2012 Dariusz Łuksza
Gerrit @ Eclipse Foundation




                       Copyright © 2012 Dariusz Łuksza
What is needed to use it?
●   Gerrit server
●   git – with additional configuration
    –   proper refspec
    –   commit message hook
●   or EGit




                                          Copyright © 2012 Dariusz Łuksza
What is “refspec”?

$ git push <repo_name> <src_branch>:<dst_branch>
example:
●   $ git push origin fix-npe:master
●   $ git push origin fix-npe:refs/for/master
or configure this as default push action for repository:
$ git configure remote.origin.push HEAD:refs/for/master
Or use EGit and “Push to Gerrit” action.



                                                Copyright © 2012 Dariusz Łuksza
What is “commit hook”?
●   Script executed by git after commit operation
●   Gerrit commit hook adds Change-Id meta data
●   It is project independent so after fetching from
    server for one project you can copy it locally

●   Or use EGit and don't bother about hooks.




                                           Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit 0a60797abd716298c6f6f8eb641451ae507eb9bf
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I871f6b4c500c96f4f7a91abf236f76b00d9057ca
$ git push origin HEAD:refs/for/master

                                                 Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit 0a60797abd716298c6f6f8eb641451ae507eb9bf
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I871f6b4c500c96f4f7a91abf236f76b00d9057ca
$ git push origin HEAD:refs/for/master

                                                Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit 0a60797abd716298c6f6f8eb641451ae507eb9bf
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I871f6b4c500c96f4f7a91abf236f76b00d9057ca
$ git push origin HEAD:refs/for/master

                                                Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit 0a60797abd716298c6f6f8eb641451ae507eb9bf
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I871f6b4c500c96f4f7a91abf236f76b00d9057ca
$ git push origin HEAD:refs/for/master

                                                Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit 0a60797abd716298c6f6f8eb641451ae507eb9bf
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I871f6b4c500c96f4f7a91abf236f76b00d9057ca
$ git push origin HEAD:refs/for/master

                                                Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56
$ git push origin HEAD:refs/for/master

                                                Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56
$ git push origin HEAD:refs/for/master

                                                Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56
$ git push origin HEAD:refs/for/master

                                                Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56
$ git push origin HEAD:refs/for/master

                                                Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56
$ git push origin HEAD:refs/for/master

                                                Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56
$ git push ssh://<login>@<host>:29418/<proj> HEAD:refs/for/master

                                                 Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56
$ git push ssh://<login>@<host>:29418/<proj> HEAD:refs/for/master

                                                 Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56
$ git push ssh://<login>@<host>:29418/<proj> HEAD:refs/for/master

                                                 Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56
$ git push ssh://<login>@<host>:29418/<proj> HEAD:refs/for/master

                                                 Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56
$ git push ssh://<login>@<host>:29418/<proj> HEAD:refs/for/master

                                                 Copyright © 2012 Dariusz Łuksza
Lets create first review request
$ git init
$ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/
$ echo 'first review' > readme.txt
$ git add readme.txt
$ git commit -m 'my first commit'
$ git log
commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152
Author: Dariusz Luksza <dariusz@luksza.org>
Date: Tue Nov 20 11:20:13 2012 +0100

  my first commit

  Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56
$ git push ssh://<login>@<host>:29418/<proj> HEAD:refs/for/master

                                                Copyright © 2012 Dariusz Łuksza
Review change in Web UI



                 m o
           d e
    iv e
L
                    Copyright © 2012 Dariusz Łuksza
Add inline comments



              mo
          d e
 ive
L
                   Copyright © 2012 Dariusz Łuksza
Amend change



           mo
       d e
 ive
L
                 Copyright © 2012 Dariusz Łuksza
Vote on change



           mo
       d e
 ive
L
                  Copyright © 2012 Dariusz Łuksza
Submit change



            mo
        d e
 ive
L
                  Copyright © 2012 Dariusz Łuksza
Gerrit ACL
●   Read
●   Push
●   Push merge commit
●   Push annotated tag
●   Label code review (-2 to +2)
●   Label verified (-1 to +1)
●   Create reference (aka create branch)
●   Abandon
●   Edit topic
●   Forge author identity
●   Forge committer identity
●   Forge server identity
●   Rebase
●   Remove reviewer


                                                Copyright © 2012 Dariusz Łuksza
Gerrit Plugability
●   Plugins
    –   Plugins
    –   Extensions
●   Prolog rules for change validation




                                          Copyright © 2012 Dariusz Łuksza
Review from Eclipse




                      Copyright © 2012 Dariusz Łuksza
Introduction to Gerrit
               Dariusz Łuksza
                 dariusz@luksza.org
                      @dluksza


Useful links:
● Git – http://git-scm.com/

● EGit – http://eclipse.org/egit/

● Gerrit – http://gerrit.googlecode.com/

● Mylyn reviews – http://eclipse.org/reviews/gerrit/

More Related Content

Viewers also liked

Introducing CollabNet TeamForge® 8.0
Introducing CollabNet TeamForge® 8.0Introducing CollabNet TeamForge® 8.0
Introducing CollabNet TeamForge® 8.0CollabNet
 
Don't Let Git Get Your Goat!
Don't Let Git Get Your Goat!Don't Let Git Get Your Goat!
Don't Let Git Get Your Goat!CollabNet
 
Git Gerrit Mit Teamforge
Git Gerrit Mit TeamforgeGit Gerrit Mit Teamforge
Git Gerrit Mit TeamforgeCollabNet
 
Git/Gerrit with TeamForge
Git/Gerrit with TeamForgeGit/Gerrit with TeamForge
Git/Gerrit with TeamForgeCollabNet
 
Enterprise Git Adoption Webinar - German
Enterprise Git Adoption Webinar - GermanEnterprise Git Adoption Webinar - German
Enterprise Git Adoption Webinar - GermanCollabNet
 
Zero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review UpgradeZero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review UpgradeLuca Milanesio
 
How Git and Gerrit make you more productive
How Git and Gerrit make you more productiveHow Git and Gerrit make you more productive
How Git and Gerrit make you more productiveKarsten Dambekalns
 

Viewers also liked (9)

UsersGuide
UsersGuideUsersGuide
UsersGuide
 
Introducing CollabNet TeamForge® 8.0
Introducing CollabNet TeamForge® 8.0Introducing CollabNet TeamForge® 8.0
Introducing CollabNet TeamForge® 8.0
 
Don't Let Git Get Your Goat!
Don't Let Git Get Your Goat!Don't Let Git Get Your Goat!
Don't Let Git Get Your Goat!
 
Git Gerrit Mit Teamforge
Git Gerrit Mit TeamforgeGit Gerrit Mit Teamforge
Git Gerrit Mit Teamforge
 
Git/Gerrit with TeamForge
Git/Gerrit with TeamForgeGit/Gerrit with TeamForge
Git/Gerrit with TeamForge
 
Enterprise Git Adoption Webinar - German
Enterprise Git Adoption Webinar - GermanEnterprise Git Adoption Webinar - German
Enterprise Git Adoption Webinar - German
 
Zero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review UpgradeZero-Downtime Gerrit Code Review Upgrade
Zero-Downtime Gerrit Code Review Upgrade
 
How Git and Gerrit make you more productive
How Git and Gerrit make you more productiveHow Git and Gerrit make you more productive
How Git and Gerrit make you more productive
 
Gerrit Code Review
Gerrit Code ReviewGerrit Code Review
Gerrit Code Review
 

Similar to Gerrit Code Review - The Introduction

Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHubLucas Videla
 
Git Concepts, Commands and Connectivity
Git Concepts, Commands and ConnectivityGit Concepts, Commands and Connectivity
Git Concepts, Commands and ConnectivityRaja Soundaramourty
 
Git Workshop : Git On The Server
Git Workshop : Git On The ServerGit Workshop : Git On The Server
Git Workshop : Git On The ServerWildan Maulana
 
Quick and Dirty Python Deployments with Heroku
Quick and Dirty Python Deployments with HerokuQuick and Dirty Python Deployments with Heroku
Quick and Dirty Python Deployments with HerokuDaniel Pritchett
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlBecky Todd
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitGDSCBMC
 
Build javascript in private environment
Build javascript in private environmentBuild javascript in private environment
Build javascript in private environmentMingtao (Craig) Zhang
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with GitDmitry Sheiko
 
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X ServerYasuhiro Asaka
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger
 
JAZOON'13 - Bartosz Majsak - Git Workshop - Kung Fu
JAZOON'13 - Bartosz Majsak - Git Workshop - Kung FuJAZOON'13 - Bartosz Majsak - Git Workshop - Kung Fu
JAZOON'13 - Bartosz Majsak - Git Workshop - Kung Fujazoon13
 

Similar to Gerrit Code Review - The Introduction (20)

GIT - GOOD PRACTICES
GIT - GOOD PRACTICESGIT - GOOD PRACTICES
GIT - GOOD PRACTICES
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
 
Git internals
Git internalsGit internals
Git internals
 
Git Concepts, Commands and Connectivity
Git Concepts, Commands and ConnectivityGit Concepts, Commands and Connectivity
Git Concepts, Commands and Connectivity
 
Git Workshop : Git On The Server
Git Workshop : Git On The ServerGit Workshop : Git On The Server
Git Workshop : Git On The Server
 
Quick and Dirty Python Deployments with Heroku
Quick and Dirty Python Deployments with HerokuQuick and Dirty Python Deployments with Heroku
Quick and Dirty Python Deployments with Heroku
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Git_real_slides
Git_real_slidesGit_real_slides
Git_real_slides
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version control
 
Git walkthrough
Git walkthroughGit walkthrough
Git walkthrough
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Build javascript in private environment
Build javascript in private environmentBuild javascript in private environment
Build javascript in private environment
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with Git
 
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X Server
 
Git operation 101
Git operation 101Git operation 101
Git operation 101
 
Git presentation
Git presentationGit presentation
Git presentation
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010
 
JAZOON'13 - Bartosz Majsak - Git Workshop - Kung Fu
JAZOON'13 - Bartosz Majsak - Git Workshop - Kung FuJAZOON'13 - Bartosz Majsak - Git Workshop - Kung Fu
JAZOON'13 - Bartosz Majsak - Git Workshop - Kung Fu
 
Becoming a Git Master
Becoming a Git MasterBecoming a Git Master
Becoming a Git Master
 
آموزش کار با GIT
آموزش کار با GITآموزش کار با GIT
آموزش کار با GIT
 

More from Dariusz Łuksza

A story of 715 commits… in ~15 minutes

A story of 715 commits… in ~15 minutes
A story of 715 commits… in ~15 minutes

A story of 715 commits… in ~15 minutes
Dariusz Łuksza
 
Your own full blown Gerrit plugin
Your own full blown Gerrit pluginYour own full blown Gerrit plugin
Your own full blown Gerrit pluginDariusz Łuksza
 
Guiding Diffy to the Enterprise land
Guiding Diffy to the Enterprise landGuiding Diffy to the Enterprise land
Guiding Diffy to the Enterprise landDariusz Łuksza
 
Review your code like a Googler
Review your code like a GooglerReview your code like a Googler
Review your code like a GooglerDariusz Łuksza
 
Eclipse of idleness and focus on current task (rev. 2)
Eclipse of idleness and focus on current task (rev. 2)Eclipse of idleness and focus on current task (rev. 2)
Eclipse of idleness and focus on current task (rev. 2)Dariusz Łuksza
 

More from Dariusz Łuksza (8)

A story of 715 commits… in ~15 minutes

A story of 715 commits… in ~15 minutes
A story of 715 commits… in ~15 minutes

A story of 715 commits… in ~15 minutes

 
One Man App
One Man AppOne Man App
One Man App
 
Your own full blown Gerrit plugin
Your own full blown Gerrit pluginYour own full blown Gerrit plugin
Your own full blown Gerrit plugin
 
Guiding Diffy to the Enterprise land
Guiding Diffy to the Enterprise landGuiding Diffy to the Enterprise land
Guiding Diffy to the Enterprise land
 
Review your code like a Googler
Review your code like a GooglerReview your code like a Googler
Review your code like a Googler
 
Git in Eclipse
Git in EclipseGit in Eclipse
Git in Eclipse
 
Put more eyes on code
Put more eyes on codePut more eyes on code
Put more eyes on code
 
Eclipse of idleness and focus on current task (rev. 2)
Eclipse of idleness and focus on current task (rev. 2)Eclipse of idleness and focus on current task (rev. 2)
Eclipse of idleness and focus on current task (rev. 2)
 

Recently uploaded

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

Gerrit Code Review - The Introduction

  • 1. Introduction to Gerrit Dariusz Łuksza dariusz@luksza.org @dluksza
  • 2. Git?! Copyright © 2012 Dariusz Łuksza
  • 3. What is Gerrit? Git server Gerrit HTTP serverSSH server Copyright © 2012 Dariusz Łuksza
  • 4. Why use code view? ● Early catch of common errors: – NullPoinerException – Code duplication – Deprecated code use – Typos ● Code design review ● Improve team knowledge about project ● Can be used as knowledge base Copyright © 2012 Dariusz Łuksza
  • 5. Who uses Gerrit? Copyright © 2012 Dariusz Łuksza
  • 6. Gerrit @ Eclipse Foundation Copyright © 2012 Dariusz Łuksza
  • 7. What is needed to use it? ● Gerrit server ● git – with additional configuration – proper refspec – commit message hook ● or EGit Copyright © 2012 Dariusz Łuksza
  • 8. What is “refspec”? $ git push <repo_name> <src_branch>:<dst_branch> example: ● $ git push origin fix-npe:master ● $ git push origin fix-npe:refs/for/master or configure this as default push action for repository: $ git configure remote.origin.push HEAD:refs/for/master Or use EGit and “Push to Gerrit” action. Copyright © 2012 Dariusz Łuksza
  • 9. What is “commit hook”? ● Script executed by git after commit operation ● Gerrit commit hook adds Change-Id meta data ● It is project independent so after fetching from server for one project you can copy it locally ● Or use EGit and don't bother about hooks. Copyright © 2012 Dariusz Łuksza
  • 10. Lets create first review request $ git init $ scp -p -P 29418 <host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit 0a60797abd716298c6f6f8eb641451ae507eb9bf Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I871f6b4c500c96f4f7a91abf236f76b00d9057ca $ git push origin HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 11. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit 0a60797abd716298c6f6f8eb641451ae507eb9bf Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I871f6b4c500c96f4f7a91abf236f76b00d9057ca $ git push origin HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 12. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit 0a60797abd716298c6f6f8eb641451ae507eb9bf Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I871f6b4c500c96f4f7a91abf236f76b00d9057ca $ git push origin HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 13. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit 0a60797abd716298c6f6f8eb641451ae507eb9bf Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I871f6b4c500c96f4f7a91abf236f76b00d9057ca $ git push origin HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 14. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit 0a60797abd716298c6f6f8eb641451ae507eb9bf Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I871f6b4c500c96f4f7a91abf236f76b00d9057ca $ git push origin HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 15. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152 Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56 $ git push origin HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 16. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152 Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56 $ git push origin HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 17. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152 Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56 $ git push origin HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 18. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152 Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56 $ git push origin HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 19. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152 Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56 $ git push origin HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 20. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152 Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56 $ git push ssh://<login>@<host>:29418/<proj> HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 21. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152 Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56 $ git push ssh://<login>@<host>:29418/<proj> HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 22. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152 Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56 $ git push ssh://<login>@<host>:29418/<proj> HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 23. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152 Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56 $ git push ssh://<login>@<host>:29418/<proj> HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 24. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152 Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56 $ git push ssh://<login>@<host>:29418/<proj> HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 25. Lets create first review request $ git init $ scp -p -P 29418 <login>@<host>:hooks/commit-msg .git/hooks/ $ echo 'first review' > readme.txt $ git add readme.txt $ git commit -m 'my first commit' $ git log commit e6762c9a59c1bda7118633e4c2ddabf4ecca2152 Author: Dariusz Luksza <dariusz@luksza.org> Date: Tue Nov 20 11:20:13 2012 +0100 my first commit Change-Id: I5e9f2d410fdf37d2e20bedc162b2fb9565988a56 $ git push ssh://<login>@<host>:29418/<proj> HEAD:refs/for/master Copyright © 2012 Dariusz Łuksza
  • 26. Review change in Web UI m o d e iv e L Copyright © 2012 Dariusz Łuksza
  • 27. Add inline comments mo d e ive L Copyright © 2012 Dariusz Łuksza
  • 28. Amend change mo d e ive L Copyright © 2012 Dariusz Łuksza
  • 29. Vote on change mo d e ive L Copyright © 2012 Dariusz Łuksza
  • 30. Submit change mo d e ive L Copyright © 2012 Dariusz Łuksza
  • 31. Gerrit ACL ● Read ● Push ● Push merge commit ● Push annotated tag ● Label code review (-2 to +2) ● Label verified (-1 to +1) ● Create reference (aka create branch) ● Abandon ● Edit topic ● Forge author identity ● Forge committer identity ● Forge server identity ● Rebase ● Remove reviewer Copyright © 2012 Dariusz Łuksza
  • 32. Gerrit Plugability ● Plugins – Plugins – Extensions ● Prolog rules for change validation Copyright © 2012 Dariusz Łuksza
  • 33. Review from Eclipse Copyright © 2012 Dariusz Łuksza
  • 34. Introduction to Gerrit Dariusz Łuksza dariusz@luksza.org @dluksza Useful links: ● Git – http://git-scm.com/ ● EGit – http://eclipse.org/egit/ ● Gerrit – http://gerrit.googlecode.com/ ● Mylyn reviews – http://eclipse.org/reviews/gerrit/