summaryrefslogtreecommitdiffstats
path: root/documentation/contributor-guide
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/contributor-guide')
-rw-r--r--documentation/contributor-guide/recipe-style-guide.rst20
-rw-r--r--documentation/contributor-guide/submit-changes.rst94
2 files changed, 107 insertions, 7 deletions
diff --git a/documentation/contributor-guide/recipe-style-guide.rst b/documentation/contributor-guide/recipe-style-guide.rst
index 08d8fb4259..806bf23848 100644
--- a/documentation/contributor-guide/recipe-style-guide.rst
+++ b/documentation/contributor-guide/recipe-style-guide.rst
@@ -47,10 +47,10 @@ Debian policy closely.
47 47
48When a recipe references a git revision that does not correspond to a released 48When a recipe references a git revision that does not correspond to a released
49version of software (e.g. is not a tagged version), the :term:`PV` variable 49version of software (e.g. is not a tagged version), the :term:`PV` variable
50should include the Git revision using the following to make the 50should include the sign ``+``, so :term:`bitbake` automatically includes package
51version clear:: 51version information during the packaging phase::
52 52
53 PV = "<version>+git${SRCPV}" 53 PV = "<version>+git"
54 54
55In this case, ``<version>`` should be the most recently released version of the 55In this case, ``<version>`` should be the most recently released version of the
56software from the current source revision (``git describe`` can be useful for 56software from the current source revision (``git describe`` can be useful for
@@ -395,7 +395,7 @@ one CVE is fixed, separate them using spaces.
395CVE Examples 395CVE Examples
396------------ 396------------
397 397
398This should be the header of patch that fixes :cve:`2015-8370` in GRUB2:: 398This should be the header of patch that fixes :cve_nist:`2015-8370` in GRUB2::
399 399
400 grub2: Fix CVE-2015-8370 400 grub2: Fix CVE-2015-8370
401 401
@@ -409,3 +409,15 @@ This should be the header of patch that fixes :cve:`2015-8370` in GRUB2::
409 Upstream-Status: Backport [http://git.savannah.gnu.org/cgit/grub.git/commit/?id=451d80e52d851432e109771bb8febafca7a5f1f2] 409 Upstream-Status: Backport [http://git.savannah.gnu.org/cgit/grub.git/commit/?id=451d80e52d851432e109771bb8febafca7a5f1f2]
410 CVE: CVE-2015-8370 410 CVE: CVE-2015-8370
411 Signed-off-by: Joe Developer <joe.developer@example.com> 411 Signed-off-by: Joe Developer <joe.developer@example.com>
412
413Patch format
414============
415
416By default, patches created with ``git format-patch`` have a `Git` version signature at the end.
417To avoid having a `Git` signature at the end of generated or updated patches,
418you can use `Git` configuration settings::
419
420 git config --global format.signature ""
421
422.. note::
423 Patches generated or updated by ``devtool`` are created with no signature.
diff --git a/documentation/contributor-guide/submit-changes.rst b/documentation/contributor-guide/submit-changes.rst
index dfeb0305c3..adb78fa08d 100644
--- a/documentation/contributor-guide/submit-changes.rst
+++ b/documentation/contributor-guide/submit-changes.rst
@@ -65,11 +65,18 @@ use to identify your commits::
65 git config --global user.name "Ada Lovelace" 65 git config --global user.name "Ada Lovelace"
66 git config --global user.email "ada.lovelace@gmail.com" 66 git config --global user.email "ada.lovelace@gmail.com"
67 67
68By default, Git adds a signature line at the end of patches containing the Git
69version. We suggest to remove it as it doesn't add useful information.
70
71Remove it with the following command::
72
73 git config --global format.signature ""
74
68Clone the Git repository for the component to modify 75Clone the Git repository for the component to modify
69---------------------------------------------------- 76----------------------------------------------------
70 77
71After identifying the component to modify as described in the 78After identifying the component to modify as described in the
72":doc:`../contributor-guide/identify-component`" section, clone the 79":doc:`/contributor-guide/identify-component`" section, clone the
73corresponding Git repository. Here is an example for OpenEmbedded-Core:: 80corresponding Git repository. Here is an example for OpenEmbedded-Core::
74 81
75 git clone https://git.openembedded.org/openembedded-core 82 git clone https://git.openembedded.org/openembedded-core
@@ -440,7 +447,7 @@ varies by component:
440 447
441For changes to other layers and tools hosted in the Yocto Project source 448For changes to other layers and tools hosted in the Yocto Project source
442repositories (i.e. :yocto_git:`git.yoctoproject.org <>`), use the 449repositories (i.e. :yocto_git:`git.yoctoproject.org <>`), use the
443:yocto_lists:`yocto </g/yocto/>` general mailing list. 450:yocto_lists:`yocto-patches </g/yocto-patches/>` general mailing list.
444 451
445For changes to other layers hosted in the OpenEmbedded source 452For changes to other layers hosted in the OpenEmbedded source
446repositories (i.e. :oe_git:`git.openembedded.org <>`), use 453repositories (i.e. :oe_git:`git.openembedded.org <>`), use
@@ -483,7 +490,7 @@ typical usage of ``git send-email``::
483 git send-email --to <mailing-list-address> *.patch 490 git send-email --to <mailing-list-address> *.patch
484 491
485Then, review each subject line and list of recipients carefully, and then 492Then, review each subject line and list of recipients carefully, and then
486and then allow the command to send each message. 493allow the command to send each message.
487 494
488You will see that ``git send-email`` will automatically copy the people listed 495You will see that ``git send-email`` will automatically copy the people listed
489in any commit tags such as ``Signed-off-by`` or ``Reported-by``. 496in any commit tags such as ``Signed-off-by`` or ``Reported-by``.
@@ -769,6 +776,38 @@ argument to ``git format-patch`` with a version number::
769 776
770 git format-patch -v2 <ref-branch> 777 git format-patch -v2 <ref-branch>
771 778
779
780After generating updated patches (v2, v3, and so on) via ``git
781format-patch``, ideally developers will add a patch version changelog
782to each patch that describes what has changed between each revision of
783the patch. Add patch version changelogs after the ``---`` marker in the
784patch, indicating that this information is part of this patch, but is not
785suitable for inclusion in the commit message (i.e. the git history) itself.
786Providing a patch version changelog makes it easier for maintainers and
787reviewers to succinctly understand what changed in all versions of the
788patch, without having to consult alternate sources of information, such as
789searching through messages on a mailing list. For example::
790
791 <patch title>
792
793 <commit message>
794
795 <Signed-off-by/other trailers>
796 ---
797 changes in v4:
798 - provide a clearer commit message
799 - fix spelling mistakes
800
801 changes in v3:
802 - replace func() to use other_func() instead
803
804 changes in v2:
805 - this patch was added in v2
806 ---
807 <diffstat output>
808
809 <unified diff>
810
772Lastly please ensure that you also test your revised changes. In particular 811Lastly please ensure that you also test your revised changes. In particular
773please don't just edit the patch file written out by ``git format-patch`` and 812please don't just edit the patch file written out by ``git format-patch`` and
774resend it. 813resend it.
@@ -825,3 +864,52 @@ Other layers may have similar testing branches but there is no formal
825requirement or standard for these so please check the documentation for the 864requirement or standard for these so please check the documentation for the
826layers you are contributing to. 865layers you are contributing to.
827 866
867Acceptance of AI Generated Code
868===============================
869
870The Yocto Project and OpenEmbedded follow the guidance of the Linux Foundation
871in regards to the use of generative AI tools. See:
872https://www.linuxfoundation.org/legal/generative-ai.
873
874All of the existing guidelines in this document are expected to be followed,
875including in the :doc:`/contributor-guide/recipe-style-guide`, and contributing the changes with
876additional requirements to the items in section
877:ref:`contributor-guide/submit-changes:Implement and commit changes`.
878
879All AI Generated Code must be labeled as such in the commit message,
880prior to your ``Signed-off-by`` line. It is also strongly recommended,
881that any patches or code within the commit also have a comment or other
882indication that this code was AI generated.
883
884For example, here is a properly formatted commit message::
885
886 component: Add the ability to ...
887
888 AI-Generated: Uses GitHub Copilot
889
890 Signed-off-by: Your Name <your.name@domain>
891
892The ``Signed-off-by`` line must be written by you, and not the AI helper.
893As a reminder, when contributing a change, your ``Signed-off-by`` line is
894required and the stipulations in the `Developer's Statement of Origin
8951.1 <https://developercertificate.org/>`__ still apply.
896
897Additionally, you must stipulate AI contributions conform to the Linux
898Foundation policy, specifically:
899
900#. Contributors should ensure that the terms and conditions of the generative AI
901 tool do not place any contractual restrictions on how the tool's output can
902 be used that are inconsistent with the project's open source software
903 license, the project's intellectual property policies, or the Open Source
904 Definition.
905
906#. If any pre-existing copyrighted materials (including pre-existing open
907 source code) authored or owned by third parties are included in the AI tool's
908 output, prior to contributing such output to the project, the Contributor
909 should confirm that they have permission from the third party
910 owners -- such as the form of an open source license or public domain
911 declaration that complies with the project's licensing policies -- to use and
912 modify such pre-existing materials and contribute them to the project.
913 Additionally, the contributor should provide notice and attribution of such
914 third party rights, along with information about the applicable license
915 terms, with their contribution.