docs/zh_CN: Add translation zh_CN/maintainer
Subsystems (2)
cover docs/zh_CN: Add translation zh_CN/maintainer
Hi all,
This set of patches aims to add translations zh_CN/maintainer.
Please note that since each patch need to modify their own entry in zh_CN/maintainer/index.rst, patches should be applied in order.
Thanks!
Base on jc/docs-next
Wu XiangCheng (6):
docs/zh_CN: Add translation zh_CN/maintainer/index.rst docs/zh_CN: Add translation zh_CN/maintainer/configure-git.rst docs/zh_CN: Add translation zh_CN/maintainer/rebasing-and-merging.rst docs/zh_CN: Add translation zh_CN/maintainer/pull-requests.rst docs/zh_CN: Add translation
zh_CN/maintainer/maintainer-entry-profile.rst
docs/zh_CN: Add translation zh_CN/maintainer/modifying-patches.rst
Documentation/translations/zh_CN/index.rst | 1 + .../zh_CN/maintainer/configure-git.rst | 62 +++++++ .../translations/zh_CN/maintainer/index.rst | 21 +++ .../maintainer/maintainer-entry-profile.rst | 92 ++++++++++ .../zh_CN/maintainer/modifying-patches.rst | 51 ++++++ .../zh_CN/maintainer/pull-requests.rst | 148 ++++++++++++++++ .../zh_CN/maintainer/rebasing-and-merging.rst | 165 ++++++++++++++++++ 7 files changed, 540 insertions(+) create mode 100644 Documentation/translations/zh_CN/maintainer/configure-git.rst create mode 100644 Documentation/translations/zh_CN/maintainer/index.rst create mode 100644 Documentation/translations/zh_CN/maintainer/maintainer-entry-profile.rst create mode 100644 Documentation/translations/zh_CN/maintainer/modifying-patches.rst create mode 100644 Documentation/translations/zh_CN/maintainer/pull-requests.rst create mode 100644 Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst
base-commit: 441ca977a84dadac6173db7c07c25db110b76c1e
Signature · 1 line
2.20.1
PATCH 1/6 docs/zh_CN: Add translation zh_CN/maintainer/index.rst
Add a new translation
Documentation/translations/zh_CN/maintainer/index.rst
and link it to zh_CN/index.rst
---
Todolist in this file will be changed one-by-one in followed [Patch 5-6/6]
Documentation/translations/zh_CN/index.rst | 1 + .../translations/zh_CN/maintainer/index.rst | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 Documentation/translations/zh_CN/maintainer/index.rst
Documentation/translations/zh_CN/index.rst +1 -0
@@ -21,6 +21,7 @@ dev-tools/index doc-guide/index kernel-hacking/index + maintainer/index filesystems/index arm64/index sound/index
Documentation/translations/zh_CN/maintainer/index.rst new file +19 -0
@@ -0,0 +1,19 @@ +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/maintainer/index.rst + +============== +内核维护者手册 +============== + +本文档本是内核维护者手册的首页。 +本手册还需要大量完善!请自由提出(和编写)本手册的补充内容。 +*译注:指英文原版* + +TODOList: + +- configure-git +- rebasing-and-merging +- pull-requests +- maintainer-entry-profile +- modifying-patches
Signature · 1 line
2.20.1
Re: [PATCH 1/6] docs/zh_CN: Add translation zh_CN/maintainer/index.rst
Quoted 54 lines · Wu XiangCheng <[email protected]> 于2021年4月22日周四 下午8:27写道:
Add a new translation
Documentation/translations/zh_CN/maintainer/index.rst
and link it tozh_CN/index.rstSigned-off-by Wu XiangCheng <[email protected]>---
Todolist in this file will be changed one-by-one in followed [Patch 5-6/6]Documentation/translations/zh_CN/index.rst | 1 + .../translations/zh_CN/maintainer/index.rst | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 Documentation/translations/zh_CN/maintainer/index.rstDocumentation/translations/zh_CN/index.rst +1
-0@@ -21,6 +21,7 @@ dev-tools/index doc-guide/index kernel-hacking/index + maintainer/index filesystems/index arm64/index sound/indexDocumentation/translations/zh_CN/maintainer/index.rst new file +19
-1@@ -0,0 +1,19 @@ +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/maintainer/index.rst + +============== +内核维护者手册 +============== + +本文档本是内核维护者手册的首页。 +本手册还需要大量完善!请自由提出(和编写)本手册的补充内容。 +*译注:指英文原版* + +TODOList: + +- configure-git +- rebasing-and-merging +- pull-requests +- maintainer-entry-profile +- modifying-patches --2.20.1
PATCH 2/6 docs/zh_CN: Add translation zh_CN/maintainer/configure-git.rst
In reply to Wu XiangChengAdd a new translation
Documentation/translations/zh_CN/maintainer/configure-git.rst
and link it to zh_CN/maintainer/index.rst
--- .../zh_CN/maintainer/configure-git.rst | 62 +++++++++++++++++++ .../translations/zh_CN/maintainer/index.rst | 6 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/zh_CN/maintainer/configure-git.rst
Documentation/translations/zh_CN/maintainer/configure-git.rst new file +62 -0
@@ -0,0 +1,62 @@ +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/maintainer/configure-git.rst + +:译者: + + 吴想成 Wu XiangCheng <[email protected]> + +.. _configuregit_zh: + +Git配置 +======= + +本章讲述了维护者级别的git配置。 + +Documentation/maintainer/pull-requests.rst 中使用的标记分支应使用开发人员的 +GPG公钥进行签名。可以通过将 ``-u`` 标志传递给 ``git tag`` 来创建签名标记。 +但是,由于 *通常* 对同一项目使用同一个密钥,因此可以设置:: + + git config user.signingkey "keyname" + +或者手动编辑你的 ``.git/config`` 或 ``~/.gitconfig`` 文件:: + + [user] + name = Jane Developer + email = [email protected] + signingkey = [email protected] + +你可能需要告诉 ``git`` 去使用 ``gpg2``:: + + [gpg] + program = /path/to/gpg2 + +你可能也需要告诉 ``gpg`` 去使用哪个 ``tty`` (添加到你的shell rc文件中):: + + export GPG_TTY=$(tty) + + +创建链接到lore.kernel.org的提交 +------------------------------- + +http://lore.kernel.org 网站是所有涉及或影响内核开发的邮件列表的总存档。在这里 +存储补丁存档是推荐的做法,当维护人员将补丁应用到子系统树时,最好提供一个指向 +lore存档链接的标签,以便浏览提交历史的人可以找到某个更改背后的相关讨论和基本 +原理。链接标签如下所示: + + Link: https://lore.kernel.org/r/<message-id> + +通过在git中添加以下钩子,可以将此配置为在发布 ``git am`` 时自动执行: + +.. code-block:: none + + $ git config am.messageid true + $ cat >.git/hooks/applypatch-msg <<'EOF' + #!/bin/sh + . git-sh-setup + perl -pi -e 's|^Message-Id:\s*<?([^>]+)>?$|Link: https://lore.kernel.org/r/$1|g;' "$1" + test -x "$GIT_DIR/hooks/commit-msg" && + exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} + : + EOF + $ chmod a+x .git/hooks/applypatch-msg
Documentation/translations/zh_CN/maintainer/index.rst +5 -1
@@ -10,9 +10,13 @@ 本手册还需要大量完善!请自由提出(和编写)本手册的补充内容。 *译注:指英文原版* +.. toctree:: + :maxdepth: 2 + + configure-git + TODOList: -- configure-git - rebasing-and-merging - pull-requests - maintainer-entry-profile
Signature · 1 line
2.20.1
Re: [PATCH 2/6] docs/zh_CN: Add translation zh_CN/maintainer/configure-git.rst
Quoted 102 lines · Wu XiangCheng <[email protected]> 于2021年4月22日周四 下午8:27写道:
Add a new translation
Documentation/translations/zh_CN/maintainer/configure-git.rst
and link it tozh_CN/maintainer/index.rstSigned-off-by Wu XiangCheng <[email protected]>--- .../zh_CN/maintainer/configure-git.rst | 62 +++++++++++++++++++ .../translations/zh_CN/maintainer/index.rst | 6 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/zh_CN/maintainer/configure-git.rstDocumentation/translations/zh_CN/maintainer/configure-git.rst new file +62
-0@@ -0,0 +1,62 @@ +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/maintainer/configure-git.rst + +:译者: + + 吴想成 Wu XiangCheng <[email protected]> + +.. _configuregit_zh: + +Git配置 +======= + +本章讲述了维护者级别的git配置。 + +Documentation/maintainer/pull-requests.rst 中使用的标记分支应使用开发人员的 +GPG公钥进行签名。可以通过将 ``-u`` 标志传递给 ``git tag`` 来创建签名标记。 +但是,由于 *通常* 对同一项目使用同一个密钥,因此可以设置:: + + git config user.signingkey "keyname" + +或者手动编辑你的 ``.git/config`` 或 ``~/.gitconfig`` 文件:: + + [user] + name = Jane Developer + email = [email protected] + signingkey = [email protected] + +你可能需要告诉 ``git`` 去使用 ``gpg2``:: + + [gpg] + program = /path/to/gpg2 + +你可能也需要告诉 ``gpg`` 去使用哪个 ``tty`` (添加到你的shell rc文件中):: + + export GPG_TTY=$(tty) + + +创建链接到lore.kernel.org的提交 +------------------------------- + +http://lore.kernel.org 网站是所有涉及或影响内核开发的邮件列表的总存档。在这里 +存储补丁存档是推荐的做法,当维护人员将补丁应用到子系统树时,最好提供一个指向 +lore存档链接的标签,以便浏览提交历史的人可以找到某个更改背后的相关讨论和基本 +原理。链接标签如下所示: + + Link: https://lore.kernel.org/r/<message-id> + +通过在git中添加以下钩子,可以将此配置为在发布 ``git am`` 时自动执行: + +.. code-block:: none + + $ git config am.messageid true + $ cat >.git/hooks/applypatch-msg <<'EOF' + #!/bin/sh + . git-sh-setup + perl -pi -e 's|^Message-Id:\s*<?([^>]+)>?$|Link: https://lore.kernel.org/r/$1|g;' "$1" + test -x "$GIT_DIR/hooks/commit-msg" && + exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} + : + EOF + $ chmod a+x .git/hooks/applypatch-msgDocumentation/translations/zh_CN/maintainer/index.rst +5
-2@@ -10,9 +10,13 @@ 本手册还需要大量完善!请自由提出(和编写)本手册的补充内容。 *译注:指英文原版* +.. toctree:: + :maxdepth: 2 + + configure-git + TODOList: -- configure-git - rebasing-and-merging - pull-requests - maintainer-entry-profile --2.20.1
PATCH 3/6 docs/zh_CN: Add translation zh_CN/maintainer/rebasing-and-merging.rst
In reply to Wu XiangChengAdd a new translation
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst
and link it to zh_CN/maintainer/index.rst
--- .../translations/zh_CN/maintainer/index.rst | 2 +- .../zh_CN/maintainer/rebasing-and-merging.rst | 165 ++++++++++++++++++ 2 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst
Documentation/translations/zh_CN/maintainer/index.rst +1 -1
@@ -14,10 +14,10 @@ :maxdepth: 2 configure-git + rebasing-and-merging TODOList: -- rebasing-and-merging - pull-requests - maintainer-entry-profile - modifying-patches
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +165 -0
165 lines not on this page · raw message
Signature · 1 line
2.20.1
Re: [PATCH 3/6] docs/zh_CN: Add translation zh_CN/maintainer/rebasing-and-merging.rst
Quoted 46 lines · Wu XiangCheng <[email protected]> 于2021年4月22日周四 下午8:28写道:
Add a new translation
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst
and link it tozh_CN/maintainer/index.rstSigned-off-by Wu XiangCheng <[email protected]>--- .../translations/zh_CN/maintainer/index.rst | 2 +- .../zh_CN/maintainer/rebasing-and-merging.rst | 165 ++++++++++++++++++ 2 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rstDocumentation/translations/zh_CN/maintainer/index.rst +1
-1@@ -14,10 +14,10 @@ :maxdepth: 2 configure-git + rebasing-and-merging TODOList: -- rebasing-and-merging - pull-requests - maintainer-entry-profile - modifying-patchesDocumentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +12
-0@@ -0,0 +1,165 @@ +.. SPDX-License-Identifier: GPL-2.0 + +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/maintainer/rebasing-and-merging.rst + +:译者: + + 吴想成 Wu XiangCheng <[email protected]> + +========== +变基与合并
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 22
Quoted 10 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +10
-0+========== + +一般来说,维护子系统需要熟悉Git源代码管理系统。Git是一个功能强大的工具,有 +很多功能;就像这类工具常出现的情况一样,使用这些功能的方法有对有错。本文档 +特别介绍了变基与合并的用法。维护者经常在错误使用这些工具时遇到麻烦,但避免 +问题实际上并不那么困难。 + +总的来说,需要注意的一点是:与许多其他项目不同,内核社区并不害怕在其开发历史 +中看到合并提交。事实上,考虑到该项目的规模,避免合并几乎是不可能的。维护者会 +在希望避免合并时遇到一些问题,而过于频繁的合并也会带来另一些问题。
维护者会希望在合并时避免遇到一些问题?
Quoted 7 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +7
-0+ +变基 +==== + +“变基(Rebase)”是更改存储库中一系列提交的历史记录的过程。有两种不同型的操作 +都被称为变基,因为这两种操作都使用 ``git rebase`` 命令,但它们之间存在显著 +差异:
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 39
Quoted 10 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +10
-0+ + - 更改生成一系列修补程序的父(开始)提交。例如,变基操作可以将基于上一 + 内核版本的一个补丁集重建到当前版本上。在下面的讨论中,我们将此操作称为 + “变根”。 + + - 通过修复(或删除)损坏的提交、添加补丁、添加标记以更改一系列补丁的历史, + 来提交变更日志或更改已应用提交的顺序。在下文中,这种类型的操作称为“历史 + 修改” + +术语“变基”将用于指代上述两种操作。如果使用得当,变基可以产生更清晰、更清晰的
更清晰、更整洁?or 更清晰、更干净?:)
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 44
Quoted 5 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +5
-0+开发历史;如果使用不当,它可能会模糊历史并引入错误。 + +以下一些经验法则可以帮助开发者避免最糟糕的变基风险: + + - 已经发布到你私人系统之外世界的历史通常不应改变。其他人可能会拉取你的树
改变 -> 更改?
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 50
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+ 的副本,然后基于它进行工作;修改你的树会给他们带来麻烦。如果工作需要变基, + 这通常是表明它还没有准备好提交到公共存储库的信号。 + + 但是,总有例外。有些树(linux-next是一个典型的例子)由于它们的需要经常 + 变基,开发人员知道不要基于它们来工作。开发人员有时会暴露一个不稳定的分支, + 供其他人或自动测试服务进行测试。如果您确实以这种方式暴露了一个可能不稳定
maybe 暴露 -> 曝光?公开?
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 53
Quoted 3 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +3
-0+ 的分支,请确保潜在使用者知道不要基于它来工作。 + + - 不要在包含由他人创建的历史的分支上变基。如果你从别的开发者的仓库拉取了变更,
历史的分支 delete “的”
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 55
Quoted 2 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +2
-0+ 那你现在就成了他们历史记录的保管人。你不应该改变它,除了少数例外情况。例如 + 树中损坏的提交必须显式恢复,而不是通过修改历史而消失。
This sentence is not friendly to newbabys。
我觉得大意应该是这样:
历史上有人提交的补丁今天发现问题了,必须通过反打补丁恢复,而不应该撤掉补丁?
你再求证下,然后组织一下语言。
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 61
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+ + - 没有合理理由,不要对树变根。仅为了切换到更新的基或避免与上游储存库的合并 + 通常不是合理理由。 + + - 如果你必须对储存库进行变根,请不要随机选取一个提交作为新基。在发布节点之间 + 内核通常处于一个相对不稳定的状态;基于其中某点进行开发会增加遇到奇怪错误的
基于……
I think this sentence translates wrong and reads strangely。
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 67
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+ 计划。当一系列补丁必须移动到新基时,请选择移动到一个稳定节点(例如-rc版本 + 节点)。 + + - 请知悉对补丁系列进行变根(或做明显的历史修改)会改变它们的开发环境,且很 + 可能使做过的大部分测试失效。一般来说,变基后的补丁系列应当像新代码一样对 + 待,并从头开始重新测试。
从头开始 = 重新 :)
Quoted 56 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +56
-0+ +合并窗口麻烦的一个常见原因是,Linus收到了一个明显在拉取请求发送之前不久才变根 +(通常是变根到随机的提交上)的补丁系列。这样一个系列被充分测试的可能性相对较 +低,拉取请求被接受的几率也同样较低。 + +相反,如果变基仅限于私有树、提交基于一个通用的起点、且经过充分测试,则引起 +麻烦的可能性就很低。 + +合并 +==== + +内核开发过程中,合并是一个很常见的操作;5.1版本开发周期中有超过1126个合并 +——差不多占了整体的9%。内核开发工作积累在100多个不同的子系统树中,每个 +子系统树都可能包含多个主题分支;每个分支通常独立于其他分支进行开发。因此 +在任何给定分支进入上游储存库之前,至少需要一次合并。 + +许多项目要求拉取请求中的分支基于当前主干,这样历史记录中就不会出现合并提交。 +内核并不是这样;任何为了避免合并而重新对分支变基都很可能导致麻烦。 + +子系统维护人员发现他们必须进行两种类型的合并:从较低层级的子系统树和从其他 +子系统树(同级树或主线)进行合并。这两种情况下要遵循的最佳实践是不同的。 + +合并较低层级树 +-------------- + +较大的子系统往往有多个级别的维护人员,较低级别的维护人员向较高级别发送拉取 +请求。合并这样的请求执行几乎肯定会生成一个合并提交;这也是应该的。实际上, +子系统维护人员可能希望在极少数快进合并情况下使用 ``-–no-ff`` 标志来强制添加 +合并提交,以便记录合并的原因。 **任何** 类型的合并的变更日志必须说明 +*为什么* 合并。对于较低级别的树,“为什么”通常是对该取所带来的变化的总结。 + +各级维护人员都应在他们的拉取请求上使用经签名的标签,上游维护人员应在拉取分支 +时验证标签。不这样做会威胁整个开发过程的安全。 + +根据上面列出的规则,一旦您将其他人的历史记录合并到树中,您就不得对该分支进行 +变基,即使您能够这样做。 + +合并同级树或上游树 +------------------ + +虽然来自下游的合并是常见且不起眼的,但当需要将一个分支推向上游时,其中来自 +其他树的合并往往是一个危险信号。这种合并需要仔细考虑并加以充分证明,否则后续 +的拉取请求很可能会被拒绝。 + +想要将主分支合并到存储库中是很自然的;这种类型的合并通常被称为“反向合并” +。反向合并有助于确保与并行的开发没有冲突,并且通常会给人一种温暖、舒服的 +感觉,即处于最新。但这种诱惑几乎总是应该避免的。 + +为什么呢?反向合并将搅乱你自己分支的开发历史。它们会大大增加你遇到来自社区 +其他地方的错误的机会,且使你很难确保你所管理的工作稳定并准备好合入上游。 +频繁的合并还可以掩盖树中开发过程中的问题;它们会隐藏与其他树的交互,而这些 +交互不应该(经常)发生在管理良好的分支中。 + +也就是说,偶尔需要进行反向合并;当这种情况发生时,一定要在提交信息中记录 +*为什么* 。同样,在一个众所周知的稳定点进行合并,而不是随机提交。即使这样, +你也不应该反向合并一棵比你的直接上游树更高层级的树;如果确实需要更高级别的
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 133
Quoted 10 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +10
-0+反向合并,应首先在上游树进行。 + +导致合并相关问题最常见的原因之一是:在发送拉取请求之前维护者合并上游以解决 +合并冲突。同样,这种诱惑很容易理解,但绝对应该避免。对于最终拉取请求来说 +尤其如此:Linus坚信他更愿意看到合并冲突,而不是不必要的反向合并。看到冲突 +可以让他了解潜在的问题所在。他做过很多合并(在5.1版本开发周期中是382次), +而且在解决冲突方面也很在行——通常比参与的开发人员要强。 + +那么,当他们的子系统分支和主线之间发生冲突时,维护人员应该怎么做呢?最重要 +的一步是在拉取请求中警告Linus会发生冲突;如果啥都没说则表明您的分支可以正常
警告 -> 提示? (It's a little impolite to use a warning in a Chinese)
Quoted 33 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +32
-1+合入。对于特别困难的冲突,创建并推送一个 *独立* 分支来展示你将如何解决问题。 +在拉取请求中提到该分支,但是请求本身应该针对未合并的分支。 + +即使不存在已知冲突,在发送拉取请求之前进行合并测试也是个好主意。它可能会提醒 +您一些在linux-next树中没有发现的问题,并帮助您准确地理解您正在要求上游做什么。 + +合并上游树或另一个子系统树的另一个原因是解决依赖关系。这些依赖性问题有时确实 +会发生,而且有时与另一棵树交叉合并是解决这些问题的最佳方法;同样,在这种情况 +下,合并提交应该解释为什么要进行合并。花点时间把它做好;会有人阅读这些变更 +日志。 + +然而依赖性问题通常表明需要改变方法。合并另一个子系统树以解决依赖性风险会带来 +其他缺陷,几乎永远不应这样做。如果该子系统树无法被合到上游,那么它的任何问题 +也都会阻碍你的树合并。更可取的选择包括与维护人员达成一致意见,在其中一个树中 +同时进行两组更改;或者创建一个主题分支专门处理可以合并到两个树中的先决条件提交。 +如果依赖关系与主要的基础结构更改相关,正确的解决方案可能是将依赖提交保留一个 +开发周期,以便这些更改有时间在主线上稳定。 + +最后 +==== + +在开发周期的开头合并主线是比较常见的,可以获取树中其他地方的更改和修复。同样, +这样的合并应该选择一个众所周知的发布点,而不是一些随机点。如果在合并窗口期间 +上游分支已完全清空到主线中,则可以使用以下命令向前拉取它:: + + git merge v5.2-rc1^0 + +“^0”使Git执行快进合并(在这种情况下这应该可以),从而避免多余的虚假合并提交。 + +上面列出的就是指导方针了。总是会有一些情况需要不同的解决方案,这些指导原则 +不应阻止开发人员在需要时做正确的事情。但是,我们应该时刻考虑是否真的出现了 +这样的需求,并准备好解释为什么需要做一些不寻常的事情。 --
Quoted 2 lines
2.20.1
I'll review the other patches later in the evening.
Thinks,
yanteng
Re: [PATCH 3/6] docs/zh_CN: Add translation zh_CN/maintainer/rebasing-and-merging.rst
Quoted 51 lines · teng sterling
Quoted 50 lines · Wu XiangCheng <[email protected]> 于2021年4月22日周四 下午8:28写道:
Add a new translation
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst
and link it tozh_CN/maintainer/index.rstSigned-off-by Wu XiangCheng <[email protected]>--- .../translations/zh_CN/maintainer/index.rst | 2 +- .../zh_CN/maintainer/rebasing-and-merging.rst | 165 ++++++++++++++++++ 2 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rstDocumentation/translations/zh_CN/maintainer/index.rst +1
-1@@ -14,10 +14,10 @@ :maxdepth: 2 configure-git + rebasing-and-merging TODOList: -- rebasing-and-merging - pull-requests - maintainer-entry-profile - modifying-patchesDocumentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +16
-0@@ -0,0 +1,165 @@ +.. SPDX-License-Identifier: GPL-2.0 + +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/maintainer/rebasing-and-merging.rst + +:译者: + + 吴想成 Wu XiangCheng <[email protected]> + +========== +变基与合并 +========== + +一般来说,维护子系统需要熟悉Git源代码管理系统。Git是一个功能强大的工具,有 +很多功能;就像这类工具常出现的情况一样,使用这些功能的方法有对有错。本文档
Quoted 8 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 22
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+特别介绍了变基与合并的用法。维护者经常在错误使用这些工具时遇到麻烦,但避免 +问题实际上并不那么困难。 + +总的来说,需要注意的一点是:与许多其他项目不同,内核社区并不害怕在其开发历史 +中看到合并提交。事实上,考虑到该项目的规模,避免合并几乎是不可能的。维护者会 +在希望避免合并时遇到一些问题,而过于频繁的合并也会带来另一些问题。维护者会希望在合并时避免遇到一些问题?
You seems misunderstood. Here means,
Some maintainers want to always use fast-forward merge, thus there will be no merge commit in the tree. Then, main tree will very clean and beautifull, no extra branch. When you use 'git log --graph', only appear one line.
But when you avoid merge commit, may cause other problems.
Quoted 11 lines
Quoted 11 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +11
-0+ +变基 +==== + +“变基(Rebase)”是更改存储库中一系列提交的历史记录的过程。有两种不同型的操作 +都被称为变基,因为这两种操作都使用 ``git rebase`` 命令,但它们之间存在显著 +差异: + + - 更改生成一系列修补程序的父(开始)提交。例如,变基操作可以将基于上一 + 内核版本的一个补丁集重建到当前版本上。在下面的讨论中,我们将此操作称为 + “变根”。
Quoted 8 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 39
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+ + - 通过修复(或删除)损坏的提交、添加补丁、添加标记以更改一系列补丁的历史, + 来提交变更日志或更改已应用提交的顺序。在下文中,这种类型的操作称为“历史 + 修改” + +术语“变基”将用于指代上述两种操作。如果使用得当,变基可以产生更清晰、更清晰的更清晰、更整洁?or 更清晰、更干净?:)
OK!
use 更清晰、更整洁
Quoted 7 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 44
Quoted 5 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +5
-0+开发历史;如果使用不当,它可能会模糊历史并引入错误。 + +以下一些经验法则可以帮助开发者避免最糟糕的变基风险: + + - 已经发布到你私人系统之外世界的历史通常不应改变。其他人可能会拉取你的树改变 -> 更改?
OK.
Quoted 8 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 50
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+ 的副本,然后基于它进行工作;修改你的树会给他们带来麻烦。如果工作需要变基, + 这通常是表明它还没有准备好提交到公共存储库的信号。 + + 但是,总有例外。有些树(linux-next是一个典型的例子)由于它们的需要经常 + 变基,开发人员知道不要基于它们来工作。开发人员有时会暴露一个不稳定的分支, + 供其他人或自动测试服务进行测试。如果您确实以这种方式暴露了一个可能不稳定maybe 暴露 -> 曝光?公开?
use 公开
Quoted 5 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 53
Quoted 3 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +3
-0+ 的分支,请确保潜在使用者知道不要基于它来工作。 + + - 不要在包含由他人创建的历史的分支上变基。如果你从别的开发者的仓库拉取了变更,历史的分支 delete “的”
不要在 | 包含由他人创建的历史 | 的分支上变基
Quoted 7 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 55
Quoted 2 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +2
-0+ 那你现在就成了他们历史记录的保管人。你不应该改变它,除了少数例外情况。例如 + 树中损坏的提交必须显式恢复,而不是通过修改历史而消失。This sentence is not friendly to newbabys。
我觉得大意应该是这样:
历史上有人提交的补丁今天发现问题了,必须通过反打补丁恢复,而不应该撤掉补丁?
你再求证下,然后组织一下语言。
Yes, you are right!
use
树中有问题的提交必须显式恢复(即通过另一个补丁修复),而不是通过修改历史而消失。
Quoted 9 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 61
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+ + - 没有合理理由,不要对树变根。仅为了切换到更新的基或避免与上游储存库的合并 + 通常不是合理理由。 + + - 如果你必须对储存库进行变根,请不要随机选取一个提交作为新基。在发布节点之间 + 内核通常处于一个相对不稳定的状态;基于其中某点进行开发会增加遇到奇怪错误的基于……
I think this sentence translates wrong and reads strangely。
use 基于其中某点进行开发会增加遇到意外错的几率。
计划 should be 机会
Quoted 8 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 67
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+ 计划。当一系列补丁必须移动到新基时,请选择移动到一个稳定节点(例如-rc版本 + 节点)。 + + - 请知悉对补丁系列进行变根(或做明显的历史修改)会改变它们的开发环境,且很 + 可能使做过的大部分测试失效。一般来说,变基后的补丁系列应当像新代码一样对 + 待,并从头开始重新测试。从头开始 = 重新 :)
OK, remove it.
Quoted 60 lines
Quoted 60 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +60
-0+ +合并窗口麻烦的一个常见原因是,Linus收到了一个明显在拉取请求发送之前不久才变根 +(通常是变根到随机的提交上)的补丁系列。这样一个系列被充分测试的可能性相对较 +低,拉取请求被接受的几率也同样较低。 + +相反,如果变基仅限于私有树、提交基于一个通用的起点、且经过充分测试,则引起 +麻烦的可能性就很低。 + +合并 +==== + +内核开发过程中,合并是一个很常见的操作;5.1版本开发周期中有超过1126个合并 +——差不多占了整体的9%。内核开发工作积累在100多个不同的子系统树中,每个 +子系统树都可能包含多个主题分支;每个分支通常独立于其他分支进行开发。因此 +在任何给定分支进入上游储存库之前,至少需要一次合并。 + +许多项目要求拉取请求中的分支基于当前主干,这样历史记录中就不会出现合并提交。 +内核并不是这样;任何为了避免合并而重新对分支变基都很可能导致麻烦。 + +子系统维护人员发现他们必须进行两种类型的合并:从较低层级的子系统树和从其他 +子系统树(同级树或主线)进行合并。这两种情况下要遵循的最佳实践是不同的。 + +合并较低层级树 +-------------- + +较大的子系统往往有多个级别的维护人员,较低级别的维护人员向较高级别发送拉取 +请求。合并这样的请求执行几乎肯定会生成一个合并提交;这也是应该的。实际上, +子系统维护人员可能希望在极少数快进合并情况下使用 ``-–no-ff`` 标志来强制添加 +合并提交,以便记录合并的原因。 **任何** 类型的合并的变更日志必须说明 +*为什么* 合并。对于较低级别的树,“为什么”通常是对该取所带来的变化的总结。 + +各级维护人员都应在他们的拉取请求上使用经签名的标签,上游维护人员应在拉取分支 +时验证标签。不这样做会威胁整个开发过程的安全。 + +根据上面列出的规则,一旦您将其他人的历史记录合并到树中,您就不得对该分支进行 +变基,即使您能够这样做。 + +合并同级树或上游树 +------------------ + +虽然来自下游的合并是常见且不起眼的,但当需要将一个分支推向上游时,其中来自 +其他树的合并往往是一个危险信号。这种合并需要仔细考虑并加以充分证明,否则后续 +的拉取请求很可能会被拒绝。 + +想要将主分支合并到存储库中是很自然的;这种类型的合并通常被称为“反向合并” +。反向合并有助于确保与并行的开发没有冲突,并且通常会给人一种温暖、舒服的 +感觉,即处于最新。但这种诱惑几乎总是应该避免的。 + +为什么呢?反向合并将搅乱你自己分支的开发历史。它们会大大增加你遇到来自社区 +其他地方的错误的机会,且使你很难确保你所管理的工作稳定并准备好合入上游。 +频繁的合并还可以掩盖树中开发过程中的问题;它们会隐藏与其他树的交互,而这些 +交互不应该(经常)发生在管理良好的分支中。 + +也就是说,偶尔需要进行反向合并;当这种情况发生时,一定要在提交信息中记录 +*为什么* 。同样,在一个众所周知的稳定点进行合并,而不是随机提交。即使这样, +你也不应该反向合并一棵比你的直接上游树更高层级的树;如果确实需要更高级别的 +反向合并,应首先在上游树进行。 + +导致合并相关问题最常见的原因之一是:在发送拉取请求之前维护者合并上游以解决 +合并冲突。同样,这种诱惑很容易理解,但绝对应该避免。对于最终拉取请求来说
Quoted 8 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 133
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+尤其如此:Linus坚信他更愿意看到合并冲突,而不是不必要的反向合并。看到冲突 +可以让他了解潜在的问题所在。他做过很多合并(在5.1版本开发周期中是382次), +而且在解决冲突方面也很在行——通常比参与的开发人员要强。 + +那么,当他们的子系统分支和主线之间发生冲突时,维护人员应该怎么做呢?最重要 +的一步是在拉取请求中警告Linus会发生冲突;如果啥都没说则表明您的分支可以正常警告 -> 提示? (It's a little impolite to use a warning in a Chinese)
OK.
Quoted 38 lines
Quoted 33 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +32
-1+合入。对于特别困难的冲突,创建并推送一个 *独立* 分支来展示你将如何解决问题。 +在拉取请求中提到该分支,但是请求本身应该针对未合并的分支。 + +即使不存在已知冲突,在发送拉取请求之前进行合并测试也是个好主意。它可能会提醒 +您一些在linux-next树中没有发现的问题,并帮助您准确地理解您正在要求上游做什么。 + +合并上游树或另一个子系统树的另一个原因是解决依赖关系。这些依赖性问题有时确实 +会发生,而且有时与另一棵树交叉合并是解决这些问题的最佳方法;同样,在这种情况 +下,合并提交应该解释为什么要进行合并。花点时间把它做好;会有人阅读这些变更 +日志。 + +然而依赖性问题通常表明需要改变方法。合并另一个子系统树以解决依赖性风险会带来 +其他缺陷,几乎永远不应这样做。如果该子系统树无法被合到上游,那么它的任何问题 +也都会阻碍你的树合并。更可取的选择包括与维护人员达成一致意见,在其中一个树中 +同时进行两组更改;或者创建一个主题分支专门处理可以合并到两个树中的先决条件提交。 +如果依赖关系与主要的基础结构更改相关,正确的解决方案可能是将依赖提交保留一个 +开发周期,以便这些更改有时间在主线上稳定。 + +最后 +==== + +在开发周期的开头合并主线是比较常见的,可以获取树中其他地方的更改和修复。同样, +这样的合并应该选择一个众所周知的发布点,而不是一些随机点。如果在合并窗口期间 +上游分支已完全清空到主线中,则可以使用以下命令向前拉取它:: + + git merge v5.2-rc1^0 + +“^0”使Git执行快进合并(在这种情况下这应该可以),从而避免多余的虚假合并提交。 + +上面列出的就是指导方针了。总是会有一些情况需要不同的解决方案,这些指导原则 +不应阻止开发人员在需要时做正确的事情。但是,我们应该时刻考虑是否真的出现了 +这样的需求,并准备好解释为什么需要做一些不寻常的事情。 --Quoted 2 lines
2.20.1
I'll review the other patches later in the evening.
Quoted 3 lines
Thinks,
yanteng
Thanks for your review!
Do be too late a night, hair is important ;)
Wu X.C.
teng sterling
Reviewed-by Yanteng SiRe: [PATCH 3/6] docs/zh_CN: Add translation zh_CN/maintainer/rebasing-and-merging.rst
Quoted 277 lines · Wu X.C. <[email protected]> 于2021年4月23日周五 下午1:11写道:
Quoted 51 lines · teng sterling
Quoted 50 lines · Wu XiangCheng <[email protected]> 于2021年4月22日周四 下午8:28写道:
Add a new translation
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst
and link it tozh_CN/maintainer/index.rstSigned-off-by Wu XiangCheng <[email protected]>--- .../translations/zh_CN/maintainer/index.rst | 2 +- .../zh_CN/maintainer/rebasing-and-merging.rst | 165 ++++++++++++++++++ 2 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rstDocumentation/translations/zh_CN/maintainer/index.rst +1
-1@@ -14,10 +14,10 @@ :maxdepth: 2 configure-git + rebasing-and-merging TODOList: -- rebasing-and-merging - pull-requests - maintainer-entry-profile - modifying-patchesDocumentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +16
-0@@ -0,0 +1,165 @@ +.. SPDX-License-Identifier: GPL-2.0 + +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/maintainer/rebasing-and-merging.rst + +:译者: + + 吴想成 Wu XiangCheng <[email protected]> + +========== +变基与合并 +========== + +一般来说,维护子系统需要熟悉Git源代码管理系统。Git是一个功能强大的工具,有 +很多功能;就像这类工具常出现的情况一样,使用这些功能的方法有对有错。本文档Quoted 8 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 22
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+特别介绍了变基与合并的用法。维护者经常在错误使用这些工具时遇到麻烦,但避免 +问题实际上并不那么困难。 + +总的来说,需要注意的一点是:与许多其他项目不同,内核社区并不害怕在其开发历史 +中看到合并提交。事实上,考虑到该项目的规模,避免合并几乎是不可能的。维护者会 +在希望避免合并时遇到一些问题,而过于频繁的合并也会带来另一些问题。维护者会希望在合并时避免遇到一些问题?
You seems misunderstood. Here means,
Some maintainers want to always use fast-forward merge, thus there will be no merge commit in the tree. Then, main tree will very clean and beautifull, no extra branch. When you use 'git log --graph', only appear one line.
But when you avoid merge commit, may cause other problems.
Quoted 11 lines
Quoted 11 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +11
-0+ +变基 +==== + +“变基(Rebase)”是更改存储库中一系列提交的历史记录的过程。有两种不同型的操作 +都被称为变基,因为这两种操作都使用 ``git rebase`` 命令,但它们之间存在显著 +差异: + + - 更改生成一系列修补程序的父(开始)提交。例如,变基操作可以将基于上一 + 内核版本的一个补丁集重建到当前版本上。在下面的讨论中,我们将此操作称为 + “变根”。Quoted 8 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 39
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+ + - 通过修复(或删除)损坏的提交、添加补丁、添加标记以更改一系列补丁的历史, + 来提交变更日志或更改已应用提交的顺序。在下文中,这种类型的操作称为“历史 + 修改” + +术语“变基”将用于指代上述两种操作。如果使用得当,变基可以产生更清晰、更清晰的更清晰、更整洁?or 更清晰、更干净?:)
OK!
use 更清晰、更整洁Quoted 7 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 44
Quoted 5 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +5
-0+开发历史;如果使用不当,它可能会模糊历史并引入错误。 + +以下一些经验法则可以帮助开发者避免最糟糕的变基风险: + + - 已经发布到你私人系统之外世界的历史通常不应改变。其他人可能会拉取你的树改变 -> 更改?
OK.
Quoted 8 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 50
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+ 的副本,然后基于它进行工作;修改你的树会给他们带来麻烦。如果工作需要变基, + 这通常是表明它还没有准备好提交到公共存储库的信号。 + + 但是,总有例外。有些树(linux-next是一个典型的例子)由于它们的需要经常 + 变基,开发人员知道不要基于它们来工作。开发人员有时会暴露一个不稳定的分支, + 供其他人或自动测试服务进行测试。如果您确实以这种方式暴露了一个可能不稳定maybe 暴露 -> 曝光?公开?
use 公开
Quoted 5 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 53
Quoted 3 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +3
-0+ 的分支,请确保潜在使用者知道不要基于它来工作。 + + - 不要在包含由他人创建的历史的分支上变基。如果你从别的开发者的仓库拉取了变更,历史的分支 delete “的”
不要在 | 包含由他人创建的历史 | 的分支上变基
Quoted 7 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 55
Quoted 2 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +2
-0+ 那你现在就成了他们历史记录的保管人。你不应该改变它,除了少数例外情况。例如 + 树中损坏的提交必须显式恢复,而不是通过修改历史而消失。This sentence is not friendly to newbabys。
我觉得大意应该是这样:
历史上有人提交的补丁今天发现问题了,必须通过反打补丁恢复,而不应该撤掉补丁?
你再求证下,然后组织一下语言。Yes, you are right!
use
树中有问题的提交必须显式恢复(即通过另一个补丁修复),而不是通过修改历史而消失。Quoted 9 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 61
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+ + - 没有合理理由,不要对树变根。仅为了切换到更新的基或避免与上游储存库的合并 + 通常不是合理理由。 + + - 如果你必须对储存库进行变根,请不要随机选取一个提交作为新基。在发布节点之间 + 内核通常处于一个相对不稳定的状态;基于其中某点进行开发会增加遇到奇怪错误的基于……
I think this sentence translates wrong and reads strangely。use 基于其中某点进行开发会增加遇到意外错的几率。
计划 should be 机会
Quoted 8 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 67
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+ 计划。当一系列补丁必须移动到新基时,请选择移动到一个稳定节点(例如-rc版本 + 节点)。 + + - 请知悉对补丁系列进行变根(或做明显的历史修改)会改变它们的开发环境,且很 + 可能使做过的大部分测试失效。一般来说,变基后的补丁系列应当像新代码一样对 + 待,并从头开始重新测试。从头开始 = 重新 :)
OK, remove it.
Quoted 60 lines
Quoted 60 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +60
-0+ +合并窗口麻烦的一个常见原因是,Linus收到了一个明显在拉取请求发送之前不久才变根 +(通常是变根到随机的提交上)的补丁系列。这样一个系列被充分测试的可能性相对较 +低,拉取请求被接受的几率也同样较低。 + +相反,如果变基仅限于私有树、提交基于一个通用的起点、且经过充分测试,则引起 +麻烦的可能性就很低。 + +合并 +==== + +内核开发过程中,合并是一个很常见的操作;5.1版本开发周期中有超过1126个合并 +——差不多占了整体的9%。内核开发工作积累在100多个不同的子系统树中,每个 +子系统树都可能包含多个主题分支;每个分支通常独立于其他分支进行开发。因此 +在任何给定分支进入上游储存库之前,至少需要一次合并。 + +许多项目要求拉取请求中的分支基于当前主干,这样历史记录中就不会出现合并提交。 +内核并不是这样;任何为了避免合并而重新对分支变基都很可能导致麻烦。 + +子系统维护人员发现他们必须进行两种类型的合并:从较低层级的子系统树和从其他 +子系统树(同级树或主线)进行合并。这两种情况下要遵循的最佳实践是不同的。 + +合并较低层级树 +-------------- + +较大的子系统往往有多个级别的维护人员,较低级别的维护人员向较高级别发送拉取 +请求。合并这样的请求执行几乎肯定会生成一个合并提交;这也是应该的。实际上, +子系统维护人员可能希望在极少数快进合并情况下使用 ``-–no-ff`` 标志来强制添加 +合并提交,以便记录合并的原因。 **任何** 类型的合并的变更日志必须说明 +*为什么* 合并。对于较低级别的树,“为什么”通常是对该取所带来的变化的总结。 + +各级维护人员都应在他们的拉取请求上使用经签名的标签,上游维护人员应在拉取分支 +时验证标签。不这样做会威胁整个开发过程的安全。 + +根据上面列出的规则,一旦您将其他人的历史记录合并到树中,您就不得对该分支进行 +变基,即使您能够这样做。 + +合并同级树或上游树 +------------------ + +虽然来自下游的合并是常见且不起眼的,但当需要将一个分支推向上游时,其中来自 +其他树的合并往往是一个危险信号。这种合并需要仔细考虑并加以充分证明,否则后续 +的拉取请求很可能会被拒绝。 + +想要将主分支合并到存储库中是很自然的;这种类型的合并通常被称为“反向合并” +。反向合并有助于确保与并行的开发没有冲突,并且通常会给人一种温暖、舒服的 +感觉,即处于最新。但这种诱惑几乎总是应该避免的。 + +为什么呢?反向合并将搅乱你自己分支的开发历史。它们会大大增加你遇到来自社区 +其他地方的错误的机会,且使你很难确保你所管理的工作稳定并准备好合入上游。 +频繁的合并还可以掩盖树中开发过程中的问题;它们会隐藏与其他树的交互,而这些 +交互不应该(经常)发生在管理良好的分支中。 + +也就是说,偶尔需要进行反向合并;当这种情况发生时,一定要在提交信息中记录 +*为什么* 。同样,在一个众所周知的稳定点进行合并,而不是随机提交。即使这样, +你也不应该反向合并一棵比你的直接上游树更高层级的树;如果确实需要更高级别的 +反向合并,应首先在上游树进行。 + +导致合并相关问题最常见的原因之一是:在发送拉取请求之前维护者合并上游以解决 +合并冲突。同样,这种诱惑很容易理解,但绝对应该避免。对于最终拉取请求来说Quoted 8 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst line 133
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +6
-0+尤其如此:Linus坚信他更愿意看到合并冲突,而不是不必要的反向合并。看到冲突 +可以让他了解潜在的问题所在。他做过很多合并(在5.1版本开发周期中是382次), +而且在解决冲突方面也很在行——通常比参与的开发人员要强。 + +那么,当他们的子系统分支和主线之间发生冲突时,维护人员应该怎么做呢?最重要 +的一步是在拉取请求中警告Linus会发生冲突;如果啥都没说则表明您的分支可以正常警告 -> 提示? (It's a little impolite to use a warning in a Chinese)
OK.
Quoted 38 lines
Quoted 33 lines
Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst new file +32
-1+合入。对于特别困难的冲突,创建并推送一个 *独立* 分支来展示你将如何解决问题。 +在拉取请求中提到该分支,但是请求本身应该针对未合并的分支。 + +即使不存在已知冲突,在发送拉取请求之前进行合并测试也是个好主意。它可能会提醒 +您一些在linux-next树中没有发现的问题,并帮助您准确地理解您正在要求上游做什么。 + +合并上游树或另一个子系统树的另一个原因是解决依赖关系。这些依赖性问题有时确实 +会发生,而且有时与另一棵树交叉合并是解决这些问题的最佳方法;同样,在这种情况 +下,合并提交应该解释为什么要进行合并。花点时间把它做好;会有人阅读这些变更 +日志。 + +然而依赖性问题通常表明需要改变方法。合并另一个子系统树以解决依赖性风险会带来 +其他缺陷,几乎永远不应这样做。如果该子系统树无法被合到上游,那么它的任何问题 +也都会阻碍你的树合并。更可取的选择包括与维护人员达成一致意见,在其中一个树中 +同时进行两组更改;或者创建一个主题分支专门处理可以合并到两个树中的先决条件提交。 +如果依赖关系与主要的基础结构更改相关,正确的解决方案可能是将依赖提交保留一个 +开发周期,以便这些更改有时间在主线上稳定。 + +最后 +==== + +在开发周期的开头合并主线是比较常见的,可以获取树中其他地方的更改和修复。同样, +这样的合并应该选择一个众所周知的发布点,而不是一些随机点。如果在合并窗口期间 +上游分支已完全清空到主线中,则可以使用以下命令向前拉取它:: + + git merge v5.2-rc1^0 + +“^0”使Git执行快进合并(在这种情况下这应该可以),从而避免多余的虚假合并提交。 + +上面列出的就是指导方针了。总是会有一些情况需要不同的解决方案,这些指导原则 +不应阻止开发人员在需要时做正确的事情。但是,我们应该时刻考虑是否真的出现了 +这样的需求,并准备好解释为什么需要做一些不寻常的事情。 --Quoted 2 lines
2.20.1
I'll review the other patches later in the evening.
Quoted 3 lines
Thinks,
yanteng
Thanks for your review!
Do be too late a night, hair is important ;)
Wu X.C.
PATCH 4/6 docs/zh_CN: Add translation zh_CN/maintainer/pull-requests.rst
In reply to Wu XiangChengAdd a new translation
Documentation/translations/zh_CN/maintainer/pull-requests.rst
and link it to zh_CN/maintainer/index.rst
--- .../translations/zh_CN/maintainer/index.rst | 2 +- .../zh_CN/maintainer/pull-requests.rst | 148 ++++++++++++++++++ 2 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/zh_CN/maintainer/pull-requests.rst
Documentation/translations/zh_CN/maintainer/index.rst +1 -1
@@ -15,9 +15,9 @@ configure-git rebasing-and-merging + pull-requests TODOList: -- pull-requests - maintainer-entry-profile - modifying-patches
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +148 -0
148 lines not on this page · raw message
Signature · 1 line
2.20.1
Re: [PATCH 4/6] docs/zh_CN: Add translation zh_CN/maintainer/pull-requests.rst
Quoted 54 lines · Wu XiangCheng <[email protected]> 于2021年4月22日周四 下午8:28写道:
Add a new translation
Documentation/translations/zh_CN/maintainer/pull-requests.rst
and link it tozh_CN/maintainer/index.rstSigned-off-by Wu XiangCheng <[email protected]>--- .../translations/zh_CN/maintainer/index.rst | 2 +- .../zh_CN/maintainer/pull-requests.rst | 148 ++++++++++++++++++ 2 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/zh_CN/maintainer/pull-requests.rstDocumentation/translations/zh_CN/maintainer/index.rst +1
-1@@ -15,9 +15,9 @@ configure-git rebasing-and-merging + pull-requests TODOList: -- pull-requests - maintainer-entry-profile - modifying-patchesDocumentation/translations/zh_CN/maintainer/pull-requests.rst new file +21
-0@@ -0,0 +1,148 @@ +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/maintainer/pull-requests.rst + +:译者: + + 吴想成 Wu XiangCheng <[email protected]> + +.. _pullrequests_zh: + +如何创建拉取请求 +================ + +本章描述维护人员如何创建并向其他维护人员提交拉取请求。这对将更改从一个维护者 +树转移到另一个维护者树非常有用。 + +本文档由Tobin C. Harding(当时他尚不是一名经验丰富的维护人员)编写,内容主要 +来自Greg Kroah Hartman和Linus Torvalds在LKML上的评论。Jonathan Corbet和Mauro +Carvalho Chehab提出了一些建议和修改。错误不可避免,如有问题,请找Tobin C. +Harding <[email protected]>。 +
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 31
Quoted 10 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +10
-0+原始邮件线程:: + + http://lkml.kernel.org/r/[email protected] + + +创建分支 +-------- + +首先,您需要将希望包含拉取请求里的所有更改都放在单独分支中。通常您会基于您打算 +向其发送拉取请求的开发人员树中的某个分支。
Can you split it into short sentences? I have difficulty in understanding it.
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 38
Quoted 7 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +7
-0+ +为了创建拉取请求,您必须首先标记刚刚创建的分支。建议您选择一个有意义的标记名, +以即使过了一段时间您和他人仍能理解的方式。在名称中包含源子系统和目标内核版本 +的指示也是一个好的做法。 + +Greg提供了以下内容。对于一个含有drivers/char中混杂事项、将应用于4.15-rc1内核的 +拉取请求,可以命名为 ``char-misc-4.15-rc1`` 。如果这样的标记会标注在名为
会 -> 将要?
maybe 如果这样的标签会从一个名为``char-misc-next`` 的分支中产生,那么您将可以……?
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 50
Quoted 12 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +12
-0+``char-misc-next`` 的分支上,您将使用以下命令:: + + git tag -s char-misc-4.15-rc1 char-misc-next + +这将在 ``char-misc-next`` 分支的最后一个提交上创建一个名为 ``char-misc-4.15-rc1`` +的标记,并用您的gpg密钥签名(参见 Documentation/maintainer/configure-git.rst )。 + +Linus只接受基于签名过的标记的拉取请求。其他维护者可能会有所不同。 + +当您运行上述命令时 ``git`` 会打开编辑器要求你描述一下这个标签。在本例中您需要 +描述拉取请求,所以请概述一下包含的内容,为什么要合并,是否完成任何测试。所有 +这些信息都将留在标记中,然后在维护者合并拉取请求时保留在合并提交中。所以把它
所以请把它写好(or写详细/准确?)
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 55
Quoted 5 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +5
-0+写好,它将永远留在内核中。 + +正如Linus所说:: + + 不管怎么样,至少对我来说,重要的是 *消息* 。我需要知道我在拉取什么、
maybe 消息 -> 信息?
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +6
-0+ 为什么我要拉取。我也希望将此消息用于合并消息,因此它不仅应该对我有 + 意义,也应该可以成为一个有意义的历史记录。 + + 注意,如果拉取请求有一些不寻常的地方,请详细说明。如果你修改了并非 + 由你维护的文件,请解释 **为什么** 。我总会在差异中看到的,如果你不 + 提的话,我只会觉得分外可疑。当你在合并窗口后给我发新东西的时候,
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 71
Quoted 10 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +10
-0+ (甚至是比较重大的错误修复),不仅需要解释做了什么、为什么这么做, + 还请解释一下 **时间** 。为什么错过了合并窗口…… + + 我会看你写在拉取请求邮件和签名标记里面的内容,所以根据你的工作流, + 你可以在签名标记里面描述工作内容(也会自动放进拉取请求邮件),也 + 可以只在标记里面放个占位符,稍后在你实际发给我拉取请求时描述工作内容。 + + 是的,我会编辑这些消息。部分因为我需要做一些琐碎的格式调整(整体缩进、 + 括号等),也因为此消息可能对我有意义(描述了冲突或一些个人问题)而对 + 合并提交信息上下文没啥意义,无噢耶我需要尽力让它有意义起来。我也会
what is "无噢耶“? :)
Quoted 78 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +77
-1+ 修复一些拼写和语法错误,特别是非母语者(母语者也是;^)。但我也会删掉 + 或增加一些内容。 + + Linus + +Greg给出了一个拉取请求的例子:: + + Char/Misc patches for 4.15-rc1 + + Here is the big char/misc patch set for the 4.15-rc1 merge window. + Contained in here is the normal set of new functions added to all + of these crazy drivers, as well as the following brand new + subsystems: + - time_travel_controller: Finally a set of drivers for the + latest time travel bus architecture that provides i/o to + the CPU before it asked for it, allowing uninterrupted + processing + - relativity_shifters: due to the affect that the + time_travel_controllers have on the overall system, there + was a need for a new set of relativity shifter drivers to + accommodate the newly formed black holes that would + threaten to suck CPUs into them. This subsystem handles + this in a way to successfully neutralize the problems. + There is a Kconfig option to force these to be enabled + when needed, so problems should not occur. + + All of these patches have been successfully tested in the latest + linux-next releases, and the original problems that it found have + all been resolved (apologies to anyone living near Canberra for the + lack of the Kconfig options in the earlier versions of the + linux-next tree creations.) + + Signed-off-by: Your-name-here <your_email@domain> + + +此标记消息格式就像一个git提交。顶部有一行“总结标题”, 一定要在下面sign-off。 + +现在您已经有了一个本地签名标记,您需要将它推送到可以被拉取的位置:: + + git push origin char-misc-4.15-rc1 + + +创建拉取请求 +------------ + +最后要做的是创建拉取请求消息。可以使用 ``git request-pull`` 命令让 ``git`` +为你做这件事,但它需要确定你想拉取什么,以及拉取针对的基础(显示正确的拉取 +更改和变更状态)。以下命令将生成一个拉取请求:: + + git request-pull master git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/ char-misc-4.15-rc1 + +引用Greg的话:: + + 此命令要求git比较从“char-misc-4.15-rc1”标记位置到“master”分支头(上述 + 例子中指向了我从Linus的树分叉的地方,通常是-rc发布)的差异,并去使用 + git:// 协议拉取。如果你希望使用 https:// 协议,也可以用在这里(但是请 + 注意,部分人由于防火墙问题没法用https协议拉取)。 + + 如果char-misc-4.15-rc1标记没有出现在我要求拉取的仓库中,git会提醒 + 它不在那里,所以记得推送到公开地方。 + + “git request-pull”会包含git树的地址和需要拉取的特定标记,以及标记 + 描述全文(详尽描述标记)。同时它也会创建此拉取请求的差异状态和单个 + 提交的缩短日志。 + +Linus回复说他倾向于 ``git://`` 协议。其他维护者可能有不同的偏好。另外,请注意 +如果你创建的拉取请求没有签名标记, ``https://`` 可能是更好的选择。完整的讨论 +请看原邮件。 + + +提交拉取请求 +------------ + +拉取请求的提交方式与普通补丁相同。向维护人员发送内联电子邮件并抄送LKML以及 +任何必要特定子系统的列表。对Linus的拉取请求通常有如下主题行:: + + [GIT PULL] <subsystem> changes for v4.15-rc1 --
Quoted 2 lines
2.20.1
Thanks,
Yanteng
Re: [PATCH 4/6] docs/zh_CN: Add translation zh_CN/maintainer/pull-requests.rst
Quoted 59 lines · teng sterling
Quoted 58 lines · Wu XiangCheng <[email protected]> 于2021年4月22日周四 下午8:28写道:
Add a new translation
Documentation/translations/zh_CN/maintainer/pull-requests.rst
and link it tozh_CN/maintainer/index.rstSigned-off-by Wu XiangCheng <[email protected]>--- .../translations/zh_CN/maintainer/index.rst | 2 +- .../zh_CN/maintainer/pull-requests.rst | 148 ++++++++++++++++++ 2 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/zh_CN/maintainer/pull-requests.rstDocumentation/translations/zh_CN/maintainer/index.rst +1
-1@@ -15,9 +15,9 @@ configure-git rebasing-and-merging + pull-requests TODOList: -- pull-requests - maintainer-entry-profile - modifying-patchesDocumentation/translations/zh_CN/maintainer/pull-requests.rst new file +25
-0@@ -0,0 +1,148 @@ +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/maintainer/pull-requests.rst + +:译者: + + 吴想成 Wu XiangCheng <[email protected]> + +.. _pullrequests_zh: + +如何创建拉取请求 +================ + +本章描述维护人员如何创建并向其他维护人员提交拉取请求。这对将更改从一个维护者 +树转移到另一个维护者树非常有用。 + +本文档由Tobin C. Harding(当时他尚不是一名经验丰富的维护人员)编写,内容主要 +来自Greg Kroah Hartman和Linus Torvalds在LKML上的评论。Jonathan Corbet和Mauro +Carvalho Chehab提出了一些建议和修改。错误不可避免,如有问题,请找Tobin C. +Harding <[email protected]>。 + +原始邮件线程:: + + http://lkml.kernel.org/r/[email protected] +
Quoted 8 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 31
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +6
-0+ +创建分支 +-------- + +首先,您需要将希望包含拉取请求里的所有更改都放在单独分支中。通常您会基于您打算 +向其发送拉取请求的开发人员树中的某个分支。Can you split it into short sentences? I have difficulty in understanding it.
首先,您需要将希望包含在拉取请求里的所有更改都放在单独分支中。通常您将基于
某开发人员树的一个分支,一般是打算向其发送拉取请求的开发人员。
or
首先,您需要将希望包含在拉取请求里的所有更改都放在单独分支中。通常您会基于
将接受拉取请求的开发人员的树中某分支。
Which is better?
Quoted 10 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 38
Quoted 7 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +7
-0+ +为了创建拉取请求,您必须首先标记刚刚创建的分支。建议您选择一个有意义的标记名, +以即使过了一段时间您和他人仍能理解的方式。在名称中包含源子系统和目标内核版本 +的指示也是一个好的做法。 + +Greg提供了以下内容。对于一个含有drivers/char中混杂事项、将应用于4.15-rc1内核的 +拉取请求,可以命名为 ``char-misc-4.15-rc1`` 。如果这样的标记会标注在名为会 -> 将要?
maybe 如果这样的标签会从一个名为``char-misc-next`` 的分支中产生,那么您将可以……?
Tags are marked on a branch, not separated from a branch.
use
如果要在 ``char-misc-next`` 分支上打上此标记,您可以使用以下命令::
Quoted 6 lines
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +6
-0+``char-misc-next`` 的分支上,您将使用以下命令:: + + git tag -s char-misc-4.15-rc1 char-misc-next + +这将在 ``char-misc-next`` 分支的最后一个提交上创建一个名为 ``char-misc-4.15-rc1`` +的标记,并用您的gpg密钥签名(参见 Documentation/maintainer/configure-git.rst )。
Quoted 8 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 50
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +6
-0+ +Linus只接受基于签名过的标记的拉取请求。其他维护者可能会有所不同。 + +当您运行上述命令时 ``git`` 会打开编辑器要求你描述一下这个标签。在本例中您需要 +描述拉取请求,所以请概述一下包含的内容,为什么要合并,是否完成任何测试。所有 +这些信息都将留在标记中,然后在维护者合并拉取请求时保留在合并提交中。所以把它所以请把它写好(or写详细/准确?)
just 'well', so as 'well' :)
Quoted 7 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 55
Quoted 5 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +5
-0+写好,它将永远留在内核中。 + +正如Linus所说:: + + 不管怎么样,至少对我来说,重要的是 *消息* 。我需要知道我在拉取什么、maybe 消息 -> 信息?
ok.
Quoted 10 lines
Quoted 10 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +10
-0+ 为什么我要拉取。我也希望将此消息用于合并消息,因此它不仅应该对我有 + 意义,也应该可以成为一个有意义的历史记录。 + + 注意,如果拉取请求有一些不寻常的地方,请详细说明。如果你修改了并非 + 由你维护的文件,请解释 **为什么** 。我总会在差异中看到的,如果你不 + 提的话,我只会觉得分外可疑。当你在合并窗口后给我发新东西的时候, + (甚至是比较重大的错误修复),不仅需要解释做了什么、为什么这么做, + 还请解释一下 **时间** 。为什么错过了合并窗口…… + + 我会看你写在拉取请求邮件和签名标记里面的内容,所以根据你的工作流,
Quoted 8 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 71
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +6
-0+ 你可以在签名标记里面描述工作内容(也会自动放进拉取请求邮件),也 + 可以只在标记里面放个占位符,稍后在你实际发给我拉取请求时描述工作内容。 + + 是的,我会编辑这些消息。部分因为我需要做一些琐碎的格式调整(整体缩进、 + 括号等),也因为此消息可能对我有意义(描述了冲突或一些个人问题)而对 + 合并提交信息上下文没啥意义,无噢耶我需要尽力让它有意义起来。我也会what is "无噢耶“? :)
Oh my Marx!
replaced with 因此
Quoted 83 lines
Quoted 78 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +77
-1+ 修复一些拼写和语法错误,特别是非母语者(母语者也是;^)。但我也会删掉 + 或增加一些内容。 + + Linus + +Greg给出了一个拉取请求的例子:: + + Char/Misc patches for 4.15-rc1 + + Here is the big char/misc patch set for the 4.15-rc1 merge window. + Contained in here is the normal set of new functions added to all + of these crazy drivers, as well as the following brand new + subsystems: + - time_travel_controller: Finally a set of drivers for the + latest time travel bus architecture that provides i/o to + the CPU before it asked for it, allowing uninterrupted + processing + - relativity_shifters: due to the affect that the + time_travel_controllers have on the overall system, there + was a need for a new set of relativity shifter drivers to + accommodate the newly formed black holes that would + threaten to suck CPUs into them. This subsystem handles + this in a way to successfully neutralize the problems. + There is a Kconfig option to force these to be enabled + when needed, so problems should not occur. + + All of these patches have been successfully tested in the latest + linux-next releases, and the original problems that it found have + all been resolved (apologies to anyone living near Canberra for the + lack of the Kconfig options in the earlier versions of the + linux-next tree creations.) + + Signed-off-by: Your-name-here <your_email@domain> + + +此标记消息格式就像一个git提交。顶部有一行“总结标题”, 一定要在下面sign-off。 + +现在您已经有了一个本地签名标记,您需要将它推送到可以被拉取的位置:: + + git push origin char-misc-4.15-rc1 + + +创建拉取请求 +------------ + +最后要做的是创建拉取请求消息。可以使用 ``git request-pull`` 命令让 ``git`` +为你做这件事,但它需要确定你想拉取什么,以及拉取针对的基础(显示正确的拉取 +更改和变更状态)。以下命令将生成一个拉取请求:: + + git request-pull master git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/ char-misc-4.15-rc1 + +引用Greg的话:: + + 此命令要求git比较从“char-misc-4.15-rc1”标记位置到“master”分支头(上述 + 例子中指向了我从Linus的树分叉的地方,通常是-rc发布)的差异,并去使用 + git:// 协议拉取。如果你希望使用 https:// 协议,也可以用在这里(但是请 + 注意,部分人由于防火墙问题没法用https协议拉取)。 + + 如果char-misc-4.15-rc1标记没有出现在我要求拉取的仓库中,git会提醒 + 它不在那里,所以记得推送到公开地方。 + + “git request-pull”会包含git树的地址和需要拉取的特定标记,以及标记 + 描述全文(详尽描述标记)。同时它也会创建此拉取请求的差异状态和单个 + 提交的缩短日志。 + +Linus回复说他倾向于 ``git://`` 协议。其他维护者可能有不同的偏好。另外,请注意 +如果你创建的拉取请求没有签名标记, ``https://`` 可能是更好的选择。完整的讨论 +请看原邮件。 + + +提交拉取请求 +------------ + +拉取请求的提交方式与普通补丁相同。向维护人员发送内联电子邮件并抄送LKML以及 +任何必要特定子系统的列表。对Linus的拉取请求通常有如下主题行:: + + [GIT PULL] <subsystem> changes for v4.15-rc1 --Quoted 2 lines
2.20.1
Thanks,
Quoted 1 line
Yanteng
Thanks for your review!
Wu X.C.
teng sterling
Reviewed-by Yanteng SiRe: [PATCH 4/6] docs/zh_CN: Add translation zh_CN/maintainer/pull-requests.rst
Quoted 73 lines · Wu X.C. <[email protected]> 于2021年4月23日周五 下午11:58写道:
Quoted 59 lines · teng sterling
Quoted 58 lines · Wu XiangCheng <[email protected]> 于2021年4月22日周四 下午8:28写道:
Add a new translation
Documentation/translations/zh_CN/maintainer/pull-requests.rst
and link it tozh_CN/maintainer/index.rstSigned-off-by Wu XiangCheng <[email protected]>--- .../translations/zh_CN/maintainer/index.rst | 2 +- .../zh_CN/maintainer/pull-requests.rst | 148 ++++++++++++++++++ 2 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/zh_CN/maintainer/pull-requests.rstDocumentation/translations/zh_CN/maintainer/index.rst +1
-1@@ -15,9 +15,9 @@ configure-git rebasing-and-merging + pull-requests TODOList: -- pull-requests - maintainer-entry-profile - modifying-patchesDocumentation/translations/zh_CN/maintainer/pull-requests.rst new file +25
-0@@ -0,0 +1,148 @@ +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/maintainer/pull-requests.rst + +:译者: + + 吴想成 Wu XiangCheng <[email protected]> + +.. _pullrequests_zh: + +如何创建拉取请求 +================ + +本章描述维护人员如何创建并向其他维护人员提交拉取请求。这对将更改从一个维护者 +树转移到另一个维护者树非常有用。 + +本文档由Tobin C. Harding(当时他尚不是一名经验丰富的维护人员)编写,内容主要 +来自Greg Kroah Hartman和Linus Torvalds在LKML上的评论。Jonathan Corbet和Mauro +Carvalho Chehab提出了一些建议和修改。错误不可避免,如有问题,请找Tobin C. +Harding <[email protected]>。 + +原始邮件线程:: + + http://lkml.kernel.org/r/[email protected] +Quoted 8 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 31
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +6
-0+ +创建分支 +-------- + +首先,您需要将希望包含拉取请求里的所有更改都放在单独分支中。通常您会基于您打算 +向其发送拉取请求的开发人员树中的某个分支。Can you split it into short sentences? I have difficulty in understanding it.
首先,您需要将希望包含在拉取请求里的所有更改都放在单独分支中。通常您将基于
某开发人员树的一个分支,一般是打算向其发送拉取请求的开发人员。
Quoted 6 lines
or
首先,您需要将希望包含在拉取请求里的所有更改都放在单独分支中。通常您会基于
将接受拉取请求的开发人员的树中某分支。Which is better?
All three options are available. thinks!
Quoted 150 lines
Quoted 11 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 38
Quoted 8 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +7
-0+ +为了创建拉取请求,您必须首先标记刚刚创建的分支。建议您选择一个有意义的标记名, +以即使过了一段时间您和他人仍能理解的方式。在名称中包含源子系统和目标内核版本 +的指示也是一个好的做法。 + +Greg提供了以下内容。对于一个含有drivers/char中混杂事项、将应用于4.15-rc1内核的 +拉取请求,可以命名为 ``char-misc-4.15-rc1`` 。如果这样的标记会标注在名为会 -> 将要?
maybe 如果这样的标签会从一个名为``char-misc-next`` 的分支中产生,那么您将可以……?Tags are marked on a branch, not separated from a branch.
use
如果要在 ``char-misc-next`` 分支上打上此标记,您可以使用以下命令::Quoted 6 lines
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +6
-0+``char-misc-next`` 的分支上,您将使用以下命令:: + + git tag -s char-misc-4.15-rc1 char-misc-next + +这将在 ``char-misc-next`` 分支的最后一个提交上创建一个名为 ``char-misc-4.15-rc1`` +的标记,并用您的gpg密钥签名(参见 Documentation/maintainer/configure-git.rst )。Quoted 8 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 50
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +6
-0+ +Linus只接受基于签名过的标记的拉取请求。其他维护者可能会有所不同。 + +当您运行上述命令时 ``git`` 会打开编辑器要求你描述一下这个标签。在本例中您需要 +描述拉取请求,所以请概述一下包含的内容,为什么要合并,是否完成任何测试。所有 +这些信息都将留在标记中,然后在维护者合并拉取请求时保留在合并提交中。所以把它所以请把它写好(or写详细/准确?)
just 'well', so as 'well' :)
Quoted 7 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 55
Quoted 5 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +5
-0+写好,它将永远留在内核中。 + +正如Linus所说:: + + 不管怎么样,至少对我来说,重要的是 *消息* 。我需要知道我在拉取什么、maybe 消息 -> 信息?
ok.
Quoted 10 lines
Quoted 10 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +10
-0+ 为什么我要拉取。我也希望将此消息用于合并消息,因此它不仅应该对我有 + 意义,也应该可以成为一个有意义的历史记录。 + + 注意,如果拉取请求有一些不寻常的地方,请详细说明。如果你修改了并非 + 由你维护的文件,请解释 **为什么** 。我总会在差异中看到的,如果你不 + 提的话,我只会觉得分外可疑。当你在合并窗口后给我发新东西的时候, + (甚至是比较重大的错误修复),不仅需要解释做了什么、为什么这么做, + 还请解释一下 **时间** 。为什么错过了合并窗口…… + + 我会看你写在拉取请求邮件和签名标记里面的内容,所以根据你的工作流,Quoted 8 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst line 71
Quoted 6 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +6
-0+ 你可以在签名标记里面描述工作内容(也会自动放进拉取请求邮件),也 + 可以只在标记里面放个占位符,稍后在你实际发给我拉取请求时描述工作内容。 + + 是的,我会编辑这些消息。部分因为我需要做一些琐碎的格式调整(整体缩进、 + 括号等),也因为此消息可能对我有意义(描述了冲突或一些个人问题)而对 + 合并提交信息上下文没啥意义,无噢耶我需要尽力让它有意义起来。我也会what is "无噢耶“? :)
Oh my Marx!
replaced with 因此
Quoted 83 lines
Quoted 78 lines
Documentation/translations/zh_CN/maintainer/pull-requests.rst new file +77
-1+ 修复一些拼写和语法错误,特别是非母语者(母语者也是;^)。但我也会删掉 + 或增加一些内容。 + + Linus + +Greg给出了一个拉取请求的例子:: + + Char/Misc patches for 4.15-rc1 + + Here is the big char/misc patch set for the 4.15-rc1 merge window. + Contained in here is the normal set of new functions added to all + of these crazy drivers, as well as the following brand new + subsystems: + - time_travel_controller: Finally a set of drivers for the + latest time travel bus architecture that provides i/o to + the CPU before it asked for it, allowing uninterrupted + processing + - relativity_shifters: due to the affect that the + time_travel_controllers have on the overall system, there + was a need for a new set of relativity shifter drivers to + accommodate the newly formed black holes that would + threaten to suck CPUs into them. This subsystem handles + this in a way to successfully neutralize the problems. + There is a Kconfig option to force these to be enabled + when needed, so problems should not occur. + + All of these patches have been successfully tested in the latest + linux-next releases, and the original problems that it found have + all been resolved (apologies to anyone living near Canberra for the + lack of the Kconfig options in the earlier versions of the + linux-next tree creations.) + + Signed-off-by: Your-name-here <your_email@domain> + + +此标记消息格式就像一个git提交。顶部有一行“总结标题”, 一定要在下面sign-off。 + +现在您已经有了一个本地签名标记,您需要将它推送到可以被拉取的位置:: + + git push origin char-misc-4.15-rc1 + + +创建拉取请求 +------------ + +最后要做的是创建拉取请求消息。可以使用 ``git request-pull`` 命令让 ``git`` +为你做这件事,但它需要确定你想拉取什么,以及拉取针对的基础(显示正确的拉取 +更改和变更状态)。以下命令将生成一个拉取请求:: + + git request-pull master git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/ char-misc-4.15-rc1 + +引用Greg的话:: + + 此命令要求git比较从“char-misc-4.15-rc1”标记位置到“master”分支头(上述 + 例子中指向了我从Linus的树分叉的地方,通常是-rc发布)的差异,并去使用 + git:// 协议拉取。如果你希望使用 https:// 协议,也可以用在这里(但是请 + 注意,部分人由于防火墙问题没法用https协议拉取)。 + + 如果char-misc-4.15-rc1标记没有出现在我要求拉取的仓库中,git会提醒 + 它不在那里,所以记得推送到公开地方。 + + “git request-pull”会包含git树的地址和需要拉取的特定标记,以及标记 + 描述全文(详尽描述标记)。同时它也会创建此拉取请求的差异状态和单个 + 提交的缩短日志。 + +Linus回复说他倾向于 ``git://`` 协议。其他维护者可能有不同的偏好。另外,请注意 +如果你创建的拉取请求没有签名标记, ``https://`` 可能是更好的选择。完整的讨论 +请看原邮件。 + + +提交拉取请求 +------------ + +拉取请求的提交方式与普通补丁相同。向维护人员发送内联电子邮件并抄送LKML以及 +任何必要特定子系统的列表。对Linus的拉取请求通常有如下主题行:: + + [GIT PULL] <subsystem> changes for v4.15-rc1 --Quoted 2 lines
2.20.1
Thanks,
Quoted 6 lines
Quoted 1 line
Yanteng
Thanks for your review!
Wu X.C.
Thanks,
Yanteng
PATCH 5/6 docs/zh_CN: Add translation zh_CN/maintainer/maintainer-entry-profile.rst
In reply to Wu XiangChengAdd a new translation
Documentation/translations/zh_CN/maintainer/maintainer-entry-profile.rst
and link it to zh_CN/maintainer/index.rst
--- .../translations/zh_CN/maintainer/index.rst | 2 +- .../maintainer/maintainer-entry-profile.rst | 92 +++++++++++++++++++ 2 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/zh_CN/maintainer/maintainer-entry-profile.rst
Documentation/translations/zh_CN/maintainer/index.rst +1 -1
@@ -16,8 +16,8 @@ configure-git rebasing-and-merging pull-requests + maintainer-entry-profile TODOList: -- maintainer-entry-profile - modifying-patches
Documentation/translations/zh_CN/maintainer/maintainer-entry-profile.rst new file +92 -0
92 lines not on this page · raw message
Signature · 1 line
2.20.1
Re: [PATCH 5/6] docs/zh_CN: Add translation zh_CN/maintainer/maintainer-entry-profile.rst
Quoted 127 lines · Wu XiangCheng <[email protected]> 于2021年4月22日周四 下午8:28写道:
Add a new translation
Documentation/translations/zh_CN/maintainer/maintainer-entry-profile.rst
and link it tozh_CN/maintainer/index.rstSigned-off-by Wu XiangCheng <[email protected]>--- .../translations/zh_CN/maintainer/index.rst | 2 +- .../maintainer/maintainer-entry-profile.rst | 92 +++++++++++++++++++ 2 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/zh_CN/maintainer/maintainer-entry-profile.rstDocumentation/translations/zh_CN/maintainer/index.rst +1
-1@@ -16,8 +16,8 @@ configure-git rebasing-and-merging pull-requests + maintainer-entry-profile TODOList: -- maintainer-entry-profile - modifying-patchesDocumentation/translations/zh_CN/maintainer/maintainer-entry-profile.rst new file +92
-1@@ -0,0 +1,92 @@ +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/maintainer/maintainer-entry-profile.rst + +:译者: + + 吴想成 Wu XiangCheng <[email protected]> + +.. _maintainerentryprofile_zh: + +维护者条目概要 +============== + +维护人员条目概要补充了顶层过程文档(提交补丁,提交驱动程序……),增加了子系 +统/设备驱动程序本地习惯以及有关补丁提交生命周期的相关内容。贡献者使用此文档 +来调整他们的期望和避免常见错误;维护人员可以使用这些信息超越子系统层面查看 +是否有机会汇聚到通用实践中。 + + +总览 +---- + +提供了子系统如何操作的介绍。MAINTAINERS文件告诉了贡献者应发送某文件的补丁到哪, +但它没有传达其他子系统的本地基础设施和机制以协助开发。 + +请考虑以下问题: + +- 当补丁被本地树接纳或合并到上游时是否有通知? +- 子系统是否使用patchwork实例?Patchwork状态变更是否有通知? +- 是否有任何机器人或CI基础设施监视列表,或子系统是否使用自动测试反馈以便把 + 控接纳补丁? +- 被拉入-next的Git分支是哪个? +- 贡献者应针对哪个分支提交? +- 是否链接到其他维护者条目概要?例如一个设备驱动可能指向其父子系统的条目。 + 这使得贡献者意识到某维护者可能对提交链中其他维护者负有的义务。 + + +提交检查单补遗 +-------------- + +列出强制性和咨询性标准,超出通用标准“提交检查表,以便维护者检查一个补丁是否 +足够健康。例如:“通过checkpatch.pl,没有错误、没有警告。通过单元测试详见某处”。 + +提交检查单补遗还可以包括有关硬件规格状态的详细信息。例如,子系统接受补丁之前 +是否需要考虑在某个修订版上发布的规范。 + + +开发周期的关键日期 +------------------ + +提交者常常会误以为补丁可以在合并窗口关闭之前的任何时间发送,且下一个-rc1时仍 +可以。事实上,大多数补丁都需要在下一个合并窗口打开之前提前进入linux-next中。 +向提交者澄清关键日期(以-rc发布周为标志)以明确什么时候补丁会被考虑合并以及 +何时需要等待下一个-rc。 + +至少需要讲明: + +- 最后一个可以提交新功能的-rc: + 针对下一个合并窗口的新功能提交应该在此点之前首次发布以供考虑。在此时间点 + 之后提交的补丁应该明确他们的目标为下下个合并窗口,或者给出应加快进度被接受 + 的充足理由。通常新特性贡献者的提交应出现在-rc5之前。 + +- 最后合并-rc:合并决策的最后期限。 + 向贡献者指出尚未接受的补丁集需要等待下下个合并窗口。当然,维护者没有义务 + 接受所有给定的补丁集,但是如果审阅在此时间点尚未结束,那么希望贡献者应该 + 等待并在下一个合并窗口重新提交。 + +可选项: + +- 开发基线分支的首个-rc,列在概述部分,视为已为新提交做好准备。 + + +审阅节奏 +-------- + +贡献者最担心的问题之一是:补丁集已发布却未收到反馈,应在多久后发送提醒。除了 +指定在重新提交之前要等待多长时间,还可以指示更新的首选样式;例如,重新发送 +整个系列,或私下发送提醒邮件。本节也可以列出本区域的代码审阅方式,以及获取 +不能直接从维护者那里得到的反馈的方法。 + + +现有概要 +-------- + +这里列出了现有的维护人员条目概要;我们可能会想要在不久的将来做一些不同的事情。 + +.. toctree:: + :maxdepth: 1 + + ../doc-guide/maintainer-profile + ../../../nvdimm/maintainer-entry-profile + ../../../riscv/patch-acceptance --2.20.1
PATCH 6/6 docs/zh_CN: Add translation zh_CN/maintainer/modifying-patches.rst
In reply to Wu XiangChengAdd a new translation
Documentation/translations/zh_CN/maintainer/modifying-patches.rst
and link it to zh_CN/maintainer/index.rst
--- .../translations/zh_CN/maintainer/index.rst | 4 +- .../zh_CN/maintainer/modifying-patches.rst | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 Documentation/translations/zh_CN/maintainer/modifying-patches.rst
Documentation/translations/zh_CN/maintainer/index.rst +1 -3
@@ -17,7 +17,5 @@ rebasing-and-merging pull-requests maintainer-entry-profile + modifying-patches -TODOList: - -- modifying-patches
Documentation/translations/zh_CN/maintainer/modifying-patches.rst new file +51 -0
51 lines not on this page · raw message
Signature · 1 line
2.20.1
Re: [PATCH 6/6] docs/zh_CN: Add translation zh_CN/maintainer/modifying-patches.rst
Quoted 85 lines · Wu XiangCheng <[email protected]> 于2021年4月22日周四 下午8:30写道:
Add a new translation
Documentation/translations/zh_CN/maintainer/modifying-patches.rst
and link it tozh_CN/maintainer/index.rstSigned-off-by Wu XiangCheng <[email protected]>--- .../translations/zh_CN/maintainer/index.rst | 4 +- .../zh_CN/maintainer/modifying-patches.rst | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 Documentation/translations/zh_CN/maintainer/modifying-patches.rstDocumentation/translations/zh_CN/maintainer/index.rst +1
-3@@ -17,7 +17,5 @@ rebasing-and-merging pull-requests maintainer-entry-profile + modifying-patches -TODOList: - -- modifying-patchesDocumentation/translations/zh_CN/maintainer/modifying-patches.rst new file +51
-1@@ -0,0 +1,51 @@ +.. include:: ../disclaimer-zh_CN.rst + +:Original: Documentation/maintainer/modifying-patches.rst + +:译者: + + 吴想成 Wu XiangCheng <[email protected]> + +.. _modifyingpatches_zh: + +修改补丁 +======== + +如果你是子系统或者分支的维护者,由于代码在你的和提交者的树中并不完全相同, +有时你需要稍微修改一下收到的补丁以合并它们。 + +如果你严格遵守开发者来源证书的规则(c),你应该要求提交者重做,但这完全是会 +适得其反的时间、精力浪费。规则(b)允许你调整代码,但这样修改提交者的代码并 +让他背书你的错误是非常不礼貌的。为解决此问题,建议在你之前最后一个 +Signed-off-by标签和你的之间添加一行,以指示更改的性质。这没有强制性要求,最 +好在描述前面加上你的邮件和/或姓名,用方括号括住整行,以明显指出你对最后一刻 +的更改负责。例如:: + + Signed-off-by: Random J Developer <[email protected]> + [[email protected]: struct foo moved from foo.c to foo.h] + Signed-off-by: Lucky K Maintainer <[email protected]> + +如果您维护着一个稳定的分支,并希望同时明确贡献、跟踪更改、合并修复,并保护 +提交者免受责难,这种做法尤其有用。请注意,在任何情况下都不得更改作者的身份 +(From头),因为它会在变更日志中显示。 + +回传(back-port)者特别要注意:为了便于跟踪,请在提交消息的顶部(就在主题行 +之后)插入补丁的来源,这是一种常见而有用的做法。例如,我们可以在3.x稳定版本 +中看到以下内容:: + + Date: Tue Oct 7 07:26:38 2014 -0400 + + libata: Un-break ATA blacklist + + commit 1c40279960bcd7d52dbdf1d466b20d24b99176c8 upstream. + +下面是一个旧的内核在某补丁被回传后会出现的:: + + Date: Tue May 13 22:12:27 2008 +0200 + + wireless, airo: waitbusy() won't delay + + [backport of 2.6 commit b7acbdfbd1f277c1eb23f344f899cfa4cd0bf36a] + +不管什么格式,这些信息都为人们跟踪你的树,以及试图解决你树中的错误的人提供了 +有价值的帮助。 --2.20.1