Living with Gerrit Bruce Beare Android Architecture Intel Title.

Slides:



Advertisements
Similar presentations
Introduction To GIT Rob Di Marco Philly Linux Users Group July 14, 2008.
Advertisements

1. What is Subversion? Why do we need CM? Basic concepts Repositories Options Setup Clients Options Setup Operation Troubleshooting Slide 2.
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
Source Code Management Or Configuration Management: How I learned to Stop Worrying and Hate My Co-workers Less.
Patterns & practices Symposium 2013 Introducing Git version control into your team Mark
SubVersioN – the new Central Service at DESY by Marian Gawron.
Version Control with git. Version Control Version control is a system that records changes to a file or set of files over time so that you can recall.
1 CSE 390 “Lecture 11” Version control with Git slides created by Ruth Anderson, images from
Introduction to Git and Github Joshua imtraum.com.
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
RMG Study Group Session I: Git, Sphinx, webRMG Connie Gao 9/20/
GIT An introduction to GIT Source Control. What is GIT (1 of 2) ▪ “Git is a free and open source distributed version control system designed to handle.
ITEC 370 Lecture 16 Implementation. Review Questions? Design document on F, feedback tomorrow Midterm on F Implementation –Management (MMM) –Team roles.
Git (Get) it done right! Practical Applied Version Control for Drupal site developers Peter Chen - Stanford School of Engineering Technical Webmaster.
Version Control Systems academy.zariba.com 1. Lecture Content 1.What is Software Configuration Management? 2.Version Control Systems (VCS) 3.Basic Git.
…using Git/Tortoise Git
Git workflow and basic commands By: Anuj Sharma. Why git? Git is a distributed revision control system with an emphasis on speed, data integrity, and.
Information Systems and Network Engineering Laboratory II DR. KEN COSH WEEK 1.
CVS – concurrent versions system Network Management Workshop intERlab at AIT Thailand March 11-15, 2008.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
Introduction to Version Control with Git CSC/ECE 517, Fall 2014 A joint project of the CSC/ECE 517 staff, including Titus Barik, Gaurav Tungatkar, Govind.
By: Anuj Sharma. Topics covered:  GIT Introduction  GIT Benefits over different tools  GIT workflow  GIT server creation  How to use GIT for first.
Sofia Event Center May 2014 Martin Kulov Git For TFS Developers.
GIT.
Intro to Git presented by Brian K. Vagnini Hosted by.
Version Control and SVN ECE 297. Why Do We Need Version Control?
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
© 2015 by Herb Holyst Introduction to git Cytomics Workshop December, 2015.
It’s not just an insult from Harry Potter!. What is Git? Distributed Version Control System (DVCS) – Compared to a Centralized Version Control System.
Information Systems and Network Engineering Laboratory I DR. KEN COSH WEEK 1.
Git How to 1. Why Git To resolve problems in lab exams (accidental deletions) Use existing Libraries with ease (Statistics and Computer) Prepare undergraduates.
Using Git with collaboration, code review, and code management for open source and private projects. & Using Terminal to create, and push commits to repositories.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
Getting Started with Git Presented by Jim Taylor Rooty Hollow, Owner Verizon Wireless, Senior Programmer/Analyst Git User for 6 years.
Collaborative Git An introduction to Git with others
GitHub A web-based Git repository hosting service.
GIT Version control. Version Control Sharing code via a centralized DB Also provides for Backtracking (going back to a previous version of code), Branching.
Adam Young Presented by Senior Software Engineer, Red Hat License Licensed under PKI, Git and SVN.
Git Girish Git VCS that I have used ClearCase, cvs, svn Happy p4 user.
SCMs – What, Why and How? ● Sawyer X ● Sysadmin / Perl Ninja ● User of Subversion, Git ● Your host for this evening ● Oh, and... ● SCMs = Source Code Management.
KIT – University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association STEINBUCH CENTRE FOR COMPUTING - SCC
Basics of GIT for developers and system administrators
CS5220 Advanced Topics in Web Programming Version Control with Git
Introduction to GitHub
M.Sc. Juan Carlos Olivares Rojas
Information Systems and Network Engineering Laboratory II
Proposed IT Infrastructure for TOP OS project
I Don’t Git It: A beginner’s guide to git Presented by Mathew Robinson
Version Control Systems
11 Version control (part 2)
Version Control.
Git for Visual Studio Developers MARTIN KULOV, ASE
Software Engineering for Data Scientists
Macaualy2 Workshop Berkeley 2017
Software Version System Part1: Subversion at CERN
An introduction to version control systems with Git
Distributed Version Control with git
An introduction to version control systems with Git
The Big Picture
An introduction to version control systems with Git
Git CS Fall 2018.
Version Control System - Git
Git started with git: 2018 edition
GitHub 101 Using Github and Git for Source Control
Hop Aboard the Git Train – Transitioning from TFVC
Git Introduction.
Git GitHub.
Introduction to The Git Version Control System
Using GitHub for Papyrus Models Jessie Jewitt – OAM Technology Consulting/ ARM Inc. January 29th, 2018.
Presentation transcript:

Living with Gerrit Bruce Beare Android Architecture Intel Title

Talk Description This talk will present an overview of what Repo and Gerrit can do for you and look at a few of the less obvious but very cool things that you can do to form a more harmonious relationship with Gerrit. Agenda ● Overview of repo and gerrit ● Workflow for developers, reviewers, maintainers ● Branch maintenance ● Fun stuff for the cool kids

Overall Workflow workflow Code Developer Code Reviewer Code Maintainer repo git repository files commit & upload repo / gerrit Server +1 verified -1 failed +1 reviewed -1 failed Review comments … +1 verified -1 failed +1 reviewed -1 failed Review comments … MERGE

Getting Started

Getting Started...

Your initial workspace

Uploading a commit

Revising a commit

Revising a commit...

Frequently used Developer Commands repo init repo sync repo start git status git diff git commit git format-patch repo status repo upload repo prune git commit --amend git rebase -i HEAD^^..HEAD git log

Code Reviewer Use Case Code Reviewer As a code reviewer, I want to quickly check the submission to verify that it conforms to (below) so that I can ensure a higher product quality. ✔ Solves exactly one problem (can bisect) ✔ Architecturally sound ✔ Coding guidelines ✔ Understandable and Maintainable ✔ Doesn’t introduce new bugs ✔ Good commit message ✔ IP ownership

Gerrit home page

Add additional reviewers

Patch set 2

File by file review

Review approval

A more complex commit

Code Maintainer Use Case As a code maintainer, I want to quickly check the submission to verify that it conforms to (below) so that I can include the feature in my repository. ✔ Code reviewers have signed off ✔ Code testers have signed off ✔ Builds ✔ Passes required tests ✔ Merges cleanly Code Maintainer

What is ready to be merged?

View “starred” items

Cherry picking a change

Cherry picking a change...

Super-reviewer and verified

Branch Maintenance Adding a new branch (existing projects) –Requires git or gitosis permission –Create the branch and push Creating a new “git project” –Requires administrative ssh onto the gerrit server –Don't forget to push a “starter” file Adding the new project to your manifest file –The manifest file is in git... just like everything else –Commit and upload the change

Adding a new branch #!/bin/bash OLD_BRANCH=master NEW_BRANCH=my/new/branch/name PROJECTS=(\ [0]=a/aosp/platform/external/hostapd \ ) for p in do echo " " echo "project --- $p ---" DIR=`basename $p` rm -rf $DIR git clone cd $DIR git checkout --track -b ${OLD_BRANCH} origin/${OLD_BRANCH} git checkout -b ${NEW_BRANCH} git push origin ${NEW_BRANCH} cd.. done

Creating a new “git project” #!/bin/bash WHOLE_PROJECT=$1 PROJECT=`basename $1` NEW_FILE=newproject.txt BRANCHES=(\ [0]=gingerbread-stable \ [1]=froyo-prod-bb \ ) ssh gerrit create-project --name ${WHOLE_PROJECT} git clone cd ${PROJECT} touch ${NEW_FILE} git add ${NEW_FILE} git commit -s -m "initial project creation" git push origin master for new_branch in do git checkout -b ${new_branch} git push origin ${new_branch} done

Adding your new project to a manifest file

Adding your new project to a manifest file...

Tricks for the cool kids A little more about manifest files Adding git remotes “repo forall” command Searching with the gerrit interface Using the gerrit command line interface Scripting with “starred” items

A little more about manifest files

Adding git remotes

"repo forall" command repo forall -c git clean -d -f -x repo forall -c git checkout korg/master repo forall build sdk -c 'git am patches/*' repo forall -c 'echo $REPO_PATH'

Searching with the gerrit interface

Using the gerrit command line interface gerrit ls-projects List projects visible to the caller. gerrit query Query the change database. gerrit review Verify, approve and/or submit a patch set from the

Scripting with "starred" items

starred_approve

starred_cherrypick

Further information workflow

Backup...

More than Source Code Management git - Source code management ( Distributed development. Strong support for non-linear development. Efficient handling of large projects. Cryptographic authentication of history. Toolkit design. repo – Manages the many Git repositories ( Manage many Git repositories. Uploads changes to the revision control system. Automates parts of the development work-flow gerrit – Web based code review system ( Graphical User Interface. Designed as a front-end for git (doesn't require repo).

About Git ( Distributed development. Like most other modern version control systems, Git gives each developer a local copy of the entire development history, and changes are copied from one such repository to another. These changes are imported as additional development branches, and can be merged in the same way as a locally developed branch. Repositories can be easily accessed via the efficient Git protocol (optionally wrapped in ssh for authentication and security) or simply using HTTP - you can publish your repository anywhere without any special webserver configuration required. Strong support for non-linear development. Git supports rapid and convenient branching and merging, and includes powerful tools for visualizing and navigating a non-linear development history. Efficient handling of large projects. Git is very fast and scales well even when working with large projects and long histories. It is commonly an order of magnitude faster than most other version control systems, and several orders of magnitude faster on some operations. It also uses an extremely efficient packed format for long- term revision storage that currently tops any other open source version control system. Cryptographic authentication of history. The Git history is stored in such a way that the name of a particular revision (a "commit" in Git terms) depends upon the complete development history leading up to that commit. Once it is published, it is not possible to change the old versions without it being noticed. Also, tags can be cryptographically signed. Toolkit design. Following the Unix tradition, Git is a collection of many small tools written in C, and a number of scripts that provide convenient wrappers. Git provides tools for both easy human usage and easy scripting to perform new clever operations.

About Repo ( Repo is a tool that is built on top of Git. Repo helps us manage the many Git repositories, does the uploads to our revision control system, and automates parts of our development workflow. Repo is not meant to replace Git, only to make it easier to work with Git in the context of a larger development project. The repo command is an executable Python script that you can put anywhere in your path.

About Gerrit ( Gerrit is a web based code review system, facilitating online code reviews for projects using the Git version control system. Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer. Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer. This functionality enables a more centralized usage of Git.