Eclipse Hacker's Guide to the Git Universe
Upcoming SlideShare
Loading in...5
×
 

Eclipse Hacker's Guide to the Git Universe

on

  • 2,218 views

Slides for Git Tutorial held at EclipseCon Europe 2011-11-02 in Ludwigsburg

Slides for Git Tutorial held at EclipseCon Europe 2011-11-02 in Ludwigsburg

Statistics

Views

Total Views
2,218
Views on SlideShare
2,161
Embed Views
57

Actions

Likes
3
Downloads
39
Comments
0

2 Embeds 57

http://twiki.wrs.com 49
http://wiki.wrs.com 8

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

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

    Eclipse Hacker's Guide to the Git Universe Eclipse Hacker's Guide to the Git Universe Presentation Transcript

    • Eclipse Hacker’s Guide to the Git Universe Tutorial EclipseCon 2011 http://eclipse.org/jgit http://eclipse.org/egit http://code.google.com/p/gerrit Matthias Sohn (SAP) Stefan Lay (SAP) Chris Aniszczyk (Twitter) Kevin Sawicki (GitHub) Benjamin Muskalla (Tasktop) Sasa Zivkov(SAP) background photo courtesy of NASA http://www.nasa.gov/multimedia/guidelines/index.html
    • Agenda Introduction Setup and Cloning the Sample Repository Local Development with EGit Gerrit Code Review Mylyn Integration GitHub Eclipse Support Q & A Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Git
      • … a distributed revision control system built by the Linux project to facilitate code review
      • Distributed means no central repository
        • No central authority!
        • Easy offline usage
        • Easy to branch a project
        • Protected against manipulation by cryptographic hashes
      • Really good at merging
        • Coordination only needed "after the fact”
        • Easier to rejoin (or refresh) branches
      • Structured around commits (i.e. patches)
        • Tools for identifying problem commits (git bisect)
        • Tools for restructuring branches w/ specific commits
      Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Git at Eclipse
      • JGit is a lightweight Java library implementing Git
        • http://www.eclipse.org/jgit/
      • EGit is an Eclipse Team provider for Git based on JGit
        • http://www.eclipse.org/egit/
      • Gerrit Code Review is a Git server based on JGit adding permission control and review workflow
        • http://code.google.com/p/gerrit
        • Denis is on the way to setup Gerrit@Eclipse :-)
      Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Git at Eclipse Eclipse is moving to Git CVS has been deprecated and will be retired 2012-12-21 project / code repository break down as of 2011-10-31 http://eclipse.org/projects/scmcountdown.php Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Modern Code Review – What is it ?
        • 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
        • Integral part of coding process
        • Otherwise this will happen:
        • 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 Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Code Review – Benefits
        • Four eyes catch more bugs
          • Catch bugs early to save hours of debugging
        • Mentoring of new developers / contributors
          • Learn from mistakes without breaking stuff
        • Establish trust relationships
          • Prepare for more delegation
        • Good alternative to pair programming
          • asynchronous and across locations
        • Coding standards
          • Keep overall readability & code quality high
      Guido van Rossum [1] [1] http://code.google.com/p/rietveld/downloads/detail?name=Mondrian2006.pdf Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Developer PC Gerrit git git git git Developer PC git git Hudson - clone repository - fetch / push changes - verify proposed changes - continuous integration builds Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Developer PC git git Gerrit git git git git push improved change 10 Developer PC git git fetch change 23 to try it master change 12 change 10 change 23 submit accepted change 12 fetch master to get updates Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Exercises   1 Setup and Cloning Sample Repository     Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Local Development with EGit Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Exercises: Local Development with EGit   2 Develop a feature/bug fix   3 Work on branches in parallel   4 Merge, Rebase, Resolve Conflicts   5 Change a series of commits     Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Gerrit Code Review Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Gerrit Architecture
      • Gerrit = Git server 
      •              + Access Permissions 
      •              + Web UI
        • Git based code review system
        • Hosts many Git repositories
        • Speaks Git protocol
          • no Gerrit client installation required
        • Provides per-project Access Permissions
        • Web interface for Code Review
          • implemented using GWT
      Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • When does Code Review Happen?
        • Code Review happens before changes reach the code base
        • Buggy changes discovered and fixed before the change gets merged
        • Only completed changes reach the project history
          • reviewers reject unfinished changes
        • Only well described changes reach the code base
          • commit message is also subject of the review
        • Project history clean and usable
      Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Integration with EGit
        • Since Gerrit is a Git (server) any Git implementation can work with Gerrit
        • However, EGit provides some extra features to make work with Gerrit more comfortable
          • fetching a change from Gerrit based on its ID
          • automatic "push to Gerrit" configuration when cloning a Git repo from Gerrit
        • Mylyn Reviews has a Gerrit connector (see next part)
      Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Exercises: Gerrit Code Review   6.1 Push a Change to Gerrit   6.2 Review a Change   6.3 Improve a Change   6.4 Submit a Change to the Codebase     Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Mylyn Integration Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • 90% Irrelevant Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Task-focused IDE Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • < Demo > Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Exercises: Mylyn Integration   7.1 Mylyn / EGit Integration   7.2 Use Gerrit from within the IDE    Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • GitHub Eclipse Support Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • GitHub Eclipse Support
        • https://github.com/eclipse
          • 176 mirrored repositories
        • Browsing source code
        • Comparing branches and tags
        • Activity feeds
        • Charts & Graphs
        • Downloading snapshots
      Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • GitHub Eclipse Support
    • GitHub EGit Integration
        • GitHub Mylyn Connector
          • Issues
          • Gists
          • Pull Requests
          • Import Wizard
        • GitHub Java API
          • Maven plugins
          • Reporting
          • Automating tasks
      Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Exercises: GitHub/Eclipse Integration   8 Setup Share on GitHub    Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov
    • Q&A Copyright © C. Aniszczyk, S. Lay, B. Muskalla, K. Sawicki, M. Sohn, S. Zivkov