1cd6b1674SKashyap Chamarthy.. _submitting-a-pull-request:
2cd6b1674SKashyap Chamarthy
3cd6b1674SKashyap ChamarthySubmitting a Pull Request
4cd6b1674SKashyap Chamarthy=========================
50ff0dcf6SKashyap Chamarthy
60ff0dcf6SKashyap ChamarthyQEMU welcomes contributions of code, but we generally expect these to be
70ff0dcf6SKashyap Chamarthysent as simple patch emails to the mailing list (see our page on
8cd6b1674SKashyap Chamarthy:ref:`submitting-a-patch`
90ff0dcf6SKashyap Chamarthyfor more details).  Generally only existing submaintainers of a tree
100ff0dcf6SKashyap Chamarthywill need to submit pull requests, although occasionally for a large
110ff0dcf6SKashyap Chamarthypatch series we might ask a submitter to send a pull request. This page
120ff0dcf6SKashyap Chamarthydocuments our recommendations on pull requests for those people.
130ff0dcf6SKashyap Chamarthy
140ff0dcf6SKashyap ChamarthyA good rule of thumb is not to send a pull request unless somebody asks
150ff0dcf6SKashyap Chamarthyyou to.
160ff0dcf6SKashyap Chamarthy
170ff0dcf6SKashyap Chamarthy**Resend the patches with the pull request** as emails which are
180ff0dcf6SKashyap Chamarthythreaded as follow-ups to the pull request itself. The simplest way to
190ff0dcf6SKashyap Chamarthydo this is to use ``git format-patch --cover-letter`` to create the
200ff0dcf6SKashyap Chamarthyemails, and then edit the cover letter to include the pull request
210ff0dcf6SKashyap Chamarthydetails that ``git request-pull`` outputs.
220ff0dcf6SKashyap Chamarthy
230ff0dcf6SKashyap Chamarthy**Use PULL as the subject line tag** in both the cover letter and the
240ff0dcf6SKashyap Chamarthyretransmitted patch mails (for example, by using
250ff0dcf6SKashyap Chamarthy``--subject-prefix=PULL`` in your ``git format-patch`` command). This
260ff0dcf6SKashyap Chamarthyhelps people to filter in or out the resulting emails (especially useful
270ff0dcf6SKashyap Chamarthyif they are only CC'd on one email out of the set).
280ff0dcf6SKashyap Chamarthy
290ff0dcf6SKashyap Chamarthy**Each patch must have your own Signed-off-by: line** as well as that of
300ff0dcf6SKashyap Chamarthythe original author if the patch was not written by you. This is because
310ff0dcf6SKashyap Chamarthywith a pull request you're now indicating that the patch has passed via
320ff0dcf6SKashyap Chamarthyyou rather than directly from the original author.
330ff0dcf6SKashyap Chamarthy
340ff0dcf6SKashyap Chamarthy**Don't forget to add Reviewed-by: and Acked-by: lines**. When other
350ff0dcf6SKashyap Chamarthypeople have reviewed the patches you're putting in the pull request,
360ff0dcf6SKashyap Chamarthymake sure you've copied their signoffs across. (If you use the `patches
370ff0dcf6SKashyap Chamarthytool <https://github.com/stefanha/patches>`__ to add patches from email
380ff0dcf6SKashyap Chamarthydirectly to your git repo it will include the tags automatically; if
390ff0dcf6SKashyap Chamarthyyou're updating patches manually or in some other way you'll need to
400ff0dcf6SKashyap Chamarthyedit the commit messages by hand.)
410ff0dcf6SKashyap Chamarthy
420ff0dcf6SKashyap Chamarthy**Don't send pull requests for code that hasn't passed review**. A pull
430ff0dcf6SKashyap Chamarthyrequest says these patches are ready to go into QEMU now, so they must
440ff0dcf6SKashyap Chamarthyhave passed the standard code review processes. In particular if you've
450ff0dcf6SKashyap Chamarthycorrected issues in one round of code review, you need to send your
460ff0dcf6SKashyap Chamarthyfixed patch series as normal to the list; you can't put it in a pull
470ff0dcf6SKashyap Chamarthyrequest until it's gone through. (Extremely trivial fixes may be OK to
480ff0dcf6SKashyap Chamarthyjust fix in passing, but if in doubt err on the side of not.)
490ff0dcf6SKashyap Chamarthy
500ff0dcf6SKashyap Chamarthy**Test before sending**. This is an obvious thing to say, but make sure
510ff0dcf6SKashyap Chamarthyeverything builds (including that it compiles at each step of the patch
520ff0dcf6SKashyap Chamarthyseries) and that "make check" passes before sending out the pull
530ff0dcf6SKashyap Chamarthyrequest. As a submaintainer you're one of QEMU's lines of defense
540ff0dcf6SKashyap Chamarthyagainst bad code, so double check the details.
550ff0dcf6SKashyap Chamarthy
56*668725ceSAlex Bennée**All pull requests must be signed**. By "signed" here we mean that
57*668725ceSAlex Bennéethe pullreq email should quote a tag which is a GPG-signed tag (as
58*668725ceSAlex Bennéecreated with 'gpg tag -s ...'). See :ref:`maintainer_keys` for
59*668725ceSAlex Bennéedetails.
600ff0dcf6SKashyap Chamarthy
610ff0dcf6SKashyap Chamarthy**Pull requests not for master should say "not for master" and have
620ff0dcf6SKashyap Chamarthy"PULL SUBSYSTEM whatever" in the subject tag**. If your pull request is
630ff0dcf6SKashyap Chamarthytargeting a stable branch or some submaintainer tree, please include the
640ff0dcf6SKashyap Chamarthystring "not for master" in the cover letter email, and make sure the
650ff0dcf6SKashyap Chamarthysubject tag is "PULL SUBSYSTEM s390/block/whatever" rather than just
660ff0dcf6SKashyap Chamarthy"PULL". This allows it to be automatically filtered out of the set of
670ff0dcf6SKashyap Chamarthypull requests that should be applied to master.
680ff0dcf6SKashyap Chamarthy
690ff0dcf6SKashyap ChamarthyYou might be interested in the `make-pullreq
700ff0dcf6SKashyap Chamarthy<https://git.linaro.org/people/peter.maydell/misc-scripts.git/tree/make-pullreq>`__
710ff0dcf6SKashyap Chamarthyscript which automates some of this process for you and includes a few
720ff0dcf6SKashyap Chamarthysanity checks. Note that you must edit it to configure it suitably for
730ff0dcf6SKashyap Chamarthyyour local situation!
74