SUBMITTING_PATCHES 3.9 KB

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