Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git and Gerrit

alblue
September 30, 2011

Git and Gerrit

alblue

September 30, 2011
Tweet

More Decks by alblue

Other Decks in Technology

Transcript

  1. Git and Gerrit Review tools for Distributed Version Control Systems

    Over The Air, Bletchley Park Alex Blewitt @alblue
  2. Git Git is a Distributed Version Control System Next Generation

    source code management Used by Linux Kernel, Eclipse, Apache ...
  3. Git Commits Git Commits are represented by 40char hash Uniquely

    identifies repository content Stores authorship, commit message and times
  4. Commits point to Trees Similar to directories Directories contain trees

    and blobs Each tree identified by its own hash
  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. 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. 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. 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. 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. 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. 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. Approval Each change can have required flags Number of approvers

    (1, 2, ...) Build success/failure Code coverage thresholds
  13. 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. Team leads Can ensure that team leads have approval Anyone

    can push suggested changes Only subset can review
  15. Merge Nodes Merge nodes combine two or more commits Merge

    nodes can be specifically restricted May encourage linear history
  16. Git and Gerrit Review tools for Distributed Version Control Systems

    Over The Air, Bletchley Park Alex Blewitt @alblue