summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorMichael Opdenacker <michael.opdenacker@bootlin.com>2023-08-18 17:50:54 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-08-30 15:54:59 +0100
commita878e1591bcd8dc31fac0e9abd61aeb6af9b6440 (patch)
treef36f1abf93123fc40434d7a4aea94b23545a3700 /documentation
parente05baab43c0da21d4dbf49cd7b701698b41638ef (diff)
downloadpoky-a878e1591bcd8dc31fac0e9abd61aeb6af9b6440.tar.gz
contributor-guide: submit-changes: reorganize and develop sections
In particular, develop the sections about sending patches. Reorder sections for a more logical flow. Remove unnecessary or duplicate details too. (From yocto-docs rev: 6c37d5bd9be7e65c923c3e95f478afc0e6064e8f) Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rw-r--r--documentation/contributor-guide/submit-changes.rst402
1 files changed, 262 insertions, 140 deletions
diff --git a/documentation/contributor-guide/submit-changes.rst b/documentation/contributor-guide/submit-changes.rst
index aeef2cc90a..3098a76a6c 100644
--- a/documentation/contributor-guide/submit-changes.rst
+++ b/documentation/contributor-guide/submit-changes.rst
@@ -48,95 +48,6 @@ test user contributions before they hit the mailing lists and also at better
48documenting how to use such workflows since we recognise that whilst this was 48documenting how to use such workflows since we recognise that whilst this was
49common knowledge a decade ago, it might not be as familiar now. 49common knowledge a decade ago, it might not be as familiar now.
50 50
51Finding a Suitable Mailing List
52===============================
53
54The Yocto Project and OpenEmbedded use a mailing list and a patch-based
55workflow that is similar to the Linux kernel but contains important
56differences. In general, there is a mailing list through which you can submit
57patches. You should send patches to the appropriate mailing list so that they
58can be reviewed and merged by the appropriate maintainer. The specific mailing
59list you need to use depends on the location of the code you are
60changing. Each component (e.g. layer) should have a ``README`` file that
61indicates where to send the changes and which process to follow.
62
63You can send the patches to the mailing list using whichever approach you
64feel comfortable with to generate the patches. Once sent, the patches are
65usually reviewed by the community at large. If somebody has concerns
66any of the the patches, they will usually voice their concern over the mailing
67list. If patches do not receive any negative reviews, the maintainer
68of the affected layer typically takes them, tests them, and then
69based on successful testing, merges them.
70
71The "poky" repository, which is the Yocto Project's reference build
72environment, is a hybrid repository that contains several individual
73pieces (e.g. BitBake, Metadata, documentation, and so forth) built using
74the combo-layer tool. The upstream location used for submitting changes
75varies by component:
76
77- *Core Metadata:* Send your patches to the
78 :oe_lists:`openembedded-core </g/openembedded-core>`
79 mailing list. For example, a change to anything under the ``meta`` or
80 ``scripts`` directories should be sent to this mailing list.
81
82- *BitBake:* For changes to BitBake (i.e. anything under the
83 ``bitbake`` directory), send your patches to the
84 :oe_lists:`bitbake-devel </g/bitbake-devel>`
85 mailing list.
86
87- *"meta-\*" trees:* These trees contain Metadata. Use the
88 :yocto_lists:`poky </g/poky>` mailing list.
89
90- *Documentation*: For changes to the Yocto Project documentation, use the
91 :yocto_lists:`docs </g/docs>` mailing list.
92
93For changes to other layers hosted in the Yocto Project source
94repositories (i.e. ``yoctoproject.org``) and tools use the
95:yocto_lists:`yocto </g/yocto/>` general mailing list.
96
97.. note::
98
99 Sometimes a layer's documentation specifies to use a particular
100 mailing list. If so, use that list.
101
102For additional recipes that do not fit into the core Metadata, you
103should determine which layer the recipe should go into and submit the
104changes in the manner recommended by the documentation (e.g. the
105``README`` file) supplied with the layer. If in doubt, please ask on the
106:yocto_lists:`yocto </g/yocto/>` general mailing list or on the
107:oe_lists:`openembedded-devel </g/openembedded-devel>` mailing list.
108
109You can also push changes upstream and request a maintainer to pull the
110changes into the component's upstream repository. You do this by pushing
111to a contribution repository that is upstream. See the
112":ref:`overview-manual/development-environment:git workflows and the yocto project`"
113section in the Yocto Project Overview and Concepts Manual for additional
114concepts on working in the Yocto Project development environment.
115
116Maintainers commonly use ``-next`` branches to test submissions prior to
117merging patches. Thus, you can get an idea of the status of a patch based on
118whether the patch has been merged into one of these branches. The commonly
119used testing branches for OpenEmbedded-Core are as follows:
120
121- *openembedded-core "master-next" branch:* This branch is part of the
122 :oe_git:`openembedded-core </openembedded-core/>` repository and contains
123 proposed changes to the core metadata.
124
125- *poky "master-next" branch:* This branch is part of the
126 :yocto_git:`poky </poky/>` repository and combines proposed
127 changes to BitBake, the core metadata and the poky distro.
128
129Similarly, stable branches maintained by the project may have corresponding
130``-next`` branches which collect proposed changes. For example,
131``&DISTRO_NAME_NO_CAP;-next`` and ``&DISTRO_NAME_NO_CAP_MINUS_ONE;-next``
132branches in both the "openembdedded-core" and "poky" repositories.
133
134Other layers may have similar testing branches but there is no formal
135requirement or standard for these so please check the documentation for the
136layers you are contributing to.
137
138The following sections provide procedures for submitting changes.
139
140Preparing Changes for Submission 51Preparing Changes for Submission
141================================ 52================================
142 53
@@ -279,6 +190,32 @@ in the Linux kernel documentation if needed.
279 190
280 detailed description of change 191 detailed description of change
281 192
193#. *Crediting contributors:* By using the ``git commit --amend`` command,
194 you can add some tags to the commit description to credit other contributors
195 to the change:
196
197 - ``Reported-by``: name and email of a person reporting a bug
198 that your commit is trying to fix. This is a good practice
199 to encourage people to go on reporting bugs and let them
200 know that their reports are taken into account.
201
202 - ``Suggested-by``: name and email of a person to credit for the
203 idea of making the change.
204
205 - ``Tested-by``, ``Reviewed-by``: name and email for people having
206 tested your changes or reviewed their code. These fields are
207 usually added by the maintainer accepting a patch, or by
208 yourself if you submitted your patches to early reviewers,
209 or are submitting an unmodified patch again as part of a
210 new iteration of your patch series.
211
212 - ``CC:`` Name and email of people you want to send a copy
213 of your changes to. This field will be used by ``git send-email``.
214
215 See `more guidance about using such tags
216 <https://www.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes>`__
217 in the Linux kernel documentation.
218
282Creating Patches 219Creating Patches
283================ 220================
284 221
@@ -335,7 +272,7 @@ Here is the general procedure on how to create patches to be sent through email:
335 include the cover letter patch too. 272 include the cover letter patch too.
336 273
337 If necessary, rework your commits as described in 274 If necessary, rework your commits as described in
338 ":ref:`contributor-guide/submit-changes:take patch review into account`". 275 ":ref:`contributor-guide/submit-changes:taking patch review into account`".
339 276
340Sending the Patches via Email 277Sending the Patches via Email
341============================= 278=============================
@@ -385,43 +322,156 @@ in the Linux kernel sources.
385 322
386If you use such clients, just include the patch in the body of your email. 323If you use such clients, just include the patch in the body of your email.
387 324
388Subscribing to Mailing Lists 325Finding a Suitable Mailing List
389---------------------------- 326-------------------------------
327
328You should send patches to the appropriate mailing list so that they can be
329reviewed by the right contributors and merged by the appropriate maintainer.
330The specific mailing list you need to use depends on the location of the code
331you are changing. Each component (e.g. layer) should have a ``README`` file
332that indicates where to send the changes and which process to follow.
333
334If people have concerns with any of the patches, they will usually voice
335their concern over the mailing list. If patches do not receive any negative
336reviews, the maintainer of the affected layer typically takes them, tests them,
337and then based on successful testing, merges them.
338
339The "poky" repository, which is the Yocto Project's reference build
340environment, is a hybrid repository that contains several individual
341pieces (e.g. BitBake, Metadata, documentation, and so forth) built using
342the combo-layer tool. The upstream location used for submitting changes
343varies by component:
344
345- *Core Metadata:* Send your patches to the
346 :oe_lists:`openembedded-core </g/openembedded-core>`
347 mailing list. For example, a change to anything under the ``meta`` or
348 ``scripts`` directories should be sent to this mailing list.
349
350- *BitBake:* For changes to BitBake (i.e. anything under the
351 ``bitbake`` directory), send your patches to the
352 :oe_lists:`bitbake-devel </g/bitbake-devel>`
353 mailing list.
354
355- *"meta-\*" trees:* These trees contain Metadata. Use the
356 :yocto_lists:`poky </g/poky>` mailing list.
357
358- *Documentation*: For changes to the Yocto Project documentation, use the
359 :yocto_lists:`docs </g/docs>` mailing list.
360
361For changes to other layers hosted in the Yocto Project source
362repositories (i.e. ``yoctoproject.org``) and tools use the
363:yocto_lists:`yocto </g/yocto/>` general mailing list.
364
365.. note::
366
367 Sometimes a layer's documentation specifies to use a particular
368 mailing list. If so, use that list.
369
370For additional recipes that do not fit into the core Metadata, you
371should determine which layer the recipe should go into and submit the
372changes in the manner recommended by the documentation (e.g. by the
373``README`` file) supplied with the layer. If in doubt, please ask on the
374:yocto_lists:`yocto </g/yocto/>` general mailing list or on the
375:oe_lists:`openembedded-devel </g/openembedded-devel>` mailing list.
376
377Subscribing to the Mailing List
378-------------------------------
379
380After identifying the right mailing list to use, you will have to subscribe to
381it if you haven't done it yet.
382
383If you attempt to send patches to a list you haven't subscribed to, your email
384will be returned as undelivered.
385
386However, if you don't want to be receive all the messages sent to a mailing list,
387you can set your subscription to "no email". You will still be a subscriber able
388to send messages, but you won't receive any e-mail. If people reply to your message,
389their e-mail clients will default to including your email address in the
390conversation anyway.
391
392Anyway, you'll also be able to access the new messages on mailing list archives,
393either through a web browser, or for the lists archived on https://lore.kernelorg,
394through an individual newsgroup feed or a git repository.
390 395
391Sending Patches via Email 396Sending Patches via Email
392------------------------- 397-------------------------
393 398
394Depending on the components changed, you need to submit the email to a 399At this stage, you are ready to send your patches via email. Here's the
395specific mailing list. For some guidance on which mailing list to use, 400typical usage of ``git send-email``::
396see the ":ref:`contributor-guide/submit-changes:finding a suitable mailing list`"
397section above.
398 401
399#. *Send the patches via email:* Send the patches to the recipients and 402 git send-email --to <mailing-list-address> *.patch
400 relevant mailing lists by using the ``git send-email`` command.
401 403
402 The ``git send-email`` command is the preferred method for sending 404Then, review each subject line and list of recipients carefully, and then
403 your patches using email since there is no risk of compromising 405and then allow the command to send each message.
404 whitespace in the body of the message, which can occur when you use
405 your own mail client. The command also has several options that let
406 you specify recipients and perform further editing of the email
407 message. Here's a typical usage of this command::
408 406
409 git send-email --to <mailing-list-address> *.patch 407You will see that ``git send-email`` will automatically copy the people listed
408in any commit tags such as ``Signed-off-by`` or ``Reported-by``.
410 409
411 Run ``man git-send-email`` for more details about this command. 410In case you are sending patches for :oe_git:`meta-openembedded </meta-openembedded/>`
411or any layer other than :oe_git:`openembedded-core </openembedded-core/>`,
412please add the appropriate prefix so that it is clear which layer the patch is intended
413to be applied to::
412 414
413The Yocto Project uses a `Patchwork instance <https://patchwork.yoctoproject.org/>`__ 415 git send-email --subject-prefix="meta-oe][PATCH" ...
414to track the status of patches submitted to the various mailing lists and to
415support automated patch testing. Each submitted patch is checked for common
416mistakes and deviations from the expected patch format and submitters are
417notified by ``patchtest`` if such mistakes are found. This process helps to
418reduce the burden of patch review on maintainers.
419 416
420.. note:: 417.. note::
421 418
422 This system is imperfect and changes can sometimes get lost in the flow. 419 It is actually possible to send patches without generating them
423 Asking about the status of a patch or change is reasonable if the change 420 first. However, make sure you have reviewed your changes carefully
424 has been idle for a while with no feedback. 421 because ``git send-email`` will just show you the title lines of
422 each patch.
423
424 Here's a command you can use if you just have one patch in your
425 branch::
426
427 git send-email --to <mailing-list-address> -1
428
429 If you have multiple patches and a cover letter, you can send
430 patches for all the commits between the reference branch
431 and the tip of your branch::
432
433 git send-email --cover-letter --cover-from-description=auto --to <mailing-list-address> -M <ref-branch>
434
435See the `git send-email manual page <https://git-scm.com/docs/git-send-email>`__
436for details.
437
438Troubleshooting Email Issues
439----------------------------
440
441Fixing your From identity
442~~~~~~~~~~~~~~~~~~~~~~~~~
443
444We have a frequent issue with contributors whose patches are received through
445a ``From`` field which doesn't match the ``Signed-off-by`` information. Here is
446a typical example for people sending from a domain name with :wikipedia:`DMARC`::
447
448 From: "Linus Torvalds via lists.openembedded.org <linus.torvalds=kernel.org@lists.openembedded.org>"
449
450This ``From`` field is used by ``git am`` to recreate commits with the right
451author name. The following will ensure that your e-mails have an additional
452``From`` field at the beginning of the Email body, and therefore that
453maintainers accepting your patches don't have to fix commit author information
454manually::
455
456 git config --global sendemail.from "linus.torvalds@kernel.org"
457
458The ``sendemail.from`` should match your ``user.email`` setting,
459which appears in the ``Signed-off-by`` line of your commits.
460
461Streamlining git send-email usage
462---------------------------------
463
464If you want to save time and not be forced to remember the right options to use
465with ``git send-email``, you can use Git configuration settings.
466
467- To set the right mailing list address for a given repository::
468
469 git config --local sendemail.to openembedded-devel@lists.openembedded.org
470
471- If the mailing list requires a subject prefix for the layer
472 (this only works when the repository only contains one layer)::
473
474 git config --local format.subjectprefix "meta-something][PATCH"
425 475
426Using Scripts to Push a Change Upstream and Request a Pull 476Using Scripts to Push a Change Upstream and Request a Pull
427========================================================== 477==========================================================
@@ -532,28 +582,6 @@ have been followed:
532 $ poky/scripts/create-pull-request -h 582 $ poky/scripts/create-pull-request -h
533 $ poky/scripts/send-pull-request -h 583 $ poky/scripts/send-pull-request -h
534 584
535Take Patch Review into Account
536==============================
537
538You may get feedback on your submitted patches from other community members
539or from the automated patchtest service. If issues are identified in your
540patch then it is usually necessary to address these before the patch will be
541accepted into the project. In this case you should amend the patch according
542to the feedback and submit an updated version to the relevant mailing list,
543copying in the reviewers who provided feedback to the previous version of the
544patch.
545
546The patch should be amended using ``git commit --amend`` or perhaps ``git
547rebase`` for more expert git users. You should also modify the ``[PATCH]``
548tag in the email subject line when sending the revised patch to mark the new
549iteration as ``[PATCH v2]``, ``[PATCH v3]``, etc as appropriate. This can be
550done by passing the ``-v`` argument to ``git format-patch`` with a version
551number.
552
553Lastly please ensure that you also test your revised changes. In particular
554please don't just edit the patch file written out by ``git format-patch`` and
555resend it.
556
557Submitting Changes to Stable Release Branches 585Submitting Changes to Stable Release Branches
558============================================= 586=============================================
559 587
@@ -610,6 +638,100 @@ follows:
610 and in the following sections but modify the subject header of your patch 638 and in the following sections but modify the subject header of your patch
611 email to include the name of the stable branch which you are 639 email to include the name of the stable branch which you are
612 targetting. This can be done using the ``--subject-prefix`` argument to 640 targetting. This can be done using the ``--subject-prefix`` argument to
613 ``git format-patch``, for example to submit a patch to the dunfell 641 ``git format-patch``, for example to submit a patch to the
614 branch use 642 "&DISTRO_NAME_NO_CAP_MINUS_ONE;" branch use::
615 ``git format-patch --subject-prefix='&DISTRO_NAME_NO_CAP_MINUS_ONE;][PATCH' ...``. 643
644 git format-patch --subject-prefix='&DISTRO_NAME_NO_CAP_MINUS_ONE;][PATCH' ...
645
646Taking Patch Review into Account
647================================
648
649You may get feedback on your submitted patches from other community members
650or from the automated patchtest service. If issues are identified in your
651patches then it is usually necessary to address these before the patches are
652accepted into the project. In this case you should your commits according
653to the feedback and submit an updated version to the relevant mailing list.
654
655In any case, never fix reported issues by fixing them in new commits
656on the tip of your branch. Always come up with a new series of commits
657without the reported issues.
658
659.. note::
660
661 It is a good idea to send a copy to the reviewers who provided feedback
662 to the previous version of the patch. You can make sure this happens
663 by adding a ``CC`` tag to the commit description::
664
665 CC: William Shakespeare <bill@yoctoproject.org>
666
667A single patch can be amended using ``git commit --amend``, and multiple
668patches can be easily reworked and reordered through an interactive Git rebase::
669
670 git rebase -i <ref-branch>
671
672See `this tutorial <https://hackernoon.com/beginners-guide-to-interactive-rebasing-346a3f9c3a6d>`__
673for practical guidance about using Git interactive rebasing.
674
675You should also modify the ``[PATCH]`` tag in the email subject line when
676sending the revised patch to mark the new iteration as ``[PATCH v2]``,
677``[PATCH v3]``, etc as appropriate. This can be done by passing the ``-v``
678argument to ``git format-patch`` with a version number::
679
680 git format-patch -v2 <ref-branch>
681
682Lastly please ensure that you also test your revised changes. In particular
683please don't just edit the patch file written out by ``git format-patch`` and
684resend it.
685
686Tracking the Status of Patches
687==============================
688
689The Yocto Project uses a `Patchwork instance <https://patchwork.yoctoproject.org/>`__
690to track the status of patches submitted to the various mailing lists and to
691support automated patch testing. Each submitted patch is checked for common
692mistakes and deviations from the expected patch format and submitters are
693notified by ``patchtest`` if such mistakes are found. This process helps to
694reduce the burden of patch review on maintainers.
695
696.. note::
697
698 This system is imperfect and changes can sometimes get lost in the flow.
699 Asking about the status of a patch or change is reasonable if the change
700 has been idle for a while with no feedback.
701
702If your patches have not had any feedback in a few days, they may have already
703been merged. You can run ``git pull`` branch to check this. Note that many if
704not most layer maintainers do not send out acknowledgement emails when they
705accept patches. Alternatively, if there is no response or merge after a few days
706the patch may have been missed or the appropriate reviewers may not currently be
707around. It is then perfectly fine to reply to it yourself with a reminder asking
708for feedback.
709
710.. note::
711
712 Patch reviews for feature and recipe upgrade patches are likely be delayed
713 during a feature freeze because these types of patches aren't merged during
714 at that time --- you may have to wait until after the freeze is lifted.
715
716Maintainers also commonly use ``-next`` branches to test submissions prior to
717merging patches. Thus, you can get an idea of the status of a patch based on
718whether the patch has been merged into one of these branches. The commonly
719used testing branches for OpenEmbedded-Core are as follows:
720
721- *openembedded-core "master-next" branch:* This branch is part of the
722 :oe_git:`openembedded-core </openembedded-core/>` repository and contains
723 proposed changes to the core metadata.
724
725- *poky "master-next" branch:* This branch is part of the
726 :yocto_git:`poky </poky/>` repository and combines proposed
727 changes to BitBake, the core metadata and the poky distro.
728
729Similarly, stable branches maintained by the project may have corresponding
730``-next`` branches which collect proposed changes. For example,
731``&DISTRO_NAME_NO_CAP;-next`` and ``&DISTRO_NAME_NO_CAP_MINUS_ONE;-next``
732branches in both the "openembdedded-core" and "poky" repositories.
733
734Other layers may have similar testing branches but there is no formal
735requirement or standard for these so please check the documentation for the
736layers you are contributing to.
737