submit-changes.rst 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. Contributing Changes to a Component
  3. ************************************
  4. Contributions to the Yocto Project and OpenEmbedded are very welcome.
  5. Because the system is extremely configurable and flexible, we recognize
  6. that developers will want to extend, configure or optimize it for their
  7. specific uses.
  8. .. _ref-why-mailing-lists:
  9. Contributing through mailing lists --- Why not using web-based workflows?
  10. =========================================================================
  11. Both Yocto Project and OpenEmbedded have many key components that are
  12. maintained by patches being submitted on mailing lists. We appreciate this
  13. approach does look a little old fashioned when other workflows are available
  14. through web technology such as GitHub, GitLab and others. Since we are often
  15. asked this question, we’ve decided to document the reasons for using mailing
  16. lists.
  17. One significant factor is that we value peer review. When a change is proposed
  18. to many of the core pieces of the project, it helps to have many eyes of review
  19. go over them. Whilst there is ultimately one maintainer who needs to make the
  20. final call on accepting or rejecting a patch, the review is made by many eyes
  21. and the exact people reviewing it are likely unknown to the maintainer. It is
  22. often the surprise reviewer that catches the most interesting issues!
  23. This is in contrast to the "GitHub" style workflow where either just a
  24. maintainer makes that review, or review is specifically requested from
  25. nominated people. We believe there is significant value added to the codebase
  26. by this peer review and that moving away from mailing lists would be to the
  27. detriment of our code.
  28. We also need to acknowledge that many of our developers are used to this
  29. mailing list workflow and have worked with it for years, with tools and
  30. processes built around it. Changing away from this would result in a loss
  31. of key people from the project, which would again be to its detriment.
  32. The projects are acutely aware that potential new contributors find the
  33. mailing list approach off-putting and would prefer a web-based GUI.
  34. Since we don’t believe that can work for us, the project is aiming to ensure
  35. `patchwork <https://patchwork.yoctoproject.org/>`__ is available to help track
  36. patch status and also looking at how tooling can provide more feedback to users
  37. about patch status. We are looking at improving tools such as ``patchtest`` to
  38. test user contributions before they hit the mailing lists and also at better
  39. documenting how to use such workflows since we recognise that whilst this was
  40. common knowledge a decade ago, it might not be as familiar now.
  41. Preparing Changes for Submission
  42. ================================
  43. Set up Git
  44. ----------
  45. The first thing to do is to install Git packages. Here is an example
  46. on Debian and Ubuntu::
  47. sudo aptitude install git-core git-email
  48. Then, you need to set a name and e-mail address that Git will
  49. use to identify your commits::
  50. git config --global user.name "Ada Lovelace"
  51. git config --global user.email "ada.lovelace@gmail.com"
  52. Clone the Git repository for the component to modify
  53. ----------------------------------------------------
  54. After identifying the component to modify as described in the
  55. ":doc:`../contributor-guide/identify-component`" section, clone the
  56. corresponding Git repository. Here is an example for OpenEmbedded-Core::
  57. git clone https://git.openembedded.org/openembedded-core
  58. cd openembedded-core
  59. Create a new branch
  60. -------------------
  61. Then, create a new branch in your local Git repository
  62. for your changes, starting from the reference branch in the upstream
  63. repository (often called ``master``)::
  64. $ git checkout <ref-branch>
  65. $ git checkout -b my-changes
  66. If you have completely unrelated sets of changes to submit, you should even
  67. create one branch for each set.
  68. Implement and commit changes
  69. ----------------------------
  70. In each branch, you should group your changes into small, controlled and
  71. isolated ones. Keeping changes small and isolated aids review, makes
  72. merging/rebasing easier and keeps the change history clean should anyone need
  73. to refer to it in future.
  74. To this purpose, you should create *one Git commit per change*,
  75. corresponding to each of the patches you will eventually submit.
  76. See `further guidance <https://www.kernel.org/doc/html/latest/process/submitting-patches.html#separate-your-changes>`__
  77. in the Linux kernel documentation if needed.
  78. For example, when you intend to add multiple new recipes, each recipe
  79. should be added in a separate commit. For upgrades to existing recipes,
  80. the previous version should usually be deleted as part of the same commit
  81. to add the upgraded version.
  82. #. *Stage Your Changes:* Stage your changes by using the ``git add``
  83. command on each file you modified. If you want to stage all the
  84. files you modified, you can even use the ``git add -A`` command.
  85. #. *Commit Your Changes:* This is when you can create separate commits. For
  86. each commit to create, use the ``git commit -s`` command with the files
  87. or directories you want to include in the commit::
  88. $ git commit -s file1 file2 dir1 dir2 ...
  89. To include **a**\ ll staged files::
  90. $ git commit -sa
  91. - The ``-s`` option of ``git commit`` adds a "Signed-off-by:" line
  92. to your commit message. There is the same requirement for contributing
  93. to the Linux kernel. Adding such a line signifies that you, the
  94. submitter, have agreed to the `Developer's Certificate of Origin 1.1
  95. <https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin>`__
  96. as follows:
  97. .. code-block:: none
  98. Developer's Certificate of Origin 1.1
  99. By making a contribution to this project, I certify that:
  100. (a) The contribution was created in whole or in part by me and I
  101. have the right to submit it under the open source license
  102. indicated in the file; or
  103. (b) The contribution is based upon previous work that, to the best
  104. of my knowledge, is covered under an appropriate open source
  105. license and I have the right under that license to submit that
  106. work with modifications, whether created in whole or in part
  107. by me, under the same open source license (unless I am
  108. permitted to submit under a different license), as indicated
  109. in the file; or
  110. (c) The contribution was provided directly to me by some other
  111. person who certified (a), (b) or (c) and I have not modified
  112. it.
  113. (d) I understand and agree that this project and the contribution
  114. are public and that a record of the contribution (including all
  115. personal information I submit with it, including my sign-off) is
  116. maintained indefinitely and may be redistributed consistent with
  117. this project or the open source license(s) involved.
  118. - Provide a single-line summary of the change and, if more
  119. explanation is needed, provide more detail in the body of the
  120. commit. This summary is typically viewable in the "shortlist" of
  121. changes. Thus, providing something short and descriptive that
  122. gives the reader a summary of the change is useful when viewing a
  123. list of many commits. You should prefix this short description
  124. with the recipe name (if changing a recipe), or else with the
  125. short form path to the file being changed.
  126. .. note::
  127. To find a suitable prefix for the commit summary, a good idea
  128. is to look for prefixes used in previous commits touching the
  129. same files or directories::
  130. git log --oneline <paths>
  131. - For the body of the commit message, provide detailed information
  132. that describes what you changed, why you made the change, and the
  133. approach you used. It might also be helpful if you mention how you
  134. tested the change. Provide as much detail as you can in the body
  135. of the commit message.
  136. .. note::
  137. If the single line summary is enough to describe a simple
  138. change, the body of the commit message can be left empty.
  139. - If the change addresses a specific bug or issue that is associated
  140. with a bug-tracking ID, include a reference to that ID in your
  141. detailed description. For example, the Yocto Project uses a
  142. specific convention for bug references --- any commit that addresses
  143. a specific bug should use the following form for the detailed
  144. description. Be sure to use the actual bug-tracking ID from
  145. Bugzilla for bug-id::
  146. Fixes [YOCTO #bug-id]
  147. detailed description of change
  148. #. *Crediting contributors:* By using the ``git commit --amend`` command,
  149. you can add some tags to the commit description to credit other contributors
  150. to the change:
  151. - ``Reported-by``: name and email of a person reporting a bug
  152. that your commit is trying to fix. This is a good practice
  153. to encourage people to go on reporting bugs and let them
  154. know that their reports are taken into account.
  155. - ``Suggested-by``: name and email of a person to credit for the
  156. idea of making the change.
  157. - ``Tested-by``, ``Reviewed-by``: name and email for people having
  158. tested your changes or reviewed their code. These fields are
  159. usually added by the maintainer accepting a patch, or by
  160. yourself if you submitted your patches to early reviewers,
  161. or are submitting an unmodified patch again as part of a
  162. new iteration of your patch series.
  163. - ``CC:`` Name and email of people you want to send a copy
  164. of your changes to. This field will be used by ``git send-email``.
  165. See `more guidance about using such tags
  166. <https://www.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes>`__
  167. in the Linux kernel documentation.
  168. Creating Patches
  169. ================
  170. Here is the general procedure on how to create patches to be sent through email:
  171. #. *Describe the Changes in your Branch:* If you have more than one commit
  172. in your branch, it's recommended to provide a cover letter describing
  173. the series of patches you are about to send.
  174. For this purpose, a good solution is to store the cover letter contents
  175. in the branch itself::
  176. git branch --edit-description
  177. This will open a text editor to fill in the description for your
  178. changes. This description can be updated when necessary and will
  179. be used by Git to create the cover letter together with the patches.
  180. It is recommended to start this description with a title line which
  181. will serve a the subject line for the cover letter.
  182. #. *Generate Patches for your Branch:* The ``git format-patch`` command will
  183. generate patch files for each of the commits in your branch. You need
  184. to pass the reference branch your branch starts from.
  185. If you branch didn't need a description in the previous step::
  186. $ git format-patch <ref-branch>
  187. If you filled a description for your branch, you will want to generate
  188. a cover letter too::
  189. $ git format-patch --cover-letter --cover-from-description=auto <ref-branch>
  190. After the command is run, the current directory contains numbered
  191. ``.patch`` files for the commits in your branch. If you have a cover
  192. letter, it will be in the ``0000-cover-letter.patch``.
  193. .. note::
  194. The ``--cover-from-description=auto`` option makes ``git format-patch``
  195. use the first paragraph of the branch description as the cover
  196. letter title. Another possibility, which is easier to remember, is to pass
  197. only the ``--cover-letter`` option, but you will have to edit the
  198. subject line manually every time you generate the patches.
  199. See the `git format-patch manual page <https://git-scm.com/docs/git-format-patch>`__
  200. for details.
  201. #. *Review each of the Patch Files:* This final review of the patches
  202. before sending them often allows to view your changes from a different
  203. perspective and discover defects such as typos, spacing issues or lines
  204. or even files that you didn't intend to modify. This review should
  205. include the cover letter patch too.
  206. If necessary, rework your commits as described in
  207. ":ref:`contributor-guide/submit-changes:taking patch review into account`".
  208. Sending the Patches via Email
  209. =============================
  210. Using Git to Send Patches
  211. -------------------------
  212. To submit patches through email, it is very important that you send them
  213. without any whitespace or HTML formatting that either you or your mailer
  214. introduces. The maintainer that receives your patches needs to be able
  215. to save and apply them directly from your emails, using the ``git am``
  216. command.
  217. Using the ``git send-email`` command is the only error-proof way of sending
  218. your patches using email since there is no risk of compromising whitespace
  219. in the body of the message, which can occur when you use your own mail
  220. client. It will also properly include your patches as *inline attachments*,
  221. which is not easy to do with standard e-mail clients without breaking lines.
  222. If you used your regular e-mail client and shared your patches as regular
  223. attachments, reviewers wouldn't be able to quote specific sections of your
  224. changes and make comments about them.
  225. Setting up Git to Send Email
  226. ----------------------------
  227. The ``git send-email`` command can send email by using a local or remote
  228. Mail Transport Agent (MTA) such as ``msmtp``, ``sendmail``, or
  229. through a direct SMTP configuration in your Git ``~/.gitconfig`` file.
  230. Here are the settings for letting ``git send-email`` send e-mail through your
  231. regular STMP server, using a Google Mail account as an example::
  232. git config --global sendemail.smtpserver smtp.gmail.com
  233. git config --global sendemail.smtpserverport 587
  234. git config --global sendemail.smtpencryption tls
  235. git config --global sendemail.smtpuser ada.lovelace@gmail.com
  236. git config --global sendemail.smtppass = XXXXXXXX
  237. These settings will appear in the ``.gitconfig`` file in your home directory.
  238. If you neither can use a local MTA nor SMTP, make sure you use an email client
  239. that does not touch the message (turning spaces in tabs, wrapping lines, etc.).
  240. A good mail client to do so is Pine (or Alpine) or Mutt. For more
  241. information about suitable clients, see `Email clients info for Linux
  242. <https://www.kernel.org/doc/html/latest/process/email-clients.html>`__
  243. in the Linux kernel sources.
  244. If you use such clients, just include the patch in the body of your email.
  245. Finding a Suitable Mailing List
  246. -------------------------------
  247. You should send patches to the appropriate mailing list so that they can be
  248. reviewed by the right contributors and merged by the appropriate maintainer.
  249. The specific mailing list you need to use depends on the location of the code
  250. you are changing.
  251. If people have concerns with any of the patches, they will usually voice
  252. their concern over the mailing list. If patches do not receive any negative
  253. reviews, the maintainer of the affected layer typically takes them, tests them,
  254. and then based on successful testing, merges them.
  255. In general, each component (e.g. layer) should have a ``README`` file
  256. that indicates where to send the changes and which process to follow.
  257. The "poky" repository, which is the Yocto Project's reference build
  258. environment, is a hybrid repository that contains several individual
  259. pieces (e.g. BitBake, Metadata, documentation, and so forth) built using
  260. the combo-layer tool. The upstream location used for submitting changes
  261. varies by component:
  262. - *Core Metadata:* Send your patches to the
  263. :oe_lists:`openembedded-core </g/openembedded-core>`
  264. mailing list. For example, a change to anything under the ``meta`` or
  265. ``scripts`` directories should be sent to this mailing list.
  266. - *BitBake:* For changes to BitBake (i.e. anything under the
  267. ``bitbake`` directory), send your patches to the
  268. :oe_lists:`bitbake-devel </g/bitbake-devel>`
  269. mailing list.
  270. - *"meta-\*" trees:* These trees contain Metadata. Use the
  271. :yocto_lists:`poky </g/poky>` mailing list.
  272. - *Documentation*: For changes to the Yocto Project documentation, use the
  273. :yocto_lists:`docs </g/docs>` mailing list.
  274. For changes to other layers and tools hosted in the Yocto Project source
  275. repositories (i.e. :yocto_git:`git.yoctoproject.org <>`), use the
  276. :yocto_lists:`yocto </g/yocto/>` general mailing list.
  277. For changes to other layers hosted in the OpenEmbedded source
  278. repositories (i.e. :oe_git:`git.openembedded.org <>`), use
  279. the :oe_lists:`openembedded-devel </g/openembedded-devel>`
  280. mailing list, unless specified otherwise in the layer's ``README`` file.
  281. If you intend to submit a new recipe that neither fits into the core Metadata,
  282. nor into :oe_git:`meta-openembedded </meta-openembedded/>`, you should
  283. look for a suitable layer in https://layers.openembedded.org. If similar
  284. recipes can be expected, you may consider :ref:`dev-manual/layers:creating your own layer`.
  285. If in doubt, please ask on the :yocto_lists:`yocto </g/yocto/>` general mailing list
  286. or on the :oe_lists:`openembedded-devel </g/openembedded-devel>` mailing list.
  287. Subscribing to the Mailing List
  288. -------------------------------
  289. After identifying the right mailing list to use, you will have to subscribe to
  290. it if you haven't done it yet.
  291. If you attempt to send patches to a list you haven't subscribed to, your email
  292. will be returned as undelivered.
  293. However, if you don't want to be receive all the messages sent to a mailing list,
  294. you can set your subscription to "no email". You will still be a subscriber able
  295. to send messages, but you won't receive any e-mail. If people reply to your message,
  296. their e-mail clients will default to including your email address in the
  297. conversation anyway.
  298. Anyway, you'll also be able to access the new messages on mailing list archives,
  299. either through a web browser, or for the lists archived on https://lore.kernelorg,
  300. through an individual newsgroup feed or a git repository.
  301. Sending Patches via Email
  302. -------------------------
  303. At this stage, you are ready to send your patches via email. Here's the
  304. typical usage of ``git send-email``::
  305. git send-email --to <mailing-list-address> *.patch
  306. Then, review each subject line and list of recipients carefully, and then
  307. and then allow the command to send each message.
  308. You will see that ``git send-email`` will automatically copy the people listed
  309. in any commit tags such as ``Signed-off-by`` or ``Reported-by``.
  310. In case you are sending patches for :oe_git:`meta-openembedded </meta-openembedded/>`
  311. or any layer other than :oe_git:`openembedded-core </openembedded-core/>`,
  312. please add the appropriate prefix so that it is clear which layer the patch is intended
  313. to be applied to::
  314. git send-email --subject-prefix="meta-oe][PATCH" ...
  315. .. note::
  316. It is actually possible to send patches without generating them
  317. first. However, make sure you have reviewed your changes carefully
  318. because ``git send-email`` will just show you the title lines of
  319. each patch.
  320. Here's a command you can use if you just have one patch in your
  321. branch::
  322. git send-email --to <mailing-list-address> -1
  323. If you have multiple patches and a cover letter, you can send
  324. patches for all the commits between the reference branch
  325. and the tip of your branch::
  326. git send-email --cover-letter --cover-from-description=auto --to <mailing-list-address> -M <ref-branch>
  327. See the `git send-email manual page <https://git-scm.com/docs/git-send-email>`__
  328. for details.
  329. Troubleshooting Email Issues
  330. ----------------------------
  331. Fixing your From identity
  332. ~~~~~~~~~~~~~~~~~~~~~~~~~
  333. We have a frequent issue with contributors whose patches are received through
  334. a ``From`` field which doesn't match the ``Signed-off-by`` information. Here is
  335. a typical example for people sending from a domain name with :wikipedia:`DMARC`::
  336. From: "Linus Torvalds via lists.openembedded.org <linus.torvalds=kernel.org@lists.openembedded.org>"
  337. This ``From`` field is used by ``git am`` to recreate commits with the right
  338. author name. The following will ensure that your e-mails have an additional
  339. ``From`` field at the beginning of the Email body, and therefore that
  340. maintainers accepting your patches don't have to fix commit author information
  341. manually::
  342. git config --global sendemail.from "linus.torvalds@kernel.org"
  343. The ``sendemail.from`` should match your ``user.email`` setting,
  344. which appears in the ``Signed-off-by`` line of your commits.
  345. Streamlining git send-email usage
  346. ---------------------------------
  347. If you want to save time and not be forced to remember the right options to use
  348. with ``git send-email``, you can use Git configuration settings.
  349. - To set the right mailing list address for a given repository::
  350. git config --local sendemail.to openembedded-devel@lists.openembedded.org
  351. - If the mailing list requires a subject prefix for the layer
  352. (this only works when the repository only contains one layer)::
  353. git config --local format.subjectprefix "meta-something][PATCH"
  354. Using Scripts to Push a Change Upstream and Request a Pull
  355. ==========================================================
  356. For larger patch series it is preferable to send a pull request which not
  357. only includes the patch but also a pointer to a branch that can be pulled
  358. from. This involves making a local branch for your changes, pushing this
  359. branch to an accessible repository and then using the ``create-pull-request``
  360. and ``send-pull-request`` scripts from openembedded-core to create and send a
  361. patch series with a link to the branch for review.
  362. Follow this procedure to push a change to an upstream "contrib" Git
  363. repository once the steps in
  364. ":ref:`contributor-guide/submit-changes:preparing changes for submission`"
  365. have been followed:
  366. .. note::
  367. You can find general Git information on how to push a change upstream
  368. in the
  369. `Git Community Book <https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows>`__.
  370. #. *Request Push Access to an "Upstream" Contrib Repository:* Send an email to
  371. ``helpdesk@yoctoproject.org``:
  372. - Attach your SSH public key which usually named ``id_rsa.pub.``.
  373. If you don't have one generate it by running ``ssh-keygen -t rsa -b 4096 -C "your_email@example.com"``.
  374. - List the repositories you're planning to contribute to.
  375. - Include your preferred branch prefix for ``-contrib`` repositories.
  376. #. *Push Your Commits to the "Contrib" Upstream:* Push your
  377. changes to that repository::
  378. $ git push upstream_remote_repo local_branch_name
  379. For example, suppose you have permissions to push
  380. into the upstream ``meta-intel-contrib`` repository and you are
  381. working in a local branch named `your_name`\ ``/README``. The following
  382. command pushes your local commits to the ``meta-intel-contrib``
  383. upstream repository and puts the commit in a branch named
  384. `your_name`\ ``/README``::
  385. $ git push meta-intel-contrib your_name/README
  386. #. *Determine Who to Notify:* Determine the maintainer or the mailing
  387. list that you need to notify for the change.
  388. Before submitting any change, you need to be sure who the maintainer
  389. is or what mailing list that you need to notify. Use either these
  390. methods to find out:
  391. - *Maintenance File:* Examine the ``maintainers.inc`` file, which is
  392. located in the :term:`Source Directory` at
  393. ``meta/conf/distro/include``, to see who is responsible for code.
  394. - *Search by File:* Using :ref:`overview-manual/development-environment:git`, you can
  395. enter the following command to bring up a short list of all
  396. commits against a specific file::
  397. git shortlog -- filename
  398. Just provide the name of the file for which you are interested. The
  399. information returned is not ordered by history but does include a
  400. list of everyone who has committed grouped by name. From the list,
  401. you can see who is responsible for the bulk of the changes against
  402. the file.
  403. - *Find the Mailing List to Use:* See the
  404. ":ref:`contributor-guide/submit-changes:finding a suitable mailing list`"
  405. section above.
  406. #. *Make a Pull Request:* Notify the maintainer or the mailing list that
  407. you have pushed a change by making a pull request.
  408. The Yocto Project provides two scripts that conveniently let you
  409. generate and send pull requests to the Yocto Project. These scripts
  410. are ``create-pull-request`` and ``send-pull-request``. You can find
  411. these scripts in the ``scripts`` directory within the
  412. :term:`Source Directory` (e.g.
  413. ``poky/scripts``).
  414. Using these scripts correctly formats the requests without
  415. introducing any whitespace or HTML formatting. The maintainer that
  416. receives your patches either directly or through the mailing list
  417. needs to be able to save and apply them directly from your emails.
  418. Using these scripts is the preferred method for sending patches.
  419. First, create the pull request. For example, the following command
  420. runs the script, specifies the upstream repository in the contrib
  421. directory into which you pushed the change, and provides a subject
  422. line in the created patch files::
  423. $ poky/scripts/create-pull-request -u meta-intel-contrib -s "Updated Manual Section Reference in README"
  424. Running this script forms ``*.patch`` files in a folder named
  425. ``pull-``\ `PID` in the current directory. One of the patch files is a
  426. cover letter.
  427. Before running the ``send-pull-request`` script, you must edit the
  428. cover letter patch to insert information about your change. After
  429. editing the cover letter, send the pull request. For example, the
  430. following command runs the script and specifies the patch directory
  431. and email address. In this example, the email address is a mailing
  432. list::
  433. $ poky/scripts/send-pull-request -p ~/meta-intel/pull-10565 -t meta-intel@lists.yoctoproject.org
  434. You need to follow the prompts as the script is interactive.
  435. .. note::
  436. For help on using these scripts, simply provide the ``-h``
  437. argument as follows::
  438. $ poky/scripts/create-pull-request -h
  439. $ poky/scripts/send-pull-request -h
  440. Submitting Changes to Stable Release Branches
  441. =============================================
  442. The process for proposing changes to a Yocto Project stable branch differs
  443. from the steps described above. Changes to a stable branch must address
  444. identified bugs or CVEs and should be made carefully in order to avoid the
  445. risk of introducing new bugs or breaking backwards compatibility. Typically
  446. bug fixes must already be accepted into the master branch before they can be
  447. backported to a stable branch unless the bug in question does not affect the
  448. master branch or the fix on the master branch is unsuitable for backporting.
  449. The list of stable branches along with the status and maintainer for each
  450. branch can be obtained from the
  451. :yocto_wiki:`Releases wiki page </Releases>`.
  452. .. note::
  453. Changes will not typically be accepted for branches which are marked as
  454. End-Of-Life (EOL).
  455. With this in mind, the steps to submit a change for a stable branch are as
  456. follows:
  457. #. *Identify the bug or CVE to be fixed:* This information should be
  458. collected so that it can be included in your submission.
  459. See :ref:`dev-manual/vulnerabilities:checking for vulnerabilities`
  460. for details about CVE tracking.
  461. #. *Check if the fix is already present in the master branch:* This will
  462. result in the most straightforward path into the stable branch for the
  463. fix.
  464. #. *If the fix is present in the master branch --- submit a backport request
  465. by email:* You should send an email to the relevant stable branch
  466. maintainer and the mailing list with details of the bug or CVE to be
  467. fixed, the commit hash on the master branch that fixes the issue and
  468. the stable branches which you would like this fix to be backported to.
  469. #. *If the fix is not present in the master branch --- submit the fix to the
  470. master branch first:* This will ensure that the fix passes through the
  471. project's usual patch review and test processes before being accepted.
  472. It will also ensure that bugs are not left unresolved in the master
  473. branch itself. Once the fix is accepted in the master branch a backport
  474. request can be submitted as above.
  475. #. *If the fix is unsuitable for the master branch --- submit a patch
  476. directly for the stable branch:* This method should be considered as a
  477. last resort. It is typically necessary when the master branch is using
  478. a newer version of the software which includes an upstream fix for the
  479. issue or when the issue has been fixed on the master branch in a way
  480. that introduces backwards incompatible changes. In this case follow the
  481. steps in ":ref:`contributor-guide/submit-changes:preparing changes for submission`"
  482. and in the following sections but modify the subject header of your patch
  483. email to include the name of the stable branch which you are
  484. targetting. This can be done using the ``--subject-prefix`` argument to
  485. ``git format-patch``, for example to submit a patch to the
  486. "&DISTRO_NAME_NO_CAP_MINUS_ONE;" branch use::
  487. git format-patch --subject-prefix='&DISTRO_NAME_NO_CAP_MINUS_ONE;][PATCH' ...
  488. Taking Patch Review into Account
  489. ================================
  490. You may get feedback on your submitted patches from other community members
  491. or from the automated patchtest service. If issues are identified in your
  492. patches then it is usually necessary to address these before the patches are
  493. accepted into the project. In this case you should your commits according
  494. to the feedback and submit an updated version to the relevant mailing list.
  495. In any case, never fix reported issues by fixing them in new commits
  496. on the tip of your branch. Always come up with a new series of commits
  497. without the reported issues.
  498. .. note::
  499. It is a good idea to send a copy to the reviewers who provided feedback
  500. to the previous version of the patch. You can make sure this happens
  501. by adding a ``CC`` tag to the commit description::
  502. CC: William Shakespeare <bill@yoctoproject.org>
  503. A single patch can be amended using ``git commit --amend``, and multiple
  504. patches can be easily reworked and reordered through an interactive Git rebase::
  505. git rebase -i <ref-branch>
  506. See `this tutorial <https://hackernoon.com/beginners-guide-to-interactive-rebasing-346a3f9c3a6d>`__
  507. for practical guidance about using Git interactive rebasing.
  508. You should also modify the ``[PATCH]`` tag in the email subject line when
  509. sending the revised patch to mark the new iteration as ``[PATCH v2]``,
  510. ``[PATCH v3]``, etc as appropriate. This can be done by passing the ``-v``
  511. argument to ``git format-patch`` with a version number::
  512. git format-patch -v2 <ref-branch>
  513. Lastly please ensure that you also test your revised changes. In particular
  514. please don't just edit the patch file written out by ``git format-patch`` and
  515. resend it.
  516. Tracking the Status of Patches
  517. ==============================
  518. The Yocto Project uses a `Patchwork instance <https://patchwork.yoctoproject.org/>`__
  519. to track the status of patches submitted to the various mailing lists and to
  520. support automated patch testing. Each submitted patch is checked for common
  521. mistakes and deviations from the expected patch format and submitters are
  522. notified by ``patchtest`` if such mistakes are found. This process helps to
  523. reduce the burden of patch review on maintainers.
  524. .. note::
  525. This system is imperfect and changes can sometimes get lost in the flow.
  526. Asking about the status of a patch or change is reasonable if the change
  527. has been idle for a while with no feedback.
  528. If your patches have not had any feedback in a few days, they may have already
  529. been merged. You can run ``git pull`` branch to check this. Note that many if
  530. not most layer maintainers do not send out acknowledgement emails when they
  531. accept patches. Alternatively, if there is no response or merge after a few days
  532. the patch may have been missed or the appropriate reviewers may not currently be
  533. around. It is then perfectly fine to reply to it yourself with a reminder asking
  534. for feedback.
  535. .. note::
  536. Patch reviews for feature and recipe upgrade patches are likely be delayed
  537. during a feature freeze because these types of patches aren't merged during
  538. at that time --- you may have to wait until after the freeze is lifted.
  539. Maintainers also commonly use ``-next`` branches to test submissions prior to
  540. merging patches. Thus, you can get an idea of the status of a patch based on
  541. whether the patch has been merged into one of these branches. The commonly
  542. used testing branches for OpenEmbedded-Core are as follows:
  543. - *openembedded-core "master-next" branch:* This branch is part of the
  544. :oe_git:`openembedded-core </openembedded-core/>` repository and contains
  545. proposed changes to the core metadata.
  546. - *poky "master-next" branch:* This branch is part of the
  547. :yocto_git:`poky </poky/>` repository and combines proposed
  548. changes to BitBake, the core metadata and the poky distro.
  549. Similarly, stable branches maintained by the project may have corresponding
  550. ``-next`` branches which collect proposed changes. For example,
  551. ``&DISTRO_NAME_NO_CAP;-next`` and ``&DISTRO_NAME_NO_CAP_MINUS_ONE;-next``
  552. branches in both the "openembdedded-core" and "poky" repositories.
  553. Other layers may have similar testing branches but there is no formal
  554. requirement or standard for these so please check the documentation for the
  555. layers you are contributing to.