Shawn O. Pearce | 2d1a396 | 2009-07-02 13:18:42 -0700 | [diff] [blame] | 1 | Short Version: |
| 2 | |
| 3 | - Make small logical changes. |
| 4 | - Provide a meaningful commit message. |
David Pursehouse | 4f7bdea | 2012-10-22 12:50:15 +0900 | [diff] [blame] | 5 | - Check for coding errors with pylint |
Shawn O. Pearce | 2d1a396 | 2009-07-02 13:18:42 -0700 | [diff] [blame] | 6 | - Make sure all code is under the Apache License, 2.0. |
Mark E. Hamilton | b29e611 | 2016-02-16 18:30:44 -0700 | [diff] [blame] | 7 | - Publish your changes for review. |
| 8 | - Make corrections if requested. |
| 9 | - Verify your changes on gerrit so they can be submitted. |
Shawn O. Pearce | 2d1a396 | 2009-07-02 13:18:42 -0700 | [diff] [blame] | 10 | |
David Pursehouse | a43f42f | 2012-08-21 16:26:07 +0900 | [diff] [blame] | 11 | git push https://gerrit-review.googlesource.com/git-repo HEAD:refs/for/master |
Shawn O. Pearce | 2d1a396 | 2009-07-02 13:18:42 -0700 | [diff] [blame] | 12 | |
| 13 | |
| 14 | Long Version: |
| 15 | |
| 16 | I wanted a file describing how to submit patches for repo, |
| 17 | so I started with the one found in the core Git distribution |
| 18 | (Documentation/SubmittingPatches), which itself was based on the |
| 19 | patch submission guidelines for the Linux kernel. |
| 20 | |
| 21 | However there are some differences, so please review and familiarize |
| 22 | yourself with the following relevant bits: |
| 23 | |
| 24 | |
| 25 | (1) Make separate commits for logically separate changes. |
| 26 | |
| 27 | Unless your patch is really trivial, you should not be sending |
| 28 | out a patch that was generated between your working tree and your |
| 29 | commit head. Instead, always make a commit with complete commit |
| 30 | message and generate a series of patches from your repository. |
| 31 | It is a good discipline. |
| 32 | |
| 33 | Describe the technical detail of the change(s). |
| 34 | |
| 35 | If your description starts to get too long, that's a sign that you |
| 36 | probably need to split up your commit to finer grained pieces. |
| 37 | |
| 38 | |
David Pursehouse | 4f7bdea | 2012-10-22 12:50:15 +0900 | [diff] [blame] | 39 | (2) Check for coding errors with pylint |
| 40 | |
| 41 | Run pylint on changed modules using the provided configuration: |
| 42 | |
| 43 | pylint --rcfile=.pylintrc file.py |
| 44 | |
| 45 | |
| 46 | (3) Check the license |
Shawn O. Pearce | 2d1a396 | 2009-07-02 13:18:42 -0700 | [diff] [blame] | 47 | |
| 48 | repo is licensed under the Apache License, 2.0. |
| 49 | |
| 50 | Because of this licensing model *every* file within the project |
| 51 | *must* list the license that covers it in the header of the file. |
| 52 | Any new contributions to an existing file *must* be submitted under |
| 53 | the current license of that file. Any new files *must* clearly |
| 54 | indicate which license they are provided under in the file header. |
| 55 | |
| 56 | Please verify that you are legally allowed and willing to submit your |
| 57 | changes under the license covering each file *prior* to submitting |
| 58 | your patch. It is virtually impossible to remove a patch once it |
| 59 | has been applied and pushed out. |
| 60 | |
| 61 | |
David Pursehouse | 4f7bdea | 2012-10-22 12:50:15 +0900 | [diff] [blame] | 62 | (4) Sending your patches. |
Shawn O. Pearce | 2d1a396 | 2009-07-02 13:18:42 -0700 | [diff] [blame] | 63 | |
| 64 | Do not email your patches to anyone. |
| 65 | |
| 66 | Instead, login to the Gerrit Code Review tool at: |
| 67 | |
Shawn O. Pearce | 9b017da | 2012-02-28 18:53:12 -0800 | [diff] [blame] | 68 | https://gerrit-review.googlesource.com/ |
Shawn O. Pearce | 2d1a396 | 2009-07-02 13:18:42 -0700 | [diff] [blame] | 69 | |
| 70 | Ensure you have completed one of the necessary contributor |
| 71 | agreements, providing documentation to the project maintainers that |
| 72 | they have right to redistribute your work under the Apache License: |
| 73 | |
Shawn O. Pearce | 9b017da | 2012-02-28 18:53:12 -0800 | [diff] [blame] | 74 | https://gerrit-review.googlesource.com/#/settings/agreements |
Shawn O. Pearce | 2d1a396 | 2009-07-02 13:18:42 -0700 | [diff] [blame] | 75 | |
Shawn O. Pearce | 9b017da | 2012-02-28 18:53:12 -0800 | [diff] [blame] | 76 | Ensure you have obtained an HTTP password to authenticate: |
Shawn O. Pearce | 2d1a396 | 2009-07-02 13:18:42 -0700 | [diff] [blame] | 77 | |
Shawn O. Pearce | 9b017da | 2012-02-28 18:53:12 -0800 | [diff] [blame] | 78 | https://gerrit-review.googlesource.com/new-password |
Shawn O. Pearce | 2d1a396 | 2009-07-02 13:18:42 -0700 | [diff] [blame] | 79 | |
Mark E. Hamilton | b29e611 | 2016-02-16 18:30:44 -0700 | [diff] [blame] | 80 | Ensure that you have the local commit hook installed to automatically |
| 81 | add a ChangeId to your commits: |
| 82 | |
| 83 | curl -Lo `git rev-parse --git-dir`/hooks/commit-msg https://gerrit-review.googlesource.com/tools/hooks/commit-msg |
| 84 | chmod +x `git rev-parse --git-dir`/hooks/commit-msg |
| 85 | |
| 86 | If you have already committed your changes you will need to amend the commit |
| 87 | to get the ChangeId added. |
| 88 | |
| 89 | git commit --amend |
| 90 | |
Shawn O. Pearce | 9b017da | 2012-02-28 18:53:12 -0800 | [diff] [blame] | 91 | Push your patches over HTTPS to the review server, possibly through |
Shawn O. Pearce | 2d1a396 | 2009-07-02 13:18:42 -0700 | [diff] [blame] | 92 | a remembered remote to make this easier in the future: |
| 93 | |
Shawn O. Pearce | 9b017da | 2012-02-28 18:53:12 -0800 | [diff] [blame] | 94 | git config remote.review.url https://gerrit-review.googlesource.com/git-repo |
David Pursehouse | a43f42f | 2012-08-21 16:26:07 +0900 | [diff] [blame] | 95 | git config remote.review.push HEAD:refs/for/master |
Shawn O. Pearce | 2d1a396 | 2009-07-02 13:18:42 -0700 | [diff] [blame] | 96 | |
| 97 | git push review |
| 98 | |
| 99 | You will be automatically emailed a copy of your commits, and any |
| 100 | comments made by the project maintainers. |
Mark E. Hamilton | b29e611 | 2016-02-16 18:30:44 -0700 | [diff] [blame] | 101 | |
| 102 | |
| 103 | (5) Make changes if requested |
| 104 | |
| 105 | The project maintainer who reviews your changes might request changes to your |
| 106 | commit. If you make the requested changes you will need to amend your commit |
| 107 | and push it to the review server again. |
| 108 | |
| 109 | |
| 110 | (6) Verify your changes on gerrit |
| 111 | |
| 112 | After you receive a Code-Review+2 from the maintainer, select the Verified |
| 113 | button on the gerrit page for the change. This verifies that you have tested |
| 114 | your changes and notifies the maintainer that they are ready to be submitted. |
| 115 | The maintainer will then submit your changes to the repository. |