Git and Gerrit

B3d3a2cce932eca144b8c13a63966404?s=47 alblue
September 30, 2011

Git and Gerrit



September 30, 2011


  1. 1.

    Git and Gerrit Review tools for Distributed Version Control Systems

    Over The Air, Bletchley Park Alex Blewitt @alblue
  2. 2.

    Git Git is a Distributed Version Control System Next Generation

    source code management Used by Linux Kernel, Eclipse, Apache ...
  3. 3.

    Git Commits Git Commits are represented by 40char hash Uniquely

    identifies repository content Stores authorship, commit message and times
  4. 4.

    Commits point to Trees Similar to directories Directories contain trees

    and blobs Each tree identified by its own hash
  5. 5.

    Trees point to Blobs Blobs represent content Identity based on

    hash of contents Same blob is used wherever used in tree Only one blob for identical content
  6. 8.

    Git Push/Pull Moving data between repositories Git has all-or-nothing ownership

    of data Other tools exist to add control Gitolite, Gitosis, Gerrit
  7. 9.

    Gerrit Gerrit acts as a gatekeeper of a repository Push

    your changes to Gerrit Creates a temporary branch Subsequent changes go to same branch
  8. 10.

    Review Tool Can view pushed branch in a web browser

    Can annotate specific lines Can see diffs between any version of patch Can reject or approve changes
  9. 11.

    Rejecting Changes Add comments to source On a per-line or

    summary basis Mail gets sent out to developer Developer can re-submit with fixes
  10. 12.

    Checking Changes Changes can be compared with previous Check that

    the changes are all done Can check out the version of the branch Gerrit provides ‘fetch’ spec to get data
  11. 13.

    Automated Build Can hook up ‘Gerrit Triggers’ to kick off

    CI Builds the exact version proposed Runs all the tests Can mark a change as ‘bad’ if failed
  12. 14.

    Approval Each change can have required flags Number of approvers

    (1, 2, ...) Build success/failure Code coverage thresholds
  13. 15.

    Submission Change can be automatically brought in Can use merge

    or cherry-picking Can require user to re-submit rebase Submits exactly the content reviewed
  14. 16.
  15. 18.

    Team leads Can ensure that team leads have approval Anyone

    can push suggested changes Only subset can review
  16. 19.

    Merge Nodes Merge nodes combine two or more commits Merge

    nodes can be specifically restricted May encourage linear history
  17. 20.

    Git and Gerrit Review tools for Distributed Version Control Systems

    Over The Air, Bletchley Park Alex Blewitt @alblue