Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

Git & Gerrit

dgkim84
July 18, 2012

Git & Gerrit

Git & Gerrit

dgkim84

July 18, 2012
Tweet

More Decks by dgkim84

Other Decks in Technology

Transcript

  1. Gerrit • A Code Review System based on JGit •

    Open source (Apache 2 License) 2 5IVSTEBZ 0DUPCFS 
  2. Git and Gerrit commit Local Repo Working Tree merge Remote

    Repo Gerrit pull/fetch push for review 8 5IVSTEBZ 0DUPCFS 
  3. Git, Gerrit and CI Local Repo commit Working Tree merge

    Remote Repo Gerrit pull/fetch push for review fetch verify 9 5IVSTEBZ 0DUPCFS 
  4. Request for Review Local Repo merge Remote Repo Gerrit pull/fetch

    push for review • Implementing a new feature • Committing them to the repo • Uploading changes to Gerrit 10 5IVSTEBZ 0DUPCFS 
  5. Uploading changes (Simple) 11 $ git init $ git clone

    ssh://[user]@hostname:port/[project] ... $ git push origin HEAD:refs/for/master ... 5IVSTEBZ 0DUPCFS 
  6. Uploading changes (Advanced) 12 $ git push [alias] HEAD:refs/for/[branch] $

    git push \ ssh://[user]@hostname:port/[project] \ HEAD:refs/for/[branch] $ git push [alias] HEAD~1:refs/for/[branch] $ git push [alias] [MD5]:refs/for/[branch] or $ git config remote.[alias].push refs/head/*:refs/for/* $ git push [alias] 5IVSTEBZ 0DUPCFS 
  7. Uploading/Adding Reviewers (Advanced) 14 $ git push [alias] --receive-pack=‘git receive-pack

    \ --reviewer [email 1] --reviewer [email 2] \ --cc [email 3] --cc [email 4]‘ \ HEAD:refs/for/[branch] or $ git config remote.[alias].receivepack \ ‘git receive-pack --reviewer [email 1] \ --cc [email 2]’ $ git push [alias] HEAD:refs/for/[branch] 5IVSTEBZ 0DUPCFS 
  8. Review and Verify merge Remote Repo Gerrit Reviewers a.2 review

    a.1 fetch b.1 fetch b.2 verify 15 5IVSTEBZ 0DUPCFS 
  9. Review merge Remote Repo Gerrit Reviewers a.2 review a.1 fetch

    16 • Fetching the changes • Code review! 5IVSTEBZ 0DUPCFS 
  10. Fetching the changes 18 $ git fetch http://hostname:port/p/[project] \ refs/changes/[last

    two numbers of change id]/ [change id]/[patch id] $ git checkout FETCH_HEAD $ git show HEAD ex) $ git fetch http://reviews.geekple.com/p/memcached \ refs/changes/40/40/2 5IVSTEBZ 0DUPCFS 
  11. Review (Advanced) 19 $ ssh -p [port] [user]@[hostname] gerrit review

    \ --code-review=+1 \ --project=[project] \ [commit or change,patch] 5IVSTEBZ 0DUPCFS 
  12. Verify merge Remote Repo Gerrit b.1 fetch b.2 verify 20

    • -1 when the build fails. • +1 when it passes. 5IVSTEBZ 0DUPCFS 
  13. Verify (Advanced) 21 $ ssh -p [port] [user]@[hostname] gerrit review

    \ --verified=+1 \ --project=[project] \ [commit or change,patch] 5IVSTEBZ 0DUPCFS