xref: /openbmc/qemu/docs/devel/submitting-a-pull-request.rst (revision 0ff0dcf6b5292e044985c38cbd83a57485ca887c)
1*0ff0dcf6SKashyap ChamarthySubmit a Pull Request
2*0ff0dcf6SKashyap Chamarthy=====================
3*0ff0dcf6SKashyap Chamarthy
4*0ff0dcf6SKashyap ChamarthyQEMU welcomes contributions of code, but we generally expect these to be
5*0ff0dcf6SKashyap Chamarthysent as simple patch emails to the mailing list (see our page on
6*0ff0dcf6SKashyap Chamarthy`submitting a patch
7*0ff0dcf6SKashyap Chamarthy<https://qemu-project.gitlab.io/qemu/devel/submitting-a-patch.html>`__
8*0ff0dcf6SKashyap Chamarthyfor more details).  Generally only existing submaintainers of a tree
9*0ff0dcf6SKashyap Chamarthywill need to submit pull requests, although occasionally for a large
10*0ff0dcf6SKashyap Chamarthypatch series we might ask a submitter to send a pull request. This page
11*0ff0dcf6SKashyap Chamarthydocuments our recommendations on pull requests for those people.
12*0ff0dcf6SKashyap Chamarthy
13*0ff0dcf6SKashyap ChamarthyA good rule of thumb is not to send a pull request unless somebody asks
14*0ff0dcf6SKashyap Chamarthyyou to.
15*0ff0dcf6SKashyap Chamarthy
16*0ff0dcf6SKashyap Chamarthy**Resend the patches with the pull request** as emails which are
17*0ff0dcf6SKashyap Chamarthythreaded as follow-ups to the pull request itself. The simplest way to
18*0ff0dcf6SKashyap Chamarthydo this is to use ``git format-patch --cover-letter`` to create the
19*0ff0dcf6SKashyap Chamarthyemails, and then edit the cover letter to include the pull request
20*0ff0dcf6SKashyap Chamarthydetails that ``git request-pull`` outputs.
21*0ff0dcf6SKashyap Chamarthy
22*0ff0dcf6SKashyap Chamarthy**Use PULL as the subject line tag** in both the cover letter and the
23*0ff0dcf6SKashyap Chamarthyretransmitted patch mails (for example, by using
24*0ff0dcf6SKashyap Chamarthy``--subject-prefix=PULL`` in your ``git format-patch`` command). This
25*0ff0dcf6SKashyap Chamarthyhelps people to filter in or out the resulting emails (especially useful
26*0ff0dcf6SKashyap Chamarthyif they are only CC'd on one email out of the set).
27*0ff0dcf6SKashyap Chamarthy
28*0ff0dcf6SKashyap Chamarthy**Each patch must have your own Signed-off-by: line** as well as that of
29*0ff0dcf6SKashyap Chamarthythe original author if the patch was not written by you. This is because
30*0ff0dcf6SKashyap Chamarthywith a pull request you're now indicating that the patch has passed via
31*0ff0dcf6SKashyap Chamarthyyou rather than directly from the original author.
32*0ff0dcf6SKashyap Chamarthy
33*0ff0dcf6SKashyap Chamarthy**Don't forget to add Reviewed-by: and Acked-by: lines**. When other
34*0ff0dcf6SKashyap Chamarthypeople have reviewed the patches you're putting in the pull request,
35*0ff0dcf6SKashyap Chamarthymake sure you've copied their signoffs across. (If you use the `patches
36*0ff0dcf6SKashyap Chamarthytool <https://github.com/stefanha/patches>`__ to add patches from email
37*0ff0dcf6SKashyap Chamarthydirectly to your git repo it will include the tags automatically; if
38*0ff0dcf6SKashyap Chamarthyyou're updating patches manually or in some other way you'll need to
39*0ff0dcf6SKashyap Chamarthyedit the commit messages by hand.)
40*0ff0dcf6SKashyap Chamarthy
41*0ff0dcf6SKashyap Chamarthy**Don't send pull requests for code that hasn't passed review**. A pull
42*0ff0dcf6SKashyap Chamarthyrequest says these patches are ready to go into QEMU now, so they must
43*0ff0dcf6SKashyap Chamarthyhave passed the standard code review processes. In particular if you've
44*0ff0dcf6SKashyap Chamarthycorrected issues in one round of code review, you need to send your
45*0ff0dcf6SKashyap Chamarthyfixed patch series as normal to the list; you can't put it in a pull
46*0ff0dcf6SKashyap Chamarthyrequest until it's gone through. (Extremely trivial fixes may be OK to
47*0ff0dcf6SKashyap Chamarthyjust fix in passing, but if in doubt err on the side of not.)
48*0ff0dcf6SKashyap Chamarthy
49*0ff0dcf6SKashyap Chamarthy**Test before sending**. This is an obvious thing to say, but make sure
50*0ff0dcf6SKashyap Chamarthyeverything builds (including that it compiles at each step of the patch
51*0ff0dcf6SKashyap Chamarthyseries) and that "make check" passes before sending out the pull
52*0ff0dcf6SKashyap Chamarthyrequest. As a submaintainer you're one of QEMU's lines of defense
53*0ff0dcf6SKashyap Chamarthyagainst bad code, so double check the details.
54*0ff0dcf6SKashyap Chamarthy
55*0ff0dcf6SKashyap Chamarthy**All pull requests must be signed**. If your key is not already signed
56*0ff0dcf6SKashyap Chamarthyby members of the QEMU community, you should make arrangements to attend
57*0ff0dcf6SKashyap Chamarthya `KeySigningParty <https://wiki.qemu.org/KeySigningParty>`__ (for
58*0ff0dcf6SKashyap Chamarthyexample at KVM Forum) or make alternative arrangements to have your key
59*0ff0dcf6SKashyap Chamarthysigned by an attendee.  Key signing requires meeting another community
60*0ff0dcf6SKashyap Chamarthymember \*in person\* so please make appropriate arrangements.  By
61*0ff0dcf6SKashyap Chamarthy"signed" here we mean that the pullreq email should quote a tag which is
62*0ff0dcf6SKashyap Chamarthya GPG-signed tag (as created with 'gpg tag -s ...').
63*0ff0dcf6SKashyap Chamarthy
64*0ff0dcf6SKashyap Chamarthy**Pull requests not for master should say "not for master" and have
65*0ff0dcf6SKashyap Chamarthy"PULL SUBSYSTEM whatever" in the subject tag**. If your pull request is
66*0ff0dcf6SKashyap Chamarthytargeting a stable branch or some submaintainer tree, please include the
67*0ff0dcf6SKashyap Chamarthystring "not for master" in the cover letter email, and make sure the
68*0ff0dcf6SKashyap Chamarthysubject tag is "PULL SUBSYSTEM s390/block/whatever" rather than just
69*0ff0dcf6SKashyap Chamarthy"PULL". This allows it to be automatically filtered out of the set of
70*0ff0dcf6SKashyap Chamarthypull requests that should be applied to master.
71*0ff0dcf6SKashyap Chamarthy
72*0ff0dcf6SKashyap ChamarthyYou might be interested in the `make-pullreq
73*0ff0dcf6SKashyap Chamarthy<https://git.linaro.org/people/peter.maydell/misc-scripts.git/tree/make-pullreq>`__
74*0ff0dcf6SKashyap Chamarthyscript which automates some of this process for you and includes a few
75*0ff0dcf6SKashyap Chamarthysanity checks. Note that you must edit it to configure it suitably for
76*0ff0dcf6SKashyap Chamarthyyour local situation!
77