This page documents how to submit your changes to us for inclusion.
We manage the submission of patches using the Gerrit code review tool. This tool implements a workflow on top of the Git version control system to ensure that all changes get peer reviewed and tested prior to their distribution.
Browse to http://gerrit.chromium.org/ and complete the registration process. You must register using OpenId. OpenId provides secure single-sign-on, so you don’t need to create a new account or remember another password. If you have a Google account or a Yahoo ID, you’re all set. There are many other OpenID providers available. You may already have an OpenID. OpenID does not reveal your passwords to us.
You will be required to execute a contributor agreement to ensure that the WebM Project has the right to distribute your changes. Individuals can execute the agreement online. Corporations must submit the agreement via mail or fax.
You must have an SSH public key to upload changes to Gerrit. GitHub has some good guides to creating these keys if you haven’t done this before. This is just a guide — you don’t have to sign up for GitHub to contribute to WebM.
Look-up the URL for the project you’d like to work on, listed under pull on our Code page. The URL uses the git:// protocol.
To clone the project repository on your local machine, give a command similar to the following:
$ git clone http://git.chromium.org/webm/libvpx.git ~/working
The above creates a clone of the repo at ~/working/libvpx.
Gerrit requires that each submission include a unique Change-Id. You
can assign one manually using git commit --amend, but it’s easier to
automate it with the commit-msg hook provided by Gerrit.
Copy commit-msg to the .git/config directory of your local repo.
Example:
$ scp -p -P 29418 gerrit.chromium.org:hooks/commit-msg .git/hooks/
See the Gerrit documentation for more information.
Find the correct URL to push to on the main code page and determine the branch you want your change to start on by looking at our repository layout. You can set up your Git and SSH configurations to simplify this command line quite a bit. See the Gerrit documentation for more information. The command you’ll use is of the general form:
$ git push ssh://gerrit.chromium.org:29418/webm/projectname HEAD:refs/for/branchname
If you previously uploaded a change to Gerrit and the Approver has asked for changes, follow these steps:
Edit the files to make the changes the Approver has requested.
Recommit your edits using the --amend flag, for
example:
$ git commit -a --amend
Use the same git push command as above to upload to Gerrit again
for another review cycle.
In general, you should not rebase your changes when doing updates in response to review. Doing so can make it harder to follow the evolution of your change in the diff view.
If your commit does not include a ‘Change-Id:’ line in its commit
message (see commit-msg Hook, above), you’ll have to
add one. Do so by running git commit --amend to edit the
commit message, and then create a ‘Change-Id: I …’ by using the ID
number of the change you’re trying to update, which can be found using
the web UI.
Once your change has been Approved and Verified, you can “submit” it through the Gerrit UI. This will usually automatically merge your change into the branch you specified, creating a new merge commit in Git if neccessary. Sometimes this can’t be done automatically. If you run into this problem, you must rebase or merge your changes manually. We strongly prefer that you rebase your changes instead of merging them. To do so, run:
$ git fetch
$ git rebase origin/branchname
If you get any conflicts, resolve them as you normally would with git. When you’re done, reupload your change.
To check the status of a change that you uploaded, open Gerrit, sign in, and click My > Changes.