opensource.google.com

Menu

Docs

Open Source Patching

Common rules

For all patches to open source projects:

  • If patching a project on GitHub, you must register your GitHub ID at go/github first.

  • Please associate your commit with your google.com email unless you have a history of contributing to the repo under a different email before your employment at Google. How to associate your commit with a google.com email.

  • Optional: you may add Google LLC as a project author in the AUTHORS file. This helps provide visibility into Google/Googlers’ contributions to open source.

There is no limit on the size or complexity of a patch, but if the patch is less than or equal to 100 lines of code, refer to the Snippets policy below. Please recall that Google will claim copyright and other ownership rights over your patches.

Patches

Patches that don’t require any review!

You may submit your patch for any of the following repos without using the form at the bottom of this page. No review required! You must still follow the common rules.

  • Any project which is a public repo on GitHub, and is under the Apache 2, MIT, BSD, LGPL*, GPL*, MPL, EPL, ISC, CC-BY, CC-BY-SA, OFL, MS-PL, Boost Software License, or Artistic licenses, and does not not require you to sign anything not found on the pre-approved CLA list below.

  • Any repo for which you’ve already been given blanket approval from OSPO or used the approval form once.

  • Any Google-maintained open source project like Chromium, Android, Go, etc.

These exceptions to the review requirement exist regardless of the length of the patch.

Forbidden patches

You can’t patch projects with any of the following licenses:

  • No License
  • WTFPL
  • AGPL
  • CC0 (not OSI approved)
  • CC BY-NC-* (this restricts Google’s access to that code)
  • Private repositories (unless under a written agreement between Google and a third party)

See go/whatisalicense for more information on licenses.

You can’t sync .vimrc and other dot files between your Google workstation or Google laptop and GitHub. Too much internal info has been leaked this way. You may only import dot files into Google. To set up a personal Git repository for your Google dot files, see go/gob-user.

The following patches are not allowed without SVP approval. Please obtain SVP approval by email and forward it to emailremoved@. You may also email emailremoved@ with any questions.

List of patch types removed.

Use the form for all other patches, but only once per repo.

IMPORTANT: You must go through this process (and submit the form if necessary) before sharing a patch externally (i.e. pushing it to GitHub or another non-Google repository or emailing it outside the company.)

You only need to go through this process once per repository. But remember that the common rules apply to all patches.

CLAs

IMPORTANT: You can’t sign Contributor License Agreements (CLAs) for any companies or projects not listed below. If you want to sign an unlisted CLA, email it to emailremoved@ for review.

Google already has CLAs on file with:

List of on-file CLAs removed.

You may sign the Pre-Approved Individual CLAs listed below:

List of OK to sign individual CLAs removed.

Google requires CLAs for our own projects, but Googlers should never need to sign them. If you are being prompted to sign it, see go/cla#googlers to make sure you are recognized as a Googler.

Things which aren’t patches

<= 100 lines of code

In addition to patches to existing open source projects, you may use the patching form for self contained code or snippets if ALL of the following are true:

  • Posted to a presentation, GitHub gist, pastebin, mailing list, web forum, chat room (e.g. IRC, Slack), etc.
  • Is a self-contained unit. (e.g. not split into multiple attachments.)
  • NOT more than 100 lines of code.
  • NOT checked into a repository as the sharing mechanism.

If any of the above are not satisfied, you must follow go/releasing.

IMPORTANT: You must add the following header:

Copyright 2018 Google LLC.
SPDX-License-Identifier: Apache-2.0

These do not require human review, so you can check the instant approval box on the form.

If you have a more substantial piece of code (i.e. closer to 100 lines than to 10) or it’s otherwise non-disruptive, you are encouraged to include the full Apache license header instead of the SPDX-License-Identifier tag.

Administering open source repositories

If you are an administrator of an open source repository, you may continue to do administrative work such as accept pull requests, respond to comments, open and close issues, and other admin work without using this form.

Stack Overflow

You can answer questions on Stack Overflow without using this form, but you still must add the appropriate headers to your code snippets:

Copyright 2018 Google LLC.
SPDX-License-Identifier: Apache-2.0

Forking on GitHub

You are permitted fork a repository on GitHub to youruser/reponame for the purpose of submitting a pull request to an existing open source repository. You must follow the instructions on this page when pushing any changes to the temporary repository.

In order to create an permanent repository, you must proceed through go/releasing.

Submit your patch

Include the first 150 lines of the patch. This can be generated using git format-patch -n HEAD~1 --stdout | head -n 150 or a similar command, and should include the author line containing your google.com email.

Embedded form removed. It asks for a pointer to the code, the license, and the first 150 lines of the patch.

Except as otherwise noted, the content of this page is licensed under CC-BY-4.0 license. Third-party product names and logos may be the trademarks of their respective owners.