[ << Working with source code ] | [Top][Contents][Index][ ? ] | [ Compiling >> ] | ||
[ < Emailing patches ] | [ Up : Basic Git procedures ] | [ The patch review cycle > ] |
3.3.6 Uploading a patch for review
Any non-trivial change should be uploaded to our “Rietveld” code review website:
http://codereview.appspot.com/
You can upload a patch for review by using our custom git-cl
‘helper-script’. This section assumes you have already installed,
updated, and configured git-cl
. See git-cl.
Note: Unless you are familiar with branches, only work on one set of changes at once.
There are two methods, depending on your git setup.
-
Master branch: (easy option)
If you added your patch to
master
, then:git pull -r git-cl upload origin/master
If you have git push ability, make sure that you remove your patch (with
git rebase
orgit reset
) before pushing other stuff.Notifications of patches are automatically added to our issue tracker to reduce the chance of patches getting lost. To suppress this (not recommended), add the
-n / --no-code-issue
option. -
Separate branch: (complicated option)
Ensure your changes are committed in a separate branch, which should differ from the reference branch to be used (usually
origin/master
) by just the changes to be uploaded. Checkout the branch with the changes:git checkout some-branch-with-changes
If the reference branch is to be
origin/master
, ensure that the branch containing the changes is up-to-date with it. Usegit rebase
orgit pull -r
to rebase the branch to the head oforigin/master
. For example:git pull -r origin master
Finally, start the upload by entering:
git-cl upload <reference SHA1 ID>
where <reference SHA1 ID> is the SHA1 ID of the commit to be used as a reference source for the patch. Generally, this will be the SHA1 ID of origin/master, and in that case you can just use the command:
git-cl upload origin/master
First you will see a terminal editor where you can edit the
message that will accompany your patch. git-cl
will
respect the EDITOR
environment variable if defined,
otherwise it will use vi
as the default editor.
After prompting for your Google email address and password, the patch set will be posted to Rietveld, and you will be given a URL for your patch.
Note: Some installations of git-cl fail when uploading a patch with certain filename extensions. If this happens, it can generally be fixed by editing the list of exceptions at top of ‘git-cl.py’.
Announcing your patch set
You should then announce the patch by logging into the code review issue webpage and using “Publish + Mail Comments” to add a (mostly bogus) comment to your issue. The text of your comment will be sent to our developer mailing list.
Note: There is no automatic notification of a new patch; you must add a comment yourself.
Revisions
As revisions are made in response to comments, successive patch sets for the same issue can be uploaded by reissuing the git-cl command with the modified branch checked out.
Sometimes in response to comments on revisions, the best way to work may require creation of a new branch in git. In order to associate the new branch with an existing Rietveld issue, the following command can be used:
git-cl issue issue-number
where issue-number
is the number of the existing Rietveld
issue.
Resetting git-cl
If git-cl
becomes confused, you can “reset” it by
running:
git-cl issue 0
[ << Working with source code ] | [Top][Contents][Index][ ? ] | [ Compiling >> ] | ||
[ < Emailing patches ] | [ Up : Basic Git procedures ] | [ The patch review cycle > ] |