Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
submitting-patches [2020/09/03 13:14] – needs to be specified what web interface that is, and this is also valid for applications that provide a GUI for git bobafetthotmailsubmitting-patches [2024/06/17 08:59] – old revision restored (2024/01/03 07:44) svanheule
Line 2: Line 2:
 See also: See also:
   * [[docs:guide-developer:working-with-git-email|Sending patches by git send-email]]   * [[docs:guide-developer:working-with-git-email|Sending patches by git send-email]]
-  * If you are using GitHub read also [[docs:guide-developer:working-with-github-pr|Working with GitHub]].+  * If you are using GitHubread also [[docs:guide-developer:working-with-github-pr|Working with GitHub]].
  
-Patches can be submitted as a pull request on GitHub or via the mailing list.+=====Deciding where to send the patch=====  
 + 
 +  * **Patches to core packages and patches that add support for new devices** (i.e. code that is in [[https://git.openwrt.org/?p=openwrt/openwrt.git;a=summary|the main OpenWrt repository]] ) can be submitted as a pull request on [[https://github.com/openwrt/openwrt|the GitHub mirror]] or via the mailing list. 
 + 
 +  * **Patches for LuCI web interface and related packages** can be submitted to mailing list or to the [[https://github.com/openwrt/luci/| Github mirror]] of the LuCI git repository.  Specific guidelines and hints for contributing to the //LuCI// repo may be found at [[https://github.com/openwrt/luci/blob/master/CONTRIBUTING.md| Contributing Guidelines]]. 
 + 
 +  * **Patches for community packages about routing** should go as a Github PR in the [[https://github.com/openwrt-routing/packages| OpenWrt community routing packages repo]].  Use the //packages// contributing guidelines below when contributing to the //routing// repo. 
 + 
 +  * **Patches for community packages about telephony and SIP/VOIP** should go as a Github PR in the  [[https://github.com/openwrt/telephony| OpenWrt community telephony packages repo]].  Use the //packages// contributing guidelines below when contributing to the //telephony// repo. 
 + 
 +  * **Patches for miscellaneous community packages** should go as a Github PR in the [[https://github.com/openwrt/packages|OpenWrt community package repo]].  Specific guidelines and hints for contributing to the //packages// repo may be found at [[https://github.com/openwrt/packages/blob/master/CONTRIBUTING.md| Contributing Guidelines]]. 
 + 
 +<WRAP round info 60%> 
 +**If you want to add a new package that is not specific for a device** nor crucial to compile or use OpenWrt on a device, (i.e. tools, compilers, runtimes libraries, VPNs, media servers, backup servers and more), **open a PR in the appropriate community packages repository mentioned above.** Note that if you add a package you usually must assign yourself as "maintainer" of it. 
 +</WRAP> 
 +  
 + 
 +===== Submission Guidelines =====
  
 Submissions should follow the following guidelines: Submissions should follow the following guidelines:
Line 31: Line 48:
  
   * **all commits must contain ''%%Signed-off-by: My Name <my@email.address>%%'' where you write your real name and real email address**, in accordance with [[http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=HEAD#n416|Section 11 of the Linux Kernel patches guide]]   * **all commits must contain ''%%Signed-off-by: My Name <my@email.address>%%'' where you write your real name and real email address**, in accordance with [[http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=HEAD#n416|Section 11 of the Linux Kernel patches guide]]
-    * Github web interface or GUI application for git: you must append the the ''Signed-off-by:'' line manually in the commit description+    * GitHub web interface or GUI application for git: you must append the ''Signed-off-by:'' line manually in the commit description
     * git command-line interface:     * git command-line interface:
  
Line 39: Line 56:
  
   * **the ''Author'' field must match the ''Signed-off-by:'' line**   * **the ''Author'' field must match the ''Signed-off-by:'' line**
-    * Github web interface: you must specify your real name in the ''Name'' field and the ''Primary email address'' in GitHub to match the ''Signed-off-by:'' line+    * GitHub web interface: you must specify your real name in the ''Name'' field and the ''Primary email address'' to match the ''Signed-off-by:'' line
     * git command-line interface:     * git command-line interface:
  
Line 53: Line 70:
   - PRs can be sent to the patches mailing list from any source and will always be considered for inclusion if the quality of the tree is good and format of submission is correct   - PRs can be sent to the patches mailing list from any source and will always be considered for inclusion if the quality of the tree is good and format of submission is correct
   - Staging trees can be hosted as part of the projects git infrastructure, private servers, GitHub ...   - Staging trees can be hosted as part of the projects git infrastructure, private servers, GitHub ...
 +===== Patch backports ===== 
 +Backporting refers to applying changes to a stable (release) branch like for example **openwrt-23.05** from the **main** branch. Since new features are not added to stable branches, backported changes are generally bug fixes and security fixes only. The process is roughly following: 
 +  - Changes needs to be first applied into the **main** branch 
 +  - Afterwards those changes can be proposed to be applied into the stable (release) branch 
 +When pulling the commits from the **main** branch, you need to use ''git cherry-pick'' command with the ''-x'' argument and thus append a line that says ''(cherry picked from commit <commit>)'' to the original commit message ([[https://github.com/openwrt/openwrt/commit/59fd8f08cf544a7f0fcaf700ca9af9292de3adcc.patch|example]]) in order to indicate which commit this change was cherry-picked from. This is needed for traceability. It is also required that you add the ''--signoff'' to the commits, if you did not create the original commits. 
 +<code bash> 
 +$ git cherry-pick --signoff -x <commit> 
 +</code>
 ===== Patch checklist ===== ===== Patch checklist =====
   - Single commit ( multiple commits must first be squashed, as described [[docs:guide-developer:working-with-github-pr#squashing_commits|here]]  )   - Single commit ( multiple commits must first be squashed, as described [[docs:guide-developer:working-with-github-pr#squashing_commits|here]]  )
Line 79: Line 103:
 Based on [[https://www.kernel.org/doc/html/latest/process/submitting-patches.html|​Linux Kernel patch submission guidelines]]. Based on [[https://www.kernel.org/doc/html/latest/process/submitting-patches.html|​Linux Kernel patch submission guidelines]].
  
-OpenWrt is constantly being improved. We'd like as many people to contribute to this as we can get. If you find a change useful, by all means try to get it incorporated into the project. This should improve OpenWrt and it should help carry your changes forward into future versions+OpenWrt is constantly being improved. We'd like as many people to contribute to this as we can get. If you find a change useful, by all means try to get it incorporated into the project. This should improve OpenWrt and it should help carry your changes forward into future versions.
  
 For a person or company who wishes to submit a change to OpenWrt, the process can sometimes be daunting if you're not familiar with "the system." This text is a collection of suggestions which can greatly increase the chances of your change being accepted. For a person or company who wishes to submit a change to OpenWrt, the process can sometimes be daunting if you're not familiar with "the system." This text is a collection of suggestions which can greatly increase the chances of your change being accepted.
- 
-This document tries to lay out a procedure to enable people to submit patches in a way that is most effective for all concerned. 
  
 It is important to do all these steps repeatedly: It is important to do all these steps repeatedly:
   * Listen to what other people think.   * Listen to what other people think.
-  * Talk explaining what problem you are addressing and your proposed solution. +  * Explain what problem you are addressing and your proposed solution. 
-  * Do write useful patches including documentation.+  * Write useful patches including documentation.
   * Test, test, test.   * Test, test, test.
  
 Where to listen and talk: Where to listen and talk:
   * Google to find things related to your problem   * Google to find things related to your problem
-  * Wiki: check this [[:start|OpenWrt wiki]] +  * [[:start|OpenWrt wiki]] 
-  * ​Mailing Lists +  * ​[[:contact#mailing_lists|Mailing Lists]] 
-  * Forums like [[https://forum.openwrt.org]] +  * [[:contact#irc_channels|IRC]] 
-  * IRC irc.freenode.net, channels #openwrt and #openwrt-devel +  * [[https://forum.openwrt.org|OpenWrt Forum]] 
-  * TRAC ​​https://dev.openwrt.org/ the issue/bug/change tracking system. (TRAC is closed now, and only kept for archiving purposes.) +  * GitHub - ​https://github.com/openwrt/openwrt - trunk development and bugtracking 
-  * GitHub - ​http://github.com/openwrt - trunk development, and bugtracking has been moved here.+  * (archived) TRAC ​​https://dev.openwrt.org/ the issue/bug/change tracking system. (TRAC is closed now, and only kept for archiving purposes.)
  
 ===== Documentation ===== ===== Documentation =====
Line 106: Line 128:
 Read [[:submitting-patches#patch_checklist|Submit Checklist]] for a list of items to check before submitting code. Read [[:submitting-patches#patch_checklist|Submit Checklist]] for a list of items to check before submitting code.
  
-For patches against external package sources, refer to the quilt howto at [[docs:guide-developer:build-system:use-patches-with-buildsystem]]+For patches against external package sources, refer to the quilt howto at [[docs:guide-developer:toolchain:use-patches-with-buildsystem]]
  
 Please read ​[[https://www.kernel.org/doc/html/v4.11/process/email-clients.html|Email clients for patches]] to find out how to make sure your email client doesn't destroy your patch. Please read ​[[https://www.kernel.org/doc/html/v4.11/process/email-clients.html|Email clients for patches]] to find out how to make sure your email client doesn't destroy your patch.
Line 115: Line 137:
 Patches should be based in the root trunk, not in any lower subdirectory. Patches should be based in the root trunk, not in any lower subdirectory.
  
-Make sure your patch does not include any extra files which do not belong in a patch submission. Make sure to review your patch -afteryou have generated it, to ensure accuracy.+Make sure your patch does not include any extra files which do not belong in a patch submission. 
 +Be sure to review your patch **after** you have generated it, to ensure accuracy.
  
-If your changes produce a lot of deltas, you may want to look into splitting them into individual patches which modify things in logical stages. This will facilitate easier reviewing by other OpenWrt developers, which is very important if you want your patch to be accepted.+If your changes produce a lot of deltas, you may want to look into splitting them into individual patches which modify things in logical stages. 
 +This will facilitate easier reviewing by other OpenWrt developers, which is very important if you want your patch to be accepted.
  
 The tools you can use to create a patch, in order of preference, are: The tools you can use to create a patch, in order of preference, are:
Line 124: Line 148:
    * diff    * diff
  
-To ease integration of smaller patches into trunk, developers can also make pull-requests into the GitHub trunk tree - this is an addition over the earlier patchwork workflow. Larger patches, or patches that require further discussion, should still be sent to the openwrt-devel list, where they'll be commented upon, and committed into trunk at some point.+To ease integration of smaller patches into trunk, developers can also make pull-requests into the GitHub trunk tree - this is an addition over the earlier patchwork workflow. 
 +Larger patches, or patches that require further discussion, should still be sent to the **openwrt-devel** list, where they'll be commented upon, and committed into trunk at some point.
  
 ==== 2. Describe your changes ===== ==== 2. Describe your changes =====
Line 172: Line 197:
 Large changes are not appropriate for mailing lists, and some maintainers. If your patch, uncompressed, exceeds 300 kB in size, it is preferred that you store your patch on an Internet-accessible server, and provide instead a URL (link) pointing to your patch. Large changes are not appropriate for mailing lists, and some maintainers. If your patch, uncompressed, exceeds 300 kB in size, it is preferred that you store your patch on an Internet-accessible server, and provide instead a URL (link) pointing to your patch.
  
-==== 8. Don't get discouraged, re-submit =====+==== 8. Remain objective, re-submit ===== 
 + 
 +It's nothing personal. Code should work well for its intended purpose and results should adhere to many standards and requirements, so finding problems early is a good thing.  
 After you have submitted your change, be patient and wait. If developers like your change and apply it, it will appear as new revision in the source code management system. After you have submitted your change, be patient and wait. If developers like your change and apply it, it will appear as new revision in the source code management system.
  
Line 232: Line 260:
 using your real name (no pseudonyms or anonymous contributions.) using your real name (no pseudonyms or anonymous contributions.)
  
-If you are a package or target maintainer, sometimes you need to slightly modify patches you receive in order to merge them, because the code is not exactly the same in your tree and the submitters'. If you stick strictly to rule (c), you should ask the submitter to rediff, but this is a totally counter-productive waste of time and energy. Rule (b) allows you to adjust the code, but then it is very impolite to change one submitter's code and make him endorse your bugs. To solve this problem, it is recommended that you add a line between the last Signed-off-by header and yours, indicating the nature of your changes. While there is nothing mandatory about this, it seems like prepending the description with your mail and/or name, all enclosed in square brackets, is noticeable enough to make it obvious that you are responsible for last-minute changes. Example :+If you are a package or target maintainer, sometimes you need to slightly modify patches you receive in order to merge them, because the code is not exactly the same in your tree and the submitters'. If you stick strictly to rule (c), you should ask the submitter to rediff, but this is a totally counter-productive waste of time and energy. Rule (b) allows you to adjust the code, but then it is very impolite to change one submitter's code and make them endorse your bugs. To solve this problem, it is recommended that you add a line between the last Signed-off-by header and yours, indicating the nature of your changes. While there is nothing mandatory about this, it seems like prepending the description with your mail and/or name, all enclosed in square brackets, is noticeable enough to make it obvious that you are responsible for last-minute changes. Example :
  
 <code bash> <code bash>
Line 259: Line 287:
  
 ==== 11. When to use "Acked-by:" and "Cc:" ===== ==== 11. When to use "Acked-by:" and "Cc:" =====
-The Signed-off-by: tag indicates that the signer was involved in the development of the patch, or that he/she was in the patch's delivery path.+The Signed-off-by: tag indicates that the signer was involved in the development of the patch, or that they were in the patch's delivery path.
  
 If a person was not directly involved in the preparation or handling of a patch but wishes to signify and record their approval of it then they can arrange to have an Acked-by: line added to the patch's changelog. If a person was not directly involved in the preparation or handling of a patch but wishes to signify and record their approval of it then they can arrange to have an Acked-by: line added to the patch's changelog.
  • Last modified: 2024/12/06 16:55
  • by wertwert4pda