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
zh:submitting-patches [2019/08/01 06:44] – [提交补丁] lujimmyzh:submitting-patches [2020/03/08 15:52] – [10. 签署工作] superice
Line 1: Line 1:
 ====== 提交补丁 ====== ====== 提交补丁 ======
-请首先阅读[[docs:guide-developer:faq-development|Development FAQ]]如果您在使用GitHub阅[[docs:guide-developer:working-with-github-pr|Working with GitHub]]。+扩展阅读 
 +  * [[docs:guide-developer:working-with-git-email|使用git send-email提交补丁]] 
 +  * 如果你希望使用GitHub请阅[[docs:guide-developer:working-with-github-pr|使用GitHub提交修改]]。
  
-补丁可以通过推送向Github或邮件列表提交。+补丁可以通过邮件列表提交,也可以使用GitHub合并请求提交。
  
-提交操作需遵循以下原则:+提交补丁时,您需遵循以下原则:
  
   * 请为每次推送使用不同的git分支,如果您是通过网页编辑文件,GitHub将自动完成该操作。   * 请为每次推送使用不同的git分支,如果您是通过网页编辑文件,GitHub将自动完成该操作。
-  * 使用祈使句描述提交主题和信息,如“增加对X的支持”,而不“增加了对X的支持”+  * 使用祈使句描述提交主题和信息,"add support for X"而不是"added support for X"
  
   * **格式化代码**   * **格式化代码**
Line 15: Line 17:
   * **提交主题**    * **提交主题** 
     * 在提交时必须根据您所做的修改确定一个前缀     * 在提交时必须根据您所做的修改确定一个前缀
-      * **kernel:** 适用于kernel和kmod(kernel module)的软件包+      * **kernel:** 适用于kernel和kmod(内核模块)的软件包
       * **package name:** 适用于软件包        * **package name:** 适用于软件包 
       * **device architecture:** 适用设备。如, **mvebu:** 或 **ramips: add support to example_eval board**        * **device architecture:** 适用设备。如, **mvebu:** 或 **ramips: add support to example_eval board** 
       * **tool name:** 适用于工具       * **tool name:** 适用于工具
-      * **build:** 适用于无明确目普通版本 +      * **build:** 修改Openrt构建框架中除了/toolchain(交叉编译工具链)之外部分。 
-    * 长度不能多于50个字符+    * 长度__不能多于50个字符__
     * 必须描述提交的变化内容及提交的必要性。\\ 尽管要简明扼要的描述并不容易,但描写得当的总结无疑应该做到。     * 必须描述提交的变化内容及提交的必要性。\\ 尽管要简明扼要的描述并不容易,但描写得当的总结无疑应该做到。
     * 在前缀后请不要大写第一个单词     * 在前缀后请不要大写第一个单词
Line 27: Line 29:
   * **提交描述**    * **提交描述** 
     * 每行长度不能多于75个字符     * 每行长度不能多于75个字符
-    * 内容将提交至资源修改日志中因此您者解释您为什么提交\\ 包括您修复的错误症状(日志信息,错误信息等), 这对于那些想要通过查找提交日志来修复问题的人将至关重要\\ 如果是一个修复编译失败的补丁,请包含失败相关的部分日志。 +    * 提交描述将会被保存进码的修改目录__这个描述当能开发解释提交原因__\\ 包括您修复的错误症状(比如日志信息,错误信息等), 这对于那些想要通过查找提交日志来修复问题的人将至关重要\\ 如果是一个修复编译错误的补丁,请包含编译错误中最相关的部分。 
-    * 如果您添加了对新硬件的支持,提交描述中此硬件进行简短描述并说明如将OpenWrt安装到硬件。可访问 [[https://git.openwrt.org/?p=openwrt/openwrt.git&a=search&h=HEAD&st=commit&s=add+support+for|recent additions]] 查看更多示例。+    * 如果您添加了对新硬件的支持,提交描述中应包含设备配置的描述并简要说明如将OpenWrt安装到该设备。可访问 [[https://git.openwrt.org/?p=openwrt/openwrt.git&a=search&h=HEAD&st=commit&s=add+support+for|近期添加的设备]] 查看更多示例。
  
-  * **所有提交应该包含 ''%%Signed-off-by: My Name <my@email.address>%%'' 在此写下您的真实姓名和真实的电子邮件地址**,依照 [[http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=HEAD#n416|第11章:Linux内核补丁指南]]。 +  * **所有提交应该包含 ''%%Signed-off-by: My Name <my@email.address>%%'' 在此写下您的__真实姓名__和真实的电子邮件地址**。请阅读 [[http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=HEAD#n416|第11章:Linux内核补丁指南]]了解您在留下这句话时所声明满足的义务。 
-    * 在git命令行中使用以下代码,可自动完成该操作。 +    * 在git命令行中使用以下代码,可自动完成该操作
-<code bash>git commit --signoff</code>+
  
-  栏 **必须** 与"Signed-off-by:" 一致。 +<code bash> 
 +git commit --signoff 
 +</code> 
 + 
 +  提交(Author) **必须** 与"Signed-off-by:" 一致。 
     * 如果您使用GitHub编辑文件并提交,您必须在GitHub设置中“Name”栏填写您的真实姓名,同时在"Signed-off-by:"中填写您Github帐户的首要邮件地址。     * 如果您使用GitHub编辑文件并提交,您必须在GitHub设置中“Name”栏填写您的真实姓名,同时在"Signed-off-by:"中填写您Github帐户的首要邮件地址。
-    * 如果您在PC本地编辑文件并提交,通过以代码设置您的姓名和邮件地址+    * 如果您在PC本地编辑文件并提交,您需要使用面的命令设置您的姓名和邮件地址: 
 <code bash> <code bash>
 git config --global user.name "my name" git config --global user.name "my name"
-git config --global user.email "my@email.address"</code> +git config --global user.email "my@email.address" 
-===== 补丁合并及树的生命周期 =====+</code>
  
-我们鼓励高频的提交者主导他们自己的分级树,以便汇集由他们负责和(或)创建的补丁。一旦经过审查和测试,就可以提议将其包含在主分支中。 +===== 补丁合并及补丁代码分支的生命周期 ===== 
- +我们鼓励高频的提交者主导他们自己的补丁代码,以便汇集由他们负责和(或)创建的补丁。一旦补丁代码分支经过审查和测试,就可以提议将其包含在主分支中。 
-  - 随时都可能被合并到主分支中+  - 补丁代码分支随时都可能被合并到主分支中
   - 错误修复将直接合并到主分支   - 错误修复将直接合并到主分支
-  - PR可以从任何途径发送到补丁邮件列表。只要树的质量好且提交格式正确,将始终考虑包含该PR。 +  - 合并请求(Pull request)可以从任何途径发送到补丁邮件列表。只要补丁满足要求且提交格式正确,就会被考虑合并。 
-  - 分级树可以作为项目的一部分git基础架构专用服务器或GitHub托管+  - 补丁可以作为项目的一部分托管于本项目git服务器其他个人服务器或GitHub上 
 ===== 补丁检查表 ===== ===== 补丁检查表 =====
-  - 单个提交 (如上所述,提交会被挤压+  - 补丁是一整条提交 ( 多提交记录需要先进行合并(squash)可以参考[[docs:guide-developer:working-with-github-pr#squashing_commits|这里]]了解具体操作 
-  - 长度小于50个字符 +  - 于50个字符 
-  - 题后一行 +  - 题后应当有行空行 
-  - 每行描述长度小于75个字符 +  - 补丁描述的每一行少于75个字符 
-  - 使用 **什么** 描述解释修改的内容 +  - 描述应当解释修改的内容 
-  - 使用 **为什么** 来解释修改的原因   +  - 描述还应当解释修改的原因 
-  - 描述应该是实际意义 +  - 请确保描述的内容有意义 
-  - Signoff行包含真实姓名 +  - Signoff应当使用真实姓名 
-  - Signoff行包含真实邮件地址 +  - Signoff也需要使用真实邮件地址 
-  - If it's a third-party patch, then preserve Signoff line from the original author +  - 如果这个补丁来自第三人,请保留原作者的Signoff 
-  - Sender/Author name and email address matches Signoff line's real name and email address +  - 补丁发送者、作者的名字和邮件应当与Signoff行中的真实姓名和邮件一致。 
  
 ===== DTS检查表 ===== ===== DTS检查表 =====
  
-  - 不要忘记添加适当的许可证,建议添加 ''SPDX-License-Identifier: GPL-2.0-or-later OR MIT'', [[https://github.com/openwrt/openwrt/commit/221d3e023451cad0b60b8a47e8b788d6368108c2#diff-7ecb7639c5199e391573618b0e444894|点击查看更多详情]] +  - 不要忘记添加适当的开源许可证,推荐使用 ''SPDX-License-Identifier: GPL-2.0-or-later OR MIT ''[[https://github.com/openwrt/openwrt/commit/221d3e023451cad0b60b8a47e8b788d6368108c2#diff-7ecb7639c5199e391573618b0e444894|详情]] 
-  - 删除LED节点中''default-state = "off"''下的所有属性,([[https://github.com/openwrt/openwrt/commit/0d23fd2ab29a66f5d03187db4fac3e396b4f3b62|点击查看更多详情]]) +  - 删除LED节点中所有的''default-state = "off"'' ([[https://github.com/openwrt/openwrt/commit/0d23fd2ab29a66f5d03187db4fac3e396b4f3b62|详情]]) 
-  - 如果您要添加MTD Flash布局并且''label = "firmware"''或者节点名称为''firmware@xyz'', 请检查您是否添加了适当的compatible属性(如果用)[[https://github.com/openwrt/openwrt/pull/1586/commits/22c1d69e63a3e80c41baf3941d5e6deb2019d039|点击查看更多详情]] +  - 如果您要添加MTD Flash布局并且''label = "firmware"''或者节点名称为''firmware@xyz'', 请检查您是否添加了适当的compatible属性(如果用) [[https://github.com/openwrt/openwrt/pull/1586/commits/22c1d69e63a3e80c41baf3941d5e6deb2019d039|详情]] 
-  - 如果可能,尝试将一些LED用于[[https://github.com/openwrt/openwrt/blob/master/package/base-files/files/etc/diag.sh|diag.sh]]中的系统状态指示[[https://github.com/openwrt/openwrt/blob/master/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dts#L13|例如。]] +  - 如果可能,尝试将一些LED用于[[https://github.com/openwrt/openwrt/blob/master/package/base-files/files/etc/diag.sh|diag.sh]]中的系统状态指示 [[https://github.com/openwrt/openwrt/blob/master/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dts#L13|例]] 
-  - 节点名称应反映设备的功能,而不是其型号。有关用节点名称的示例,请查阅[[https://github.com/devicetree-org/devicetree-specification/blob/master/source/devicetree-basics.rst#generic-names-recommendation|第2.2.2节 通用名称建议]]+  - 节点名称应反映设备的功能,而不是其型号。有关用节点名称的示例,请查阅[[https://github.com/devicetree-org/devicetree-specification/blob/master/source/devicetree-basics.rst#generic-names-recommendation|第2.2.2节 通用名称建议]]
   - 删除除“memory”和“cpu”节点外的所有[[https://github.com/devicetree-org/devicetree-specification/blob/master/source/devicetree-basics.rst#device_type-deprecated|已弃用"device_type"]]属性。   - 删除除“memory”和“cpu”节点外的所有[[https://github.com/devicetree-org/devicetree-specification/blob/master/source/devicetree-basics.rst#device_type-deprecated|已弃用"device_type"]]属性。
-===== In-depth process of preparing and submitting code to OpenWrt ===== 
-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的深入过程 =====
  
-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.+基于 [[https://www.kernel.org/doc/html/latest/process/submitting-patches.html|​Linux内核补丁提交指南]].
  
-This document tries to lay out a procedure to enable people to submit patches in a way that is most effective for all concerned.+OpenWrt一直在不断改进。我们希望尽可能多的人为这一点做出贡献。如果你发现改变是有用的,一定要设法把它纳入项目中。这样做可以使OpenWrt得到改进,并且有助于将您的更改转发到将来的版本中。
  
-It is important to do all these steps repeatedly: +对于希望向OpenWrt提交更改的个人或公司,如果你不熟悉“系统”,这个过程有时会令人畏惧。
-  * Listen to what other people think. +
-  * Talk explaining what problem you are addressing and your proposed solution. +
-  * Do write useful patches including documentation. +
-  * Test, test, test.+
  
-Where to listen and talk: +本文档试图制定一种程序,使人们能够以最有效的方式提交补丁。
-  * Google to find things related to your problem +
-  * Wiki: check this [[:start|OpenWrt wiki]] +
-  * ​Mailing Lists +
-  * Forums like [[https://forum.openwrt.org]] +
-  * IRC irc.freenode.net, channels #openwrt and #openwrt-devel +
-  * TRAC ​​https://dev.openwrt.org/ the issue/bug/change tracking system. (TRAC is closed now, and only kept for archiving purposes.) +
-  * Github - ​http://github.com/openwrt - trunk development, and bugtracking has been moved here.+
  
-===== Documentation ===== +重复这些步骤是很重要的:
-It is often best to document what you are doing before you do it. The process of documentation often exposes possible improvements. Keep your documentation up to date.+
  
-===== Creating and sending your change ===== +  * 听听别人的想法。 
-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]]+在哪里交流:
  
-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.+  * 谷歌找到与你的问题有关的东西 
 +  * 维基: [[:start|OpenWrt wiki]] 
 +  * 邮件列表 
 +  * 论坛: [[https://forum.openwrt.org]] 
 +  * IRC irc.freenode.net,频道#openwrt和 #openwrt-devel 
 +  * TRAC ​​https://dev.openwrt.org/ 问题/错误/变更跟踪系统。(Trac现在关闭,只保留存档的目的。) 
 +  * Github ​http://github.com/openwrt - 代码开发主线和问题跟踪已经搬到这里。
  
-==== 1. Creating a patch ===== +===== 补丁说明文档 ===== 
-All changes to OpenWrt occur in the form of patches.+通常最好先记录自己在做什么,然后再做。文档编制过程通常会揭示可能的改进。请及时更新文档。 
 +===== 创建和提交更改(补丁) ===== 
 +在提交补丁前,请仔细阅读 [[:zh/submitting-patches#补丁检查表|补丁检查表]],并根据列表逐项检查补丁。
  
-Patches should be based in the root trunk, not in any lower subdirectory.+对于外部软件包的补丁程序,请参阅[[docs:guide-developer:build-system:use-patches-with-buildsystem]]上的quilt howto。
  
-Make sure your patch does not include any extra files which do not belong in a patch submissionMake sure to review your patch -after- you have generated it, to ensure accuracy.+请阅读​[[https://www.kernel.org/doc/html/v4.11/process/email-clients.html|电子邮件客户端发送/获取补丁]],以了解如何确保电子邮件客户端不会破坏您的补丁。 
 +==== 1创建补丁 =====
  
-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.+OpenWRT的所有更改都以补丁的形式出现。 
 + 
 +补丁应基于根目录,而不应位于任何较低的子目录中。 
 + 
 +请确保您的补丁不包括任何额外文件, 确保在生成补丁后对其进行检查,以确保准确性。 
 + 
 +如果您的更改产生大量增量,则可能需要研究将其拆分为单个补丁,这些补丁会在逻辑阶段进行修改。 这将有助于其他OpenWrt开发人员更轻松地进行检查,如果您希望补丁被接受,这非常重要。 
 + 
 +您可以按照自己的喜好使用不同的工具创建补丁:
  
-The tools you can use to create a patch, in order of preference, are: 
    * Git    * Git
    * SVN    * SVN
    * 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.+为了简化将较小补丁集成到主干中的问题,开发人员还可以向Github主干树中进行拉取请求-这是对早期补丁工作流程的补充。 较大的补丁或需要进一步讨论的补丁仍应发送至openwrt-devel列表,在此处对其进行评审,并在某些时候提交到主干。 
 + 
 + 
 +==== 2. 描述更改内容 ===== 
 + 
 +描述补丁的技术细节。 
 + 
 +要尽可能具体。 最糟糕的描述可能包括诸如“对程序包X的更改”,“对程序包X的错误修复”或“此补丁包括针对平台X的更新。请申请。”之类的内容。 
 + 
 +维护者将感谢您以一种“无需修改”格式编写您的补丁描述,这种“无需修改”格式的补丁可以直接作为OpenWRT源代码管理系统的提交使用。见下面的第十三章。 
 + 
 + 
 +如果您的描述开始变长,则表明您可能需要拆分补丁。 请参阅下面的第3部分。 
 + 
 +当您提交或重新提交补丁或补丁系列时,请包括完整的补丁说明和说明。 不要只是说这是补丁(系列)的N版本。 不要指望补丁合并者会引用较早的补丁版本或引用的URL来查找补丁说明并将其放入补丁中。 即,补丁(系列)及其说明应是独立的,非相互引用的。 这使补丁合并者和审核者都受益。 一些评论者甚至可能没有收到补丁的早期版本。 
 + 
 +如果补丁修复了已记录的错误跟踪条目,请按编号引用该错误条目。 
 + 
 + 
 + 
 +==== 3拆分更改内容 ===== 
 +将“__逻辑更改__”分开到单个补丁文件中。
  
-==== 2. Describe your changes ===== +例如,如果您的更改包括单个程序包的错误修复和增强功能,请将这些更改分为两个或多个补丁程序。
-Describe the technical detail of the change(s) your patch includes.+
  
-Be as specific as possible. The WORST descriptions possible include things like "changes for package X", "bug fix for package X", or "this patch includes updates for platform X. Please apply."+另一方面,如果您对多个文件进行了一次更改,则将这些更改分组到一个补丁中。 因此,单个“__逻辑更改__”包含在单个补丁中。
  
-The maintainer will thank you if you write your patch description in a form which can be used unmodified as a commit message for OpenWrt source code management system. See par.13, below.+如果一个补丁依赖于另一个补丁才能完成更改,只需在补丁说明中注明“此补丁取决于补丁X”。
  
-If your description starts to get long, that's a sign that you probably need to split up your patch. See par.3, next.+如果您不能将补丁集压缩为更小的补丁集,则一次仅发布15个左右,然后等待审核和集成。
  
-When you submit or resubmit a patch or patch series, include the complete patch description and justification for it. Don't just say that this is version N of the patch (series). Don't expect the patch merger to refer back to earlier patch versions or referenced URLs to find the patch description and put that into the patch. I.e., the patch (series) and its description should be self-contained. This benefits both the patch merger(s) and reviewers. Some reviewers probably didn't even receive earlier versions of the patch.+==== 4更改内容格式检查 =====
  
-If the patch fixes a logged bug trac entry, refer to that bug entry by number.+检查您的补丁程序是否存在“基本样式”冲突。 否则,只会浪费审阅者的时间,并且会拒绝您的补丁,甚至可能不会被阅读。 
 +==== 5选择邮件目的地 ===== 
 +请查看Makefile,是否存在MAINTAINER宏。 如果存在,则请给该人发送电子邮件。 除非您有理由不这样做,否则请始终CC openwrt-devel <at> list.openwrt.org。 如果未列出维护者,请将补丁发送到[[https://lists.openwrt.org/mailman/listinfo/openwrt-devel|​主要的OpenWrt开发者的邮件列表]]。 大多数OpenWrt开发人员监视此电子邮件列表,并可以对您的更改发表评论。 
 +==== 6. 不要使用MIME类型邮件,不要使用超连接方式,不要压缩补丁,不要使用附件方式,只使用纯文本 =====
  
-==== 3. Separate your changes ===== +OpenWrt开发人员需要能够阅读和评论您提交的更改。 对于OpenWrt开发人员而言,使用标准的电子邮件工具“引用”您的更改非常重要,这样他们就可以对代码的特定部分进行注释。
-Separate __logical changes__ into a single patch file.+
  
-For example, if your changes include both bug fixes and enhancements for a single package, separate those changes into two or more patches.+因此,所有补丁都应“内联”提交电子邮件。 警告:如果您选择剪切粘贴,请小心编辑器的自动换行会损坏您的补丁程序。
  
-On the other hand, if you make a single change to numerous files, group those changes into a single patch. Thus a single logical change is contained within a single patch.+不要将补丁附加为MIME附件,或者压缩。许多流行的电子邮件应用程序并不总是将MIME附件作为纯文本发送,使得无法对代码进行注释。
  
-If one patch depends on another patch in order for a change to be complete, that is OK. Simply note "this patch depends on patch X" in your patch description.+例外:如果您的邮件发送者正在处理补丁程序,则有人可能会要求你使用MIME重新发送补丁程序。
  
-If you cannot condense your patch set into a smaller set of patches, then only post say 15 or so at a time and wait for review and integration.+Mozilla雷鸟要求您更改电子邮件默认值以发送纯文本电子邮件。[[http://kb.mozillazine.org/Plain_text_e-mail_%28Thunderbird%29|纯文本电子邮件- Thunderbird]]:!:禁用流文本
  
-==== 4. Style check your changes ===== 
-Check your patch for basic style violations. Failure to do so simply wastes the reviewer's time and will get your patch rejected, probably without even being read. 
  
-==== 5Select email destination ===== +==== 7邮件大小 =====
-Look in the Makefile if a MAINTAINER macro exists. If so, email that person. Unless you have a reason NOT to do so, always CC openwrt-devel <at> lists.openwrt.org. If no maintainer is listed, send your patch to the [[https://lists.openwrt.org/mailman/listinfo/openwrt-devel|​primary OpenWrt developer's mailing list]]. Most OpenWrt developers monitor this email list, and can comment on your changes.+
  
-==== 6No MIME, no links, no compression, no attachments, just plain text ===== +较大的更改不适用于邮件列表和某些维护者。 如果未压缩的补丁程序大小超过300 kB,则最好将补丁程序存储在可访问Internet的服务器上,并提供指向补丁程序的URL (链接) 
-OpenWrt developers need to be able to read and comment on the changes you are submitting. It is important for an OpenWrt developer to be able to "quote" your changes, using standard email tools, so that they may comment on specific portions of your code.+==== 8不要灰心,重新提交 =====
  
-For this reason, all patches should be submitting email "inline". WARNING: Be wary of your editor's word-wrap corrupting your patch, if you choose to cut-n-paste your patch.+提交更改后,请耐心等待。 如果开发人员喜欢你的更改并应用它,它将在源代码管理系统中显示为新修订。
  
-Do not attach the patch as a MIME attachment, compressed or not. Many popular email applications will not always transmit a MIME attachment as plain text, making it impossible to comment on your code.+但是,如果你的更改未出现在源代码管理系统中,则可能有多种原因。 缩小这些原因,纠正错误,然后提交更新的更改是你的工作。
  
-Exception: If your mailer is mangling patches then someone may ask you to re-send them using MIME.+有时,开发人员可能会“丢弃”你的补丁,而有或没有评论。 这就是系统的本质。 如果你的补丁程序被删除,则可能是由于:
  
-Mozilla Thunderbird requires that you change email defaults to send plain text email. +  * 你的补丁不适用于最新的OpenWrt版本。 
-read [[http://kb.mozillazine.org/Plain_text_e-mail_%28Thunderbird%29|Plain text email - Thunderbird]] +  * 你的补丁在openwrt-devel上没有得到充分讨论。 
-:!: disable flowed text+  * 样式问题。 
 +  * 电子邮件格式问题(请重新阅读本节)。 
 +  * 你的更改存在技术问题。 
 +  * 他们收到大量电子邮件,而你的邮件迷失了。 
 +  * 你真烦人。
  
-==== 7. Email size ===== 
-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 ===== +如有疑问,请在openwrt-devel邮件列表上征求意见。
-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.+
  
-However, if your change doesn't appear in the source code management system, there could be any number of reasons. It's YOUR job to narrow down those reasons, correct what was wrong, and submit your updated change. 
  
-Sometimes, developers may "drop" your patch with or without comment. That's the nature of the system. If your patch is dropped, it could be due to: +==== 9在邮件主题中包含PTACH提示 =====
-   * Your patch did not apply cleanly to the latest OpenWrt revision. +
-   * Your patch was not sufficiently discussed on openwrt-devel. +
-   * A style issue. +
-   * An email formatting issue (re-read this section). +
-   * A technical problem with your change. +
-   * They get tons of email, and yours got lost in the shuffle. +
-   * You are being annoying.+
  
-When in doubt, solicit comments on openwrt-devel mailing list.+由于openwrt-devel的电子邮件流量很高,因此通常会在主题行前加上[PATCH]作为前缀。 这样,OpenWrt开发人员可以更轻松地将补丁与其他电子邮件讨论区分开来,并且还将自动进入补丁工作。
  
-==== 9Include PATCH in the subject ===== +==== 10签署工作 =====
-Due to high email traffic to openwrt-devel, it is common convention to prefix your subject line with [PATCH]. This lets OpenWrt developers more easily distinguish patches from other email discussions, and will also make its way to the patchwork automatically.+
  
-==== 10. Sign your work ===== +为了跟踪谁做了什么,我们对正在通过电子邮件发送的补丁程序使用“签署”程序。
-To provide tracking of who did what, we use a "sign-off" procedure on patches that are being emailed around.+
  
-The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify the below:+补丁说明末尾的签名很简单,它证明您写了它,或者有权将它作为开放源代码补丁进行传递。 规则非常简单:如果您可以证明以下内容:
  
 <code> <code>
Line 217: Line 238:
 </code> </code>
  
-then you just add a line saying+然后你只需加上一句话
  
 <code bash> <code bash>
Line 223: Line 244:
 </code> </code>
  
-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 :+如果你是一个包或目标维护者,有时你需要稍微修改你接收到的补丁以便合并它们,因为代码在你的树和提交者中不是完全相同的。如果你严格遵守规则,你应该向提交人请求重新授权,但这完全是浪费时间和精力。规则(B)允许您调整代码,但是更改提交人的代码并使他支持您的bug是非常不礼貌的。为了解决这个问题,建议您在最后一个签名的头和您的头之间添加一行,说明您的更改的性质。虽然没有什么强制性的,这似乎是准备描述与您的邮件和/或名称,所有包围在方括号中,是显而易见的,足以使你清楚,你负责的最后一分钟的变化。例子:
  
 <code bash> <code bash>
Line 233: Line 254:
 </code> </code>
  
-This practice is particularly helpful if you maintain a stable branch and want at the same time to credit the author, track changes, merge the fix, and protect the submitter from complaints. Note that under no circumstances can you change the author's identity (the From header), as it is the one which appears in the changelog.+如果你保持一个稳定的分支,并希望同时信任作者,跟踪更改,合并修复,并保护提交者不受投诉,这种做法尤其有用。请注意,在任何情况下,您都不能更改作者的身份(从报头),因为它是在变更日志中出现的身份。
  
-Special note to back-porters: It seems to be a common and useful practise to insert an indication of the origin of a patch at the top of the commit message (just after the subject line) to facilitate tracking. For instance:+向后移植者的特别注意:在提交消息的顶部(仅在主题行之后)插入补丁来源的指示,以方便跟踪,这似乎是一种常见且有用的做法。 例如:
  
 <code bash> <code bash>
Line 243: Line 264:
 </code> </code>
  
-Whatever the format, this information provides valuable help to people tracking your trees, and to people trying to trouble-shoot bugs in your tree.+无论采用哪种格式,此信息都可以为跟踪您的树的人们以及试图对树中的错误进行故障排除的人们提供宝贵的帮助。
  
-For the more convenient developers, git can automatically add a sign-off:+对于更方便的开发人员,git可以自动添加签名:
  
 <code bash> <code bash>
Line 251: Line 272:
 </code> </code>
  
-==== 11. When to use "Acked-by:" and "Cc:" =====+==== 11. 什么时候使用"Acked-by:""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 he/she was in the patch's delivery path.
  
Line 264: Line 285:
 If a person has had the opportunity to comment on a patch, but has not provided such comments, you may optionally add a "Cc:" tag to the patch. This is the only tag which might be added without an explicit action by the person it names. This tag documents that potentially interested parties have been included in the discussion. If a person has had the opportunity to comment on a patch, but has not provided such comments, you may optionally add a "Cc:" tag to the patch. This is the only tag which might be added without an explicit action by the person it names. This tag documents that potentially interested parties have been included in the discussion.
  
-==== 12. Using "Reported-by:", "Tested-by:" and "Reviewed-by:" =====+==== 12. 使用 "Reported-by:", "Tested-by:" and "Reviewed-by:" =====
 If this patch fixes a problem reported by somebody else, consider adding a Reported-by: tag to credit the reporter for their contribution. Please note that this tag should not be added without the reporter's permission, especially if the problem was not reported in a public forum. That said, if we diligently credit our bug reporters, they will, hopefully, be inspired to help us again in the future. If this patch fixes a problem reported by somebody else, consider adding a Reported-by: tag to credit the reporter for their contribution. Please note that this tag should not be added without the reporter's permission, especially if the problem was not reported in a public forum. That said, if we diligently credit our bug reporters, they will, hopefully, be inspired to help us again in the future.
  
Line 297: Line 318:
 A Reviewed-by tag is a statement of opinion that the patch is an appropriate modification of OpenWrt without any remaining serious technical issues. Any interested reviewer (who has done the work) can offer a Reviewed-by tag for a patch. This tag serves to give credit to reviewers and to inform maintainers of the degree of review which has been done on the patch. Reviewed-by: tags, when supplied by reviewers known to understand the subject area and to perform thorough reviews, will normally increase the likelihood of your patch getting into OpenWrt. A Reviewed-by tag is a statement of opinion that the patch is an appropriate modification of OpenWrt without any remaining serious technical issues. Any interested reviewer (who has done the work) can offer a Reviewed-by tag for a patch. This tag serves to give credit to reviewers and to inform maintainers of the degree of review which has been done on the patch. Reviewed-by: tags, when supplied by reviewers known to understand the subject area and to perform thorough reviews, will normally increase the likelihood of your patch getting into OpenWrt.
  
-==== 13. The canonical patch format =====+==== 13. 规范补丁格式 =====
 The canonical patch subject line is: The canonical patch subject line is:
  
Line 353: Line 374:
 See more details on the proper patch format in the following References. See more details on the proper patch format in the following References.
  
-===== Monitoring patches ===== +===== 补丁监控 ===== 
-Patches sent to the Development mailing list can be followed on Patchwork at ​[[https://patchwork.ozlabs.org/project/openwrt/list/]].+发送到开发邮件列表的补丁可以在Patchwork网站跟踪​[[https://patchwork.ozlabs.org/project/openwrt/list/]].
  
-===== References ======+===== 参考 ======
    * Andrew Morton, "The perfect patch" (tpp).    * Andrew Morton, "The perfect patch" (tpp).
 +      * https://www.ozlabs.org/~akpm/stuff/tpp.txt
       * ​http://userweb.kernel.org/~akpm/stuff/tpp.txt       * ​http://userweb.kernel.org/~akpm/stuff/tpp.txt
    * Jeff Garzik, "Linux kernel patch submission format".    * Jeff Garzik, "Linux kernel patch submission format".
Line 375: Line 397:
       * ​http://halobates.de/on-submitting-patches.pdf       * ​http://halobates.de/on-submitting-patches.pdf
  
-===== Additional information ===== +===== 附加信息 =====
-  * Be aware of line length limit (80). +
-  * Use ''./scripts/checkpatch.pl'' to check your patch - there might be false positives.+
  
 +  * 注意行长度限制(80字符)。
 +  * 使用./scripts/checkpatch.pl脚本检查你的补丁- 可能有误报。
  • Last modified: 2021/10/15 08:32
  • by bobafetthotmail