• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Gerrit Code Review - The Introduction
 

Gerrit Code Review - The Introduction

on

  • 444 views

Short introduction to Gerrit Code Review

Short introduction to Gerrit Code Review

Statistics

Views

Total Views
444
Views on SlideShare
444
Embed Views
0

Actions

Likes
0
Downloads
10
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Gerrit Code Review - The Introduction Gerrit Code Review - The Introduction Presentation Transcript

    • Introduction to Gerrit Dariusz Łuksza dariusz@luksza.org @dluksza
    • Git?! Copyright © 2012 Dariusz Łuksza
    • What is Gerrit? Git server GerritHTTP 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/masteror configure this as default push action for repository:$ git configure remote.origin.push HEAD:refs/for/masterOr 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 dont 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 logcommit 0a60797abd716298c6f6f8eb641451ae507eb9bfAuthor: 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 logcommit 0a60797abd716298c6f6f8eb641451ae507eb9bfAuthor: 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 logcommit 0a60797abd716298c6f6f8eb641451ae507eb9bfAuthor: 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 logcommit 0a60797abd716298c6f6f8eb641451ae507eb9bfAuthor: 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 logcommit 0a60797abd716298c6f6f8eb641451ae507eb9bfAuthor: 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 logcommit e6762c9a59c1bda7118633e4c2ddabf4ecca2152Author: 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 logcommit e6762c9a59c1bda7118633e4c2ddabf4ecca2152Author: 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 logcommit e6762c9a59c1bda7118633e4c2ddabf4ecca2152Author: 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 logcommit e6762c9a59c1bda7118633e4c2ddabf4ecca2152Author: 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 logcommit e6762c9a59c1bda7118633e4c2ddabf4ecca2152Author: 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 logcommit e6762c9a59c1bda7118633e4c2ddabf4ecca2152Author: 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 logcommit e6762c9a59c1bda7118633e4c2ddabf4ecca2152Author: 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 logcommit e6762c9a59c1bda7118633e4c2ddabf4ecca2152Author: 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 logcommit e6762c9a59c1bda7118633e4c2ddabf4ecca2152Author: 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 logcommit e6762c9a59c1bda7118633e4c2ddabf4ecca2152Author: 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 logcommit e6762c9a59c1bda7118633e4c2ddabf4ecca2152Author: 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 eL Copyright © 2012 Dariusz Łuksza
    • Add inline comments mo d e iveL Copyright © 2012 Dariusz Łuksza
    • Amend change mo d e iveL Copyright © 2012 Dariusz Łuksza
    • Vote on change mo d e iveL Copyright © 2012 Dariusz Łuksza
    • Submit change mo d e iveL 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 @dlukszaUseful links:● Git – http://git-scm.com/● EGit – http://eclipse.org/egit/● Gerrit – http://gerrit.googlecode.com/● Mylyn reviews – http://eclipse.org/reviews/gerrit/