More Related Content
Similar to Effiziente Entwicklungsprozesse mit Git, EGit und Gerrit - Intland Technology Day Stuttgart 2011/06/08 (20)
Effiziente Entwicklungsprozesse mit Git, EGit und Gerrit - Intland Technology Day Stuttgart 2011/06/08
- 1. Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit http://code.google.com/p/gerrit http://eclipse.org/egit + = Matthias Sohn (SAP) matthias.sohn@sap.com Twitter: @masohn
- 2. Agenda Git – einverteiltesVersionierungssystem Code Review mitGerrit Demo: Entwicklung mit Gerrit Code Review neue Features in EGit Q & A Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2011 by Stefan Lay, Edwin Kempin, SAP AG
- 3. Die Hauptdarsteller GitisteinverteiltesVersionierungssystem EGitisteinEclipse Team Provider fürGit http://www.eclipse.org/egit/ JGitisteineleichtgewichtige Java-BibliothekfürGit http://www.eclipse.org/jgit/ Gerritistein Code-Review-System, basierend auf JGit http://code.google.com/p/gerrit/ Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2011 by Stefan Lay, SAP AG
- 4. Geschichte von Git, JGit und EGit 2005 LinusTorvaldsinitiiertGit 2006 Shawn Pearce initiiert JGit 2009 Eclipse entscheidetsichfürGit JGit/EGit ziehen um nach eclipse.org SAP beteiligtsich JGit/EGit-ProjektebenutzenGerrit 3/2010 JGit/EGit Release 0.7 (erstes Release bei Eclipse) 6/2010 Release 0.8 (Helios) 9/2010 Release 0.9 (Helios SR1) 2010/11 Releases 0.10 – 0.12 3/2011 Eclipse Community Award: Most Innovative new feature 6/2011 Release 1.0 (Eclipse Indigo) Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2010 by Stefan Lay, SAP AG
- 7. Integration in Eclipse, Netbeans, XCodeEffiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2011 by Stefan Lay, Edwin Kempin, SAP AG
- 8. Git – einverteiltesVersionierungssystem Gitversioniert Repositories, nicht Files Added File 1 Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2010 by Stefan Lay, Edwin Kempin, SAP AG
- 10. Version ist global eindeutigüber Hash-Wert (SHA-1)1 Added File 1 Commit Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2011 by Stefan Lay, Edwin Kempin, SAP AG
- 11. Git – einverteiltesVersionierungssystem Gitversioniert Repositories, nicht Files Edited File 1 Added File 2 1 Added File 1 Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2010 by Stefan Lay, Edwin Kempin, SAP AG
- 12. Git – einverteiltesVersionierungssystem Gitversioniert Repositories, nicht Files Edited File 1 Added File 2 2 Commit 1 Added File 1 Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2010 by Stefan Lay, Edwin Kempin, SAP AG
- 13. Git – einverteiltesVersionierungssystem Branches: Zeiger auf Commits Edited File 1 Added File 2 2 master 1 Added File 1 Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2011 by Stefan Lay, Edwin Kempin, SAP AG
- 14. Git – einverteiltesVersionierungssystem Clonen: Duplizieren des Repositories clone Edited File 1 Added File 2 Edited File 1 Added File 2 2 2 master origin/ master 1 1 Added File 1 Added File 1 Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2010 by Stefan Lay, Edwin Kempin, SAP AG
- 15. Git – einverteiltesVersionierungssystem Arbeitenmitlokalen branches feature1 Edited File 1 Added File 2 2 origin/ master 1 Added File 1 Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2010 by Stefan Lay, Edwin Kempin, SAP AG
- 16. Git – einverteiltesVersionierungssystem Arbeitenmitlokalen branches feature1 Edited File 2 3 Edited File 1 Added File 2 2 origin/ master 1 Added File 1 Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2011 by Stefan Lay, Edwin Kempin, SAP AG
- 17. Git – einverteiltesVersionierungssystem Arbeitenmitlokalen branches push stefan feature1 3 3 Edited File 2 Edited File 2 Edited File 1 Added File 2 Edited File 1 Added File 2 2 2 origin/ master master 1 1 Added File 1 Added File 1 Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2011 by Stefan Lay, Edwin Kempin, SAP AG
- 18. Git – einverteiltesVersionierungssystem Wiekommtmein Commit in den zentralen master-branch? stefan feature1 3 3 Edited File 2 Edited File 2 Edited File 1 Added File 2 Edited File 1 Added File 2 2 2 origin/ master master 1 1 Added File 1 Added File 1 Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2011 by Stefan Lay, Edwin Kempin, SAP AG
- 21. Gerrit peer code reviewstefan feature1 3 3 Edited File 2 Edited File 2 Edited File 1 Added File 2 Edited File 1 Added File 2 2 2 origin/ master master 1 1 Added File 1 Added File 1 Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2011 by Stefan Lay, Edwin Kempin, SAP AG
- 26. http Authentifizierung* seit 0.9 Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2010 by Stefan Lay, SAP AG
- 34. Mylyn Integration* seit 0.9 Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2010 by Stefan Lay, SAP AG
- 44. Gerrit Mylyn connector* seit 0.9 Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2010 by Stefan Lay, SAP AG
- 57. GitHub Mylyn connector* seit 0.9 Effiziente Entwicklungsprozesse mit Eclipse, Git und Gerrit | © 2010 by Stefan Lay, SAP AG
- 61. Gerrit Server, der die zentralenGit Repositories verwaltet Gerrit Code Review | © 2010 by M. Sohn
- 70. Code Review – Vorteile Guido van Rossum [1] [1] http://code.google.com/p/rietveld/downloads/detail?name=Mondrian2006.pdf Code Review | © 2010 by M. Sohn
- 71. Code Review – Vorteile Guido van Rossum [1] VierAugenfindenmehr Bugs [1] http://code.google.com/p/rietveld/downloads/detail?name=Mondrian2006.pdf Code Review | © 2010 by M. Sohn
- 72. Code Review – Vorteile Guido van Rossum [1] VierAugenfindenmehr Bugs Einhaltung von Coding Standards [1] http://code.google.com/p/rietveld/downloads/detail?name=Mondrian2006.pdf Code Review | © 2010 by M. Sohn
- 73. Code Review – Vorteile Guido van Rossum [1] VierAugenfindenmehr Bugs Einhaltung von Coding Standards Mentoring von neuenEntwicklern [1] http://code.google.com/p/rietveld/downloads/detail?name=Mondrian2006.pdf Code Review | © 2010 by M. Sohn
- 74. Code Review – Vorteile Guido van Rossum [1] VierAugenfindenmehr Bugs Einhaltung von Coding Standards Mentoring von neuenEntwicklern Etablierung von Vertrauensverhältnissen [1] http://code.google.com/p/rietveld/downloads/detail?name=Mondrian2006.pdf Code Review | © 2010 by M. Sohn
- 75. Code Review – Vorteile Guido van Rossum [1] VierAugenfindenmehr Bugs Einhaltung von Coding Standards Mentoring von neuenEntwicklern Etablierung von Vertrauensverhältnissen Gute Alternative zuPair Programming [1] http://code.google.com/p/rietveld/downloads/detail?name=Mondrian2006.pdf Code Review | © 2010 by M. Sohn
- 76. Gerrit git git git git - verify proposed changes - continuous integration builds - clone repository - fetch / push changes Developer PC Developer PC Hudson git git Copyright © M. Sohn, S. Lay, S. Zivkov, C. Halstrick, C. Aniszczyk, S. Pearce
- 77. Gerrit git git git git master change 12 submit accepted change 12 change 10 change 23 fetch change 23 to try it push improved change 10 fetch master to get updates Developer PC Developer PC git git git git Copyright © M. Sohn, S. Lay, S. Zivkov, C. Halstrick, C. Aniszczyk, S. Pearce
- 81. Gerrit Gerrit = 4. Generation Code Review @ Google Code Review | © 2010 by M. Sohn
- 82. Gerrit Gerrit = 4. Generation Code Review @ Google Open Source mit Apache 2 Lizenz Code Review | © 2010 by M. Sohn
- 83. Gerrit Gerrit = 4. Generation Code Review @ Google Open Source mit Apache 2 Lizenz Gerritbasiert auf JGit und GWT Code Review | © 2010 by M. Sohn
- 84. Gerrit Gerrit = 4. Generation Code Review @ Google Open Source mit Apache 2 Lizenz Gerritbasiert auf JGit und GWT Storage: JGit & DB Code Review | © 2010 by M. Sohn
- 85. Gerrit Gerrit = 4. Generation Code Review @ Google Open Source mit Apache 2 Lizenz Gerritbasiert auf JGit und GWT Storage: JGit & DB wird ersetzt durch JGit only (erster Teil mit Gerrit 2.2) optional: JGit on distributed hashtable (HBase) -> scalable Gerrit on the Cloud Code Review | © 2010 by M. Sohn
- 86. Gerrit Gerrit = 4. Generation Code Review @ Google Open Source mit Apache 2 Lizenz Gerritbasiert auf JGit und GWT Storage: JGit & DB wird ersetzt durch JGit only (erster Teil mit Gerrit 2.2) optional: JGit on distributed hashtable (HBase) -> scalable Gerrit on the Cloud demnächst: Prolog rule engine für konfigurierbare Workflows Web app -> OSGi app for pluggable functionality Code Review | © 2010 by M. Sohn
- 92. 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
- 93. Code Review – Tips Small changes are much easier to review A change should logically do one thing (not many) No change shall break build or tests Split big changes into series of digestible changes (patch series) - These changes depend on each other - Last change should switch the new feature on Commit message should explain Why - The What should be obvious from the code change Code Review | © 2010 by M. Sohn
- 94. Conclusion Code Review rocks ! Gerrit enables a nice code review workflow DVCS like Git are powerful Git supports convenient branching and merging Gitis very fast and scales well Code Review | © 2010 by M. Sohn
- 95. Gerrit Code Review Gerrit developed at http://code.google.com/p/gerrit https://review.source.android.com/Gerrit for Android projects (also Gerrit) Code Review | © 2010 by M. Sohn
- 96. Git at Eclipse EGit/JGit developed at http://egit.eclipse.org http://git.eclipse.org/hosts live Eclipse Git repos Virgo, Mylyn Review, ScalaModules, 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:// Code Review | © 2010 by M. Sohn
- 97. 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 git-checkout git-mv git-config git-cherry .gitignore git-cherry-pick git-notes git-fast-export git-count-objects git daemon git-clean git-pull git-fast-import git-difftool HTTP support git-clone git-push git-filter-branch git-fsck Mylynintegration 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 Features EGit 1.0 * planned for next release, supported, partial, missing, irrelevant for EGit
- 98. Git Resources Ask questions on the EGit forum or egit-dev/jgit-dev lists http://git-scm.com/documentation is your friend If you want comedy, watch Linus' talk at Google http://www.youtube.com/watch?v=4XpnKHJAok8 Read the Pro Git book - http://progit.org/book/ Code Review | © 2010 by M. Sohn
- 99. Gerrit Code Review - Outlook MylynGerrit Connector in incubation Port from SQL DB to HBase Git Store: Store review comments as git notes for offline review Support for change dependencies across repositories … Code Review | © 2010 by M. Sohn