2
0

submitting-a-pull-request.rst 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. .. _submitting-a-pull-request:
  2. Submitting a Pull Request
  3. =========================
  4. QEMU welcomes contributions of code, but we generally expect these to be
  5. sent as simple patch emails to the mailing list (see our page on
  6. :ref:`submitting-a-patch`
  7. for more details). Generally only existing submaintainers of a tree
  8. will need to submit pull requests, although occasionally for a large
  9. patch series we might ask a submitter to send a pull request. This page
  10. documents our recommendations on pull requests for those people.
  11. A good rule of thumb is not to send a pull request unless somebody asks
  12. you to.
  13. **Resend the patches with the pull request** as emails which are
  14. threaded as follow-ups to the pull request itself. The simplest way to
  15. do this is to use ``git format-patch --cover-letter`` to create the
  16. emails, and then edit the cover letter to include the pull request
  17. details that ``git request-pull`` outputs.
  18. **Use PULL as the subject line tag** in both the cover letter and the
  19. retransmitted patch mails (for example, by using
  20. ``--subject-prefix=PULL`` in your ``git format-patch`` command). This
  21. helps people to filter in or out the resulting emails (especially useful
  22. if they are only CC'd on one email out of the set).
  23. **Each patch must have your own Signed-off-by: line** as well as that of
  24. the original author if the patch was not written by you. This is because
  25. with a pull request you're now indicating that the patch has passed via
  26. you rather than directly from the original author.
  27. **Don't forget to add Reviewed-by: and Acked-by: lines**. When other
  28. people have reviewed the patches you're putting in the pull request,
  29. make sure you've copied their signoffs across. (If you use the `patches
  30. tool <https://github.com/stefanha/patches>`__ to add patches from email
  31. directly to your git repo it will include the tags automatically; if
  32. you're updating patches manually or in some other way you'll need to
  33. edit the commit messages by hand.)
  34. **Don't send pull requests for code that hasn't passed review**. A pull
  35. request says these patches are ready to go into QEMU now, so they must
  36. have passed the standard code review processes. In particular if you've
  37. corrected issues in one round of code review, you need to send your
  38. fixed patch series as normal to the list; you can't put it in a pull
  39. request until it's gone through. (Extremely trivial fixes may be OK to
  40. just fix in passing, but if in doubt err on the side of not.)
  41. **Test before sending**. This is an obvious thing to say, but make sure
  42. everything builds (including that it compiles at each step of the patch
  43. series) and that "make check" passes before sending out the pull
  44. request. As a submaintainer you're one of QEMU's lines of defense
  45. against bad code, so double check the details.
  46. **All pull requests must be signed**. By "signed" here we mean that
  47. the pullreq email should quote a tag which is a GPG-signed tag (as
  48. created with 'gpg tag -s ...'). See :ref:`maintainer_keys` for
  49. details.
  50. **Pull requests not for master should say "not for master" and have
  51. "PULL SUBSYSTEM whatever" in the subject tag**. If your pull request is
  52. targeting a stable branch or some submaintainer tree, please include the
  53. string "not for master" in the cover letter email, and make sure the
  54. subject tag is "PULL SUBSYSTEM s390/block/whatever" rather than just
  55. "PULL". This allows it to be automatically filtered out of the set of
  56. pull requests that should be applied to master.
  57. You might be interested in the `make-pullreq
  58. <https://git.linaro.org/people/peter.maydell/misc-scripts.git/tree/make-pullreq>`__
  59. script which automates some of this process for you and includes a few
  60. sanity checks. Note that you must edit it to configure it suitably for
  61. your local situation!