SlideShare a Scribd company logo
Using Git in Eclipse
http://eclipse.org/egit
Matthias Sohn (SAP)
matthias.sohn@sap.com
+ =
Chris Aniszczyk (Red Hat)
zx@redhat.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 Resources
http://git-scm.com/documentation is your friend
Watch Linus' talk at Google
http://www.youtube.com/watch?v=4XpnKHJAok8
Read the Pro Git book - http://progit.org/book/
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
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
•No central authority!
•Easy offline usage
•Easy to fork a project
•Protected against manipulation by cryptographic hashes
Really good at merging
•Coordination only needed "after the fact”
•Easier to rejoin (or refresh) forked projects
Structured around commits (i.e. patches)
•Integrates with email channel
•Tools for identifying problem commits (git bisect)
•Tools for restructuring branches w/ specific commits
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Projects using Git
… Git is widely used and is the most popular
distributed version control system
Git
Linux
Perl
Gnome
Qt
Ruby on Rails
Android
PostgreSQL
Wine
Fedora
Debian
X.org and so on...
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
Git at Eclipse
EGit and JGit developed at http://egit.eclipse.org
http://git.eclipse.org/
hosts live Eclipse Git repos
Virgo, Mylyn Review, ECF, SWTBot …
http://dev.eclipse.org/git/index.html
git mirrors for CVS
Read-only copies kept up-to-date
Can clone with git:// or http://
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
 Catch bugs early to save hours of debugging
Enforce coding standards
 Keep overall readability & code quality high
Mentoring of new developers
 Learn from mistakes without breaking stuff
Establish trust relationships
 Prepare for more delegation
Good alternative to pair programming
 asynchronous and across locations
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 - Roles
Committer
Formally elected
Can commit own changes without review
Contributor
Small changes
reviewed by committers
Bigger changes
also formal IP review by legal team
in separate protected Bugzilla (IPZilla)
Review Tool
patches attached to bug in Bugzilla
comments in Bugzilla
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
Eclipse – Review Process
Contributors
• create patch using CVS, SVN, Git (since 2009)
• attach patch to bug in Bugzilla
Committers
• do code and IP review
• comment, vote in Bugzilla
• create CQ for changes needing IP review
• commit accepted changes
IP Team
• does IP review bigger changes from contributors
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Eclipse – Review Process
Review not done for all changes
Each Eclipse.org project does it differently
Review tedious for contributors
(and also for committers mentoring contributors)
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
History Gerrit Code Review
Gerrit: 4th Generation code review at Google
Google started code review with a Linux like review
process
• patch based
• tooling based on Perforce CLI
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Google - Web based code review tools
Mondrian (Guido van Rossum)
• based on Perforce, Google infrastructure
• Google proprietary
Rietvield (Guido van Rossum)
• based on Subversion
• Open Source hosted on GoogleApp Engine
Gerrit (Shawn Pearce)
• started as a fork of Rietvield
• based on JGit and GWT
• Open Source (Android)
• Apache 2 license
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
One Branch per Feature
Master branch contains only reviewed and approved changes
• master moves from good to beter state afer each
(approved) change
Each feature branch is based on the Master branch
• stable startng point
A change can really be abandoned because
• no other approved change can depend on a not yet
approved change
• Gerrit will automatcally reject a successor change of an
abandoned change
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Gerrit – Lifecycle of a Change
a
master
topic
1
•
create local topic
branch
•
commit change
•
push it for review
•
do review
•
automated
verification
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Gerrit – Lifecycle of a Change
c
b
a1
2
mastertopic
3
a
master
topic
1
•
create local topic
branch
•
commit change
•
push it for review
•
do review
•
automated
verification
•
refine based on
review
•
push new patchsets
until review votes ok
Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
Gerrit – Lifecycle of a Change
c
b
a1
2
mastertopic
3
a
master
topic
1
•
create local topic
branch
•
commit change
•
push it for review
•
do review
•
automated
verification
•
refine based on
review
•
push new patchsets
until review votes ok
c
b
a1
2
master
topic
3
d
•
Submit may lead to
server-side merge
•
or merge / rebase before
push
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
Gerrit Code Review - Outlook
Upcoming proposal for Mylyn Gerrit Connector
Port from SQL DB to Cassandra
Store review comments as git notes for offline review
Support for change dependencies across repositories
…
Using Git in Eclipse | © 2010 by C. Aniszczyk and 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

PPT
OSGi Versioning & Testing
ODP
ESE 2010: Using Git in Eclipse
PDF
EGit and Gerrit Code Review - Eclipse DemoCamp Bonn - 2010-11-16
PDF
Project52
PDF
How to use any static site generator with GitLab Pages.
KEY
Gerrit Workshop
PPTX
Up GitLab Presentation 2015
PDF
Golang taipei #45 10th birthday
OSGi Versioning & Testing
ESE 2010: Using Git in Eclipse
EGit and Gerrit Code Review - Eclipse DemoCamp Bonn - 2010-11-16
Project52
How to use any static site generator with GitLab Pages.
Gerrit Workshop
Up GitLab Presentation 2015
Golang taipei #45 10th birthday

What's hot (20)

PPTX
Git General
PDF
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
PDF
Gerrit Code Review
PDF
Git Tutorial | Git Basics - Branching, Merging, Rebasing | Learn Git | DevOps...
PDF
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
PPTX
Gerrit is Getting Native with RPM, Deb and Docker
PDF
iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人
PDF
Git for Beginners
PDF
Introducing GitLab (September 2018)
PPTX
[Public] gerrit concepts and workflows
PPTX
Using Git/Gerrit and Jenkins to Manage the Code Review Processord
PDF
如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot
PDF
Git best practices 2016
PPTX
Gerrit Code Review: how to script a plugin with Scala and Groovy
PPTX
Introduction to Git and GitHub Part 1
PPTX
Github copilot
PDF
Webinar - Continuous Integration with GitLab
PPTX
GitLab 8.5 Highlights and Step-by-step tutorial
PDF
Introducing GitLab
PPTX
Write microservice in golang
Git General
iTHome Gopher Day 2017: What can Golang do? (Using project 52 as examples)
Gerrit Code Review
Git Tutorial | Git Basics - Branching, Merging, Rebasing | Learn Git | DevOps...
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
Gerrit is Getting Native with RPM, Deb and Docker
iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人
Git for Beginners
Introducing GitLab (September 2018)
[Public] gerrit concepts and workflows
Using Git/Gerrit and Jenkins to Manage the Code Review Processord
如何透過 Golang 與 Heroku 來一鍵部署 臉書機器人與 Line Bot
Git best practices 2016
Gerrit Code Review: how to script a plugin with Scala and Groovy
Introduction to Git and GitHub Part 1
Github copilot
Webinar - Continuous Integration with GitLab
GitLab 8.5 Highlights and Step-by-step tutorial
Introducing GitLab
Write microservice in golang
Ad

Viewers also liked (20)

PDF
Aftm openbooking 20140602 paris vf
PDF
Apostila ms project 2007 - pet eng. civil ufpr
DOC
Folleto informativo 2013 seguridad nuclear
PDF
Ziveti sa hiv om vodic
PPTX
Presentación junio curso curriculum final
PDF
Sa Sw of Con 13
PPT
Marketing Cultural. Gabriel Klein. 2014
PPT
Act6 slideshare
PDF
Gatopardo Ecuador Agosto 2012
PDF
Subscription to Renewal (PART I - Grontmij)
PDF
Control y supervisión de un proceso electro neumático
PPTX
Protocolos de cifrado
PPT
cv viajar por Europa
DOC
Ejercicios para adelgazar sano
PPT
The 8 Rules Of E Mail Marketing
PPT
Recuperaci�n de costes en la Directiva Marco del Agua
PDF
Arancione Maquila de Nómina - Payrolling 2011
PDF
2015 09 22 Rivanazzano CRS
PDF
Dec 13th qb d in research tel aviv conference preliminary program v7
Aftm openbooking 20140602 paris vf
Apostila ms project 2007 - pet eng. civil ufpr
Folleto informativo 2013 seguridad nuclear
Ziveti sa hiv om vodic
Presentación junio curso curriculum final
Sa Sw of Con 13
Marketing Cultural. Gabriel Klein. 2014
Act6 slideshare
Gatopardo Ecuador Agosto 2012
Subscription to Renewal (PART I - Grontmij)
Control y supervisión de un proceso electro neumático
Protocolos de cifrado
cv viajar por Europa
Ejercicios para adelgazar sano
The 8 Rules Of E Mail Marketing
Recuperaci�n de costes en la Directiva Marco del Agua
Arancione Maquila de Nómina - Payrolling 2011
2015 09 22 Rivanazzano CRS
Dec 13th qb d in research tel aviv conference preliminary program v7
Ad

Similar to Using Git in Eclipse - Eclipse Summit Europe 2010-11-03 (20)

PDF
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
PPTX
Git and Gerrit Code Review - Tech Talk - 2010_09_23
PDF
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
PPT
Understanding and Using Git at Eclipse
PDF
EclipseCon 2010 tutorial: Understanding git at Eclipse
PDF
EclipseCon 2010 talk: Towards contributors heaven
PDF
GitOps Cookbook (Third Early Release) Natale Vinto
KEY
Helios in Action: Git at Eclipse
PPTX
Eclipse Hackers Guide to the Git Universe - Eclipse democamp Vienna 2011-12-02
PPT
Git and Eclipse - Eclipse Helios DemoCamp Jena 2010
PDF
Code Matters - Eclipse Hackers Git Guide - EclipseCon France 2014
PDF
Let's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
PPT
Open up your platform with Open Source and GitHub
PDF
Gitops Cookbook Second Early Release Natale Vinto Alex Soto Bueno
PDF
Unlocking the Cloud operating model with GitHub Actions
PDF
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura
PPTX
Hacktoberfest 2020 - Open source for beginners
PDF
Git_Git_Lab_1664715263.pdf
PPTX
Mini-training: Let’s Git It!
PDF
GitHub Actions in Action MEAP V03 Michael Kaufmann
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Git and Gerrit Code Review - Tech Talk - 2010_09_23
Code Review with Git and Gerrit - Devoxx 2011 - Tools in Action - 2011-11-14
Understanding and Using Git at Eclipse
EclipseCon 2010 tutorial: Understanding git at Eclipse
EclipseCon 2010 talk: Towards contributors heaven
GitOps Cookbook (Third Early Release) Natale Vinto
Helios in Action: Git at Eclipse
Eclipse Hackers Guide to the Git Universe - Eclipse democamp Vienna 2011-12-02
Git and Eclipse - Eclipse Helios DemoCamp Jena 2010
Code Matters - Eclipse Hackers Git Guide - EclipseCon France 2014
Let's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
Open up your platform with Open Source and GitHub
Gitops Cookbook Second Early Release Natale Vinto Alex Soto Bueno
Unlocking the Cloud operating model with GitHub Actions
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura
Hacktoberfest 2020 - Open source for beginners
Git_Git_Lab_1664715263.pdf
Mini-training: Let’s Git It!
GitHub Actions in Action MEAP V03 Michael Kaufmann

More from msohn (20)

PPTX
Project Gardener - EclipseCon Europe - 2018-10-23
PDF
News from Git in Eclipse - EclipseCon EU - 2016-10-26
PDF
Git journey from mars to neon EclipseCon North America - 2016-03-08
PDF
Versioning large binary files with JGit, EGit and Gerrit
PDF
News from Git in Eclipse - EclipseCon 2015 Europe
PPTX
Git missiontomars 2015-03-10
PPTX
News from EGit - Talk EclipseCon Europe 2014 - Ludwigsburg
PDF
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 9 - starting demo gerrit
PDF
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 7 - new changescreen
PDF
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 6 - submit a change
PDF
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 5 - improve a change
PDF
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 4 - review change
PDF
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 3 - push change to gerrit
PDF
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 2 - fetch the latest state
PDF
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 1 - configure for gerrit
PDF
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 8 - view gerrit review ...
PDF
Git Tutorial EclipseCon France 2014 - Git Exercise 07 - git blame
PDF
Git Tutorial EclipseCon France 2014 - Git Exercise 06 - interactive rebase
PDF
Git Tutorial EclipseCon France 2014 - Git Exercise 05 - history view
PDF
Git Tutorial EclipseCon France 2014 - Git Exercise 04 - merging rebasing and ...
Project Gardener - EclipseCon Europe - 2018-10-23
News from Git in Eclipse - EclipseCon EU - 2016-10-26
Git journey from mars to neon EclipseCon North America - 2016-03-08
Versioning large binary files with JGit, EGit and Gerrit
News from Git in Eclipse - EclipseCon 2015 Europe
Git missiontomars 2015-03-10
News from EGit - Talk EclipseCon Europe 2014 - Ludwigsburg
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 9 - starting demo gerrit
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 7 - new changescreen
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 6 - submit a change
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 5 - improve a change
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 4 - review change
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 3 - push change to gerrit
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 2 - fetch the latest state
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 1 - configure for gerrit
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 8 - view gerrit review ...
Git Tutorial EclipseCon France 2014 - Git Exercise 07 - git blame
Git Tutorial EclipseCon France 2014 - Git Exercise 06 - interactive rebase
Git Tutorial EclipseCon France 2014 - Git Exercise 05 - history view
Git Tutorial EclipseCon France 2014 - Git Exercise 04 - merging rebasing and ...

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
cuic standard and advanced reporting.pdf
PPT
Teaching material agriculture food technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Advanced Soft Computing BINUS July 2025.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Modernizing your data center with Dell and AMD
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Big Data Technologies - Introduction.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Transforming Manufacturing operations through Intelligent Integrations
PDF
Chapter 2 Digital Image Fundamentals.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
MYSQL Presentation for SQL database connectivity
Spectral efficient network and resource selection model in 5G networks
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
cuic standard and advanced reporting.pdf
Teaching material agriculture food technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Empathic Computing: Creating Shared Understanding
Reach Out and Touch Someone: Haptics and Empathic Computing
Advanced Soft Computing BINUS July 2025.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Modernizing your data center with Dell and AMD
NewMind AI Weekly Chronicles - August'25 Week I
Big Data Technologies - Introduction.pptx
Electronic commerce courselecture one. Pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Transforming Manufacturing operations through Intelligent Integrations
Chapter 2 Digital Image Fundamentals.pdf
Chapter 3 Spatial Domain Image Processing.pdf
MYSQL Presentation for SQL database connectivity

Using Git in Eclipse - Eclipse Summit Europe 2010-11-03

  • 1. Using Git in Eclipse http://eclipse.org/egit Matthias Sohn (SAP) [email protected] + = Chris Aniszczyk (Red Hat) [email protected]
  • 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 Resources http://git-scm.com/documentation is your friend Watch Linus' talk at Google http://www.youtube.com/watch?v=4XpnKHJAok8 Read the Pro Git book - http://progit.org/book/ Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 4. 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
  • 5. Git … a distributed revision control system built by the Linux project to automate patch workflow Distributed means no central repository •No central authority! •Easy offline usage •Easy to fork a project •Protected against manipulation by cryptographic hashes Really good at merging •Coordination only needed "after the fact” •Easier to rejoin (or refresh) forked projects Structured around commits (i.e. patches) •Integrates with email channel •Tools for identifying problem commits (git bisect) •Tools for restructuring branches w/ specific commits Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 6. Projects using Git … Git is widely used and is the most popular distributed version control system Git Linux Perl Gnome Qt Ruby on Rails Android PostgreSQL Wine Fedora Debian X.org and so on... Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 7. 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
  • 8. Git at Eclipse EGit and JGit developed at http://egit.eclipse.org http://git.eclipse.org/ hosts live Eclipse Git repos Virgo, Mylyn Review, ECF, SWTBot … http://dev.eclipse.org/git/index.html git mirrors for CVS Read-only copies kept up-to-date Can clone with git:// or http:// Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 9. 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
  • 10. 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
  • 11. Demo: A tour of EGit Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 12. Git, EGit and JGit Code Review and Eclipse Gerrit Conclusion Outline Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 13. 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
  • 14. Code Review – Benefits Four eyes catch more bugs  Catch bugs early to save hours of debugging Enforce coding standards  Keep overall readability & code quality high Mentoring of new developers  Learn from mistakes without breaking stuff Establish trust relationships  Prepare for more delegation Good alternative to pair programming  asynchronous and across locations 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
  • 15. Code Review at Eclipse ? Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 16. Eclipse - Roles Committer Formally elected Can commit own changes without review Contributor Small changes reviewed by committers Bigger changes also formal IP review by legal team in separate protected Bugzilla (IPZilla) Review Tool patches attached to bug in Bugzilla comments in Bugzilla Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 17. Code Review via Bugzilla Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 18. Eclipse – Review Process Contributors • create patch using CVS, SVN, Git (since 2009) • attach patch to bug in Bugzilla Committers • do code and IP review • comment, vote in Bugzilla • create CQ for changes needing IP review • commit accepted changes IP Team • does IP review bigger changes from contributors Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 19. Eclipse – Review Process Review not done for all changes Each Eclipse.org project does it differently Review tedious for contributors (and also for committers mentoring contributors) Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 20. Git, EGit and JGit Code Review and Eclipse Gerrit Conclusion Outline Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 21. 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
  • 22. History Gerrit Code Review Gerrit: 4th Generation code review at Google Google started code review with a Linux like review process • patch based • tooling based on Perforce CLI Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 23. Google - Web based code review tools Mondrian (Guido van Rossum) • based on Perforce, Google infrastructure • Google proprietary Rietvield (Guido van Rossum) • based on Subversion • Open Source hosted on GoogleApp Engine Gerrit (Shawn Pearce) • started as a fork of Rietvield • based on JGit and GWT • Open Source (Android) • Apache 2 license Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 24. One Branch per Feature Master branch contains only reviewed and approved changes • master moves from good to beter state afer each (approved) change Each feature branch is based on the Master branch • stable startng point A change can really be abandoned because • no other approved change can depend on a not yet approved change • Gerrit will automatcally reject a successor change of an abandoned change Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 25. Gerrit – Lifecycle of a Change a master topic 1 • create local topic branch • commit change • push it for review • do review • automated verification Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 26. Gerrit – Lifecycle of a Change c b a1 2 mastertopic 3 a master topic 1 • create local topic branch • commit change • push it for review • do review • automated verification • refine based on review • push new patchsets until review votes ok Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 27. Gerrit – Lifecycle of a Change c b a1 2 mastertopic 3 a master topic 1 • create local topic branch • commit change • push it for review • do review • automated verification • refine based on review • push new patchsets until review votes ok c b a1 2 master topic 3 d • Submit may lead to server-side merge • or merge / rebase before push Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 28. Gerrit Workflow Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 30. 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
  • 31. Gerrit Code Review - Outlook Upcoming proposal for Mylyn Gerrit Connector Port from SQL DB to Cassandra Store review comments as git notes for offline review Support for change dependencies across repositories … Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 32. Demo: Code Review with Gerrit Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 33. Git, EGit and JGit Code Review and Eclipse Gerrit Conclusion Outline Using Git in Eclipse | © 2010 by C. Aniszczyk and M. Sohn
  • 34. 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