SlideShare a Scribd company logo
Development Process
with EGit and Gerrit
Code Review
http://eclipse.org/egit
http://code.google.com/p/gerrit/Matthias Sohn (SAP)
matthias.sohn@sap.com
+ =
Stefan Lay (SAP)
stefan.lay@sap.com
Learning Git – There's no free lunch!
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
… the purpose of this presentation isn't to teach you Git,
you have to do that yourself!
Git, EGit and JGit
- Demo and Tour of EGit
Code Review at Eclipse
Gerrit
- Demo of Gerrit
Conclusion
Outline
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Git
… a distributed revision control system built by the
Linux project to automate patch workflow
Distributed means no central repository
Really good at merging
Structured around commits (i.e. patches)
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Git at Eclipse
Eclipse defined a roadmap to move to Git in 2009
CVS is deprecated; SVN will be deprecated in the future
EGit is an Eclipse Team provider for Git
http://www.eclipse.org/egit/
JGit is a lightweight Java library implementing Git
http://www.eclipse.org/jgit/
The goal is to build an Eclipse community around Git
EGit and JGit are still beta and we want to establish
a feedback loop to improve the tooling
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
History of JGit and EGit
2005 Linus Torvalds starts Git
2006 Shawn Pearce starts JGit
2009 Eclipse decides for Git Roadmap
JGit/EGit move to eclipse.org
SAP joins JGit/EGit
3/2010 Released 0.7 (first release at Eclipse)
Diff/Merge Algorithms, Automatic IP Logs
6/2010 Released 0.8 (Helios)
Usability Improvements, Git Repositories View, Tagging
9/2010 Released 0.9 (Helios SR1)
Merge, Synchronize View, .gitignore
Planned: 12/2010 0.10 (Helios SR2) 3/2011 0.11 6/2011 1.0 (Indigo)
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Features EGit 0.10
git-add git-format-patch git-shortlog git-relink git-rev-parse
git-am git-gc git-show git-remote git-show-branch
git-archive git-grep git-stash git-repack git-verify-tag
git-bisect git-init git-status git-replace git-whatchanged
git-branch git-log git-submodule git-annotate
git-bundle * git-merge * git-tag * git-blame .gitignore
git-checkout git-mv git-config git-cherry git daemon
git-cherry-pick git-notes git-fast-export git-count-objects Visual merge tool
git-clean  git-pull git-fast-import git-difftool ** HTTP support
git-clone git-push git-filter-branch git-fsck * Mylyn integration
git-commit ** git-rebase git-mergetool git-get-tar-commit-id * Staging View
git-describe git-reset git-pack-refs git-help * Synchronize View
git-diff git-revert git-prune git-merge-tree History View
git-fetch git-rm git-reflog git-rerere Repositories View
** planned for 0.10, * planned for 0.11
supported, partial, missing, irrelevant for EGit
Demo: A tour of EGit
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Git, EGit and JGit
Code Review and Eclipse
Gerrit
Conclusion
Outline
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
What is Peer Code Review?
When one developer writes code, another developer
is asked to review that code
A careful line-by-line critique
Happens in a non-threatening context
Goal is cooperation, not fault-finding
Often an integral part of coding process
Debugging someone else's broken code
– Involuntary code review: Not so good; emotions may flare
Guido van Rossum [1]
[1] http://code.google.com/p/rietveld/downloads/detail?name=Mondrian2006.pdf
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Code Review – Benefits
Four eyes catch more bugs
Enforce coding standards
Mentoring of new developers
Establish trust relationships
Good alternative to pair programming
Guido van Rossum [1]
[1] http://code.google.com/p/rietveld/downloads/detail?name=Mondrian2006.pdf
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Code Review at
Eclipse ?
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Eclipse – Review Process
Contributors
• create patch using CVS, SVN, Git
• attach patch to bug in Bugzilla
Committers
• do code and IP review in Bugzilla
• initiate IP review for changes > 250 loc
• commit accepted changes
IP Team
• does IP reviews
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Code Review via Bugzilla
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Git, EGit and JGit
Code Review and Eclipse
Gerrit
Conclusion
Outline
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Gerrit Code Review
Gerrit is a Code Review system based on JGit
http://code.google.com/p/gerrit/
Also serves as a git server
adding access control and workflow
Used by
• Android https://review.source.android.com/
• JGit, EGit http://egit.eclipse.org/r/
• Google, SAP, …
Eclipse wants to use it …
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Gerrit Workflow
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Gerrit
http://egit.eclipse.org/r/ - change,825Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Code Review – Our Experience
• Review all changes!
• Review takes time (1 day … weeks)
• Implies parallel workflow
• Every team member should do reviews regularly
• Authors have to wait for the review to happen
• Git & Gerrit help a lot here
Code Review | © 2010 by M. Sohn
Demo: Code Review with Gerrit
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Git, EGit and JGit
Code Review and Eclipse
Gerrit
Conclusion
Outline
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Conclusion
EGit and JGit are evolving quickly
Gerrit enables a nice code review workflow
Git supports convenient branching and merging
Git is very fast and scales well
Eclipse and major other OS projects are moving to Git
Git and Gerrit kick ass!
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn

More Related Content

Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23

  • 1. Development Process with EGit and Gerrit Code Review http://eclipse.org/egit http://code.google.com/p/gerrit/Matthias Sohn (SAP) matthias.sohn@sap.com + = Stefan Lay (SAP) stefan.lay@sap.com
  • 2. Learning Git – There's no free lunch! Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn … the purpose of this presentation isn't to teach you Git, you have to do that yourself!
  • 3. Git, EGit and JGit - Demo and Tour of EGit Code Review at Eclipse Gerrit - Demo of Gerrit Conclusion Outline Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 4. Git … a distributed revision control system built by the Linux project to automate patch workflow Distributed means no central repository Really good at merging Structured around commits (i.e. patches) Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 5. Git at Eclipse Eclipse defined a roadmap to move to Git in 2009 CVS is deprecated; SVN will be deprecated in the future EGit is an Eclipse Team provider for Git http://www.eclipse.org/egit/ JGit is a lightweight Java library implementing Git http://www.eclipse.org/jgit/ The goal is to build an Eclipse community around Git EGit and JGit are still beta and we want to establish a feedback loop to improve the tooling Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 6. History of JGit and EGit 2005 Linus Torvalds starts Git 2006 Shawn Pearce starts JGit 2009 Eclipse decides for Git Roadmap JGit/EGit move to eclipse.org SAP joins JGit/EGit 3/2010 Released 0.7 (first release at Eclipse) Diff/Merge Algorithms, Automatic IP Logs 6/2010 Released 0.8 (Helios) Usability Improvements, Git Repositories View, Tagging 9/2010 Released 0.9 (Helios SR1) Merge, Synchronize View, .gitignore Planned: 12/2010 0.10 (Helios SR2) 3/2011 0.11 6/2011 1.0 (Indigo) Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 7. Features EGit 0.10 git-add git-format-patch git-shortlog git-relink git-rev-parse git-am git-gc git-show git-remote git-show-branch git-archive git-grep git-stash git-repack git-verify-tag git-bisect git-init git-status git-replace git-whatchanged git-branch git-log git-submodule git-annotate git-bundle * git-merge * git-tag * git-blame .gitignore git-checkout git-mv git-config git-cherry git daemon git-cherry-pick git-notes git-fast-export git-count-objects Visual merge tool git-clean  git-pull git-fast-import git-difftool ** HTTP support git-clone git-push git-filter-branch git-fsck * Mylyn integration git-commit ** git-rebase git-mergetool git-get-tar-commit-id * Staging View git-describe git-reset git-pack-refs git-help * Synchronize View git-diff git-revert git-prune git-merge-tree History View git-fetch git-rm git-reflog git-rerere Repositories View ** planned for 0.10, * planned for 0.11 supported, partial, missing, irrelevant for EGit
  • 8. Demo: A tour of EGit Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 9. Git, EGit and JGit Code Review and Eclipse Gerrit Conclusion Outline Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 10. What is Peer Code Review? When one developer writes code, another developer is asked to review that code A careful line-by-line critique Happens in a non-threatening context Goal is cooperation, not fault-finding Often an integral part of coding process Debugging someone else's broken code – Involuntary code review: Not so good; emotions may flare Guido van Rossum [1] [1] http://code.google.com/p/rietveld/downloads/detail?name=Mondrian2006.pdf Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 11. Code Review – Benefits Four eyes catch more bugs Enforce coding standards Mentoring of new developers Establish trust relationships Good alternative to pair programming Guido van Rossum [1] [1] http://code.google.com/p/rietveld/downloads/detail?name=Mondrian2006.pdf Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 12. Code Review at Eclipse ? Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 13. Eclipse – Review Process Contributors • create patch using CVS, SVN, Git • attach patch to bug in Bugzilla Committers • do code and IP review in Bugzilla • initiate IP review for changes > 250 loc • commit accepted changes IP Team • does IP reviews Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 14. Code Review via Bugzilla Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 15. Git, EGit and JGit Code Review and Eclipse Gerrit Conclusion Outline Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 16. Gerrit Code Review Gerrit is a Code Review system based on JGit http://code.google.com/p/gerrit/ Also serves as a git server adding access control and workflow Used by • Android https://review.source.android.com/ • JGit, EGit http://egit.eclipse.org/r/ • Google, SAP, … Eclipse wants to use it … Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 17. Gerrit Workflow Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 18. Gerrit http://egit.eclipse.org/r/ - change,825Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 19. Code Review – Our Experience • Review all changes! • Review takes time (1 day … weeks) • Implies parallel workflow • Every team member should do reviews regularly • Authors have to wait for the review to happen • Git & Gerrit help a lot here Code Review | © 2010 by M. Sohn
  • 20. Demo: Code Review with Gerrit Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 21. Git, EGit and JGit Code Review and Eclipse Gerrit Conclusion Outline Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 22. Conclusion EGit and JGit are evolving quickly Gerrit enables a nice code review workflow Git supports convenient branching and merging Git is very fast and scales well Eclipse and major other OS projects are moving to Git Git and Gerrit kick ass! Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn