Converted Gerrit.md
diff --git a/Gerrit.wiki b/Gerrit.md similarity index 65% rename from Gerrit.wiki rename to Gerrit.md index f3cb0d9..086645e 100644 --- a/Gerrit.wiki +++ b/Gerrit.md
@@ -1,70 +1,67 @@ -#summary Gerrit and Melange -#labels Featured,Importance-Featured - -= Introduction = +# Introduction Melange uses Gerrit for code review. -= Setup = +# Setup -{{{ +``` # setup push-for-review helper alias git config --global alias.push-for-review '!CURRENT=$(git symbolic-ref --short HEAD) && git push origin ${1:-HEAD}:refs/for/master%topic=${CURRENT}${R:+,r=${R}} && echo pushed' # add change-id hook curl -Lo `git rev-parse --git-dir`/hooks/commit-msg https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x `git rev-parse --git-dir`/hooks/commit-msg -}}} +``` * Log into the Gerrit UI at least once: https://melange-review.googlesource.com * if the email address in your git commits doesn't line up with the account you log into Gerrit with, you must add that email address: https://melange-review.googlesource.com/#/settings/contact * If you are a committer, you need to get added to the committer list in Gerrit. -= Code Review = +# Code Review -== Reviewing your branch == - # Create a topic branch, work on your change, commit your change. - # git push-for-review - # in the Gerrit web UI, explicitly add at least one reviewer - # review happens. - # if changes are necessary, commit, rebase, go back to step 2. +## Reviewing your branch + 1. Create a topic branch, work on your change, commit your change. + 1. git push-for-review + 1. in the Gerrit web UI, explicitly add at least one reviewer + 1. review happens. + 1. if changes are necessary, commit, rebase, go back to step 2. -== Syncing and preparing your branch == - # pull the latest changes to master - * git checkout master - * git pull origin master - # rebase your branch on master git rebase master and fix possible conflicts on the way - * git checkout your-branch - * git rebase master - # git push-for-review - # if the rebase cleared the review approvals, ask the reviewers for another look. Otherwise, the changes are almost ready to be submitted - # locally merge your branch into master - * git checkout master - * git merge your-branch +## Syncing and preparing your branch + 1. pull the latest changes to master + * git checkout master + * git pull origin master + 1. rebase your branch on master git rebase master and fix possible conflicts on the way + * git checkout your-branch + * git rebase master + 1. git push-for-review + 1. if the rebase cleared the review approvals, ask the reviewers for another look. Otherwise, the changes are almost ready to be submitted + 1. locally merge your branch into master + * git checkout master + * git merge your-branch -= git push-for-review = +# git push-for-review The push-for-review alias supports some variations: if you set an 'R' environment variable, that becomes a reviewer. -{{{ +``` R=john.smith@gmail.com git push-for-review -}}} +``` You can also specify a change to push: -{{{ +``` git push-for-review a1b2c3 -}}} +``` -== Submitting the code == +## Submitting the code - # get code reviewed by someone else, and receive a +2 - # click submit button in web ui + 1. get code reviewed by someone else, and receive a +2 + 1. click submit button in web ui -== Personal Branches == +## Personal Branches Please name personal branches user/$USERNAME/$BRANCHNAME -= Etiquette = +# Etiquette * Do not assume that someone will re-review your change unless you make a comment like "please look again" or "re-review me" or similar. (Rationale: Because of the volume of email Gerrit sends, some people may filter out the "new change has been uploaded emails" -- and a new change being uploaded doesn't mean the Change is ready for review anyway.) * If you have commit rights, do not submit someone else's change without a good reason. These might include: @@ -73,6 +70,6 @@ * The change is urgent and simple (i.e. build fix) and can't wait. * In general, please do do not click Submit on other people's changes without permission from the author. -= Interesting Links = +# Interesting Links * https://wiki.openstack.org/wiki/Gerrit_Workflow \ No newline at end of file