补丁工作流程
![]() 本文档旨在为发送和应用补丁定义一个工作流程。 它为 alpine 开发者和贡献者提供了背景知识。它以 FAQ 的形式呈现,但可能会用更好的方法进行更改。此外,图形化工作流程也会很有用。这里有一个不错的想法:[1] |
我想通过发送补丁来为 Alpine 项目做贡献。我该怎么做?
首先,谢谢您 :)
请查看 使用 git 进行开发 以及链接到它的文档。
我应该如何向 alpine-aports ML 提交补丁?
您可以按照本文档操作:创建补丁
请注意,Patchwork 能够捕获内联发送的补丁,而不是作为附件发送的补丁。
好的,现在我已经准备好了一个 aports git 树,并且向 alpine-aports ML 发送了一个补丁。然后呢?
做得好。现在补丁已进入我们的工作流程。
在您发送补丁后,它将被注入到 patchwork.alpinelinux.org 中。
那里有一个 Web 界面,您可以在其中查看发送到 git 的所有补丁。
alpine 开发者将从那里检查补丁并采取相应的行动。
工作流程状态包括
新建
Patch has been submitted to the list, and none of the maintainers has changed it's state since. Under Review::
已接受
When a patch has been applied to a custodian repository that gets used for pulling from into upstream, they are put into "accepted" state.
已拒绝
Rejected means we just don't want to do what the patch does.
RFC
The patch is not intended to be applied to any of the mainline repositories, but merely for discussing or testing some idea or new feature.
不适用
The patch does not apply cleanly against the current U-Boot repository, most probably because it was made against a much older version of U-Boot, or because the submitter's mailer mangled it (for example by converting TABs into SPACEs, or by breaking long lines).
需要更改
The patch looks mostly OK, but requires some rework before it will be accepted for mainline. Awaiting Upstream::
已取代
Patches are marked as 'superseded' when the poster submits a new version of these patches.
已延期
Deferred usually means the patch depends on something else that isn't upstream, such as patches that only apply against some specific other repository.
已存档
Archiving puts the patch away somewhere where it doesn't appear in the normal pages and needs extra effort to get to.
我们还可以将补丁放在“bundle”中。我尚不清楚这是否有更深层的意义,但它可以将它们标记为一起处理,例如逻辑上属于一起的补丁系列。
注意: 在 webif 上设置“approved”不会对 git 树产生影响。如果实际上已批准,则在使用 pwclient git-am 后,补丁的状态将自动更改为“approved”。这是更改状态的正确方法。一般来说,不需要在 webif 上更改状态。网页仅报告用户使用 pwclient 工具所做的事情。
我是一名 alpine 开发者。我如何开始使用 patchwork 呢?
有两种方法可以使用来自 alpine-aports 邮件列表的补丁
.1 Web 界面:https://patchwork.alpinelinux.org/[死链接]
.2 在您的本地构建环境中,您需要 pwclient
apk add pwclient
cd $your_aports_dir
pwclient list
此命令返回发送到 alpine-aports@lists.alpinelinux.org 并注入到 patchwork 工作流程中的补丁列表。
查看补丁
pwclient view $PATCH_ID.
假设是 66
pwclient view 66
host:~/aports$ pwclient view 66 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [alpine-aports] testing/proxychains-ng: install and install-config returns 1 in case of error From: Francesco Colista <fcolista@alpinelinux.org> X-Patchwork-Id: 66 Message-Id: <1430294296-26952-1-git-send-email-fcolista@alpinelinux.org> To: alpine-aports@lists.alpinelinux.org Cc: Francesco Colista <fcolista@alpinelinux.org> Date: Wed, 29 Apr 2015 07:58:16 +0000 --- testing/proxychains-ng/APKBUILD | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/testing/proxychains-ng/APKBUILD b/testing/proxychains-ng/APKBUILD index 463a2ac..b40ba25 100644 --- a/testing/proxychains-ng/APKBUILD +++ b/testing/proxychains-ng/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Francesco Colista <fcolista@alpinelinux.org> pkgname=proxychains-ng pkgver=4.8.1 -pkgrel=0 +pkgrel=1 pkgdesc="This tool provides proxy server support to any app." url="https://github.com/rofl0r/proxychains-ng" arch="all" @@ -36,8 +36,7 @@ build() { package() { cd "$_builddir" - make DESTDIR="$pkgdir" install - make DESTDIR="$pkgdir" install-config + make DESTDIR="$pkgdir" install install-config || return 1 ln -s proxychains4 "$pkgdir"/usr/bin/proxychains }
如果看起来不错,请尝试在您的 git 树中首先应用补丁并进行测试。
有三种方法可以在本地树中应用补丁。我们将展示所有这些方法...然后选择更适合您的方法。
.1 pwclient apply
注意: pwclient apply 命令使用 -p1 应用补丁。因此,补丁从当前目录开始应用。
pwclient apply 66
这会将补丁应用到您的本地 git 树中。然后您可以
abuild -r.
如果补丁没问题,那么您需要重置您的 git 树(因为它已通过应用补丁进行了修改)。所以
git checkout --
然后
pwclient git-am 66
这会一步到位地应用和提交补丁。
最后一步是将更改推送到 git 仓库,使用
git pull--rebase && git push
.2 pwclient get
pwclient get 66
更新 APKBUILD 以应用补丁,然后使用常用的方法构建它
abuild -r
如果补丁没问题,那么您需要重置您的 git 树(因为它已通过应用补丁进行了修改)。所以
git checkout --
然后
pwclient git-am 66
这会一步到位地应用和提交补丁。
最后一步是将更改推送到 git 仓库,使用
git pull--rebase && git push
.3 pwclient git-am
这可以通过以下方式完成
pwclient git-am 66
由于此命令如前所述直接应用和提交,因此最后一步是将更改推送到 git 仓库,使用
git pull--rebase && git push
补丁无法应用。现在怎么办?
如果您使用了
pwclient apply
或者
pwclient get
那么您应该使用
git checkout
如果您使用了
pwclient git-am
然后补丁已提交,因此您需要
git reset HEAD@{1}
这使用 reflog 中的最后一个条目。如果您在此期间做了其他事情,请查看
git reflog
以查看哪个数字对应哪个提交。
哦,看起来在我正要应用补丁的时候,其他人已经应用了它。现在,当我尝试 git pull --rebase 时,我得到了:“看起来 git-am 正在进行中。无法变基。” 现在怎么办?
git am --abort
我发送了一个已经应用过的补丁。
目前,patchwork 不允许评论状态更改的原因(这在他们的待办事项列表中)
因此,我们可以简单地将其设置为“不适用”(因为“重复”不存在)
我的补丁被拒绝了。
您将通过电子邮件收到关于此事的提醒。您可以在 #alpine-devel IRC 频道上询问补丁被拒绝的原因。