Skip to content

Commit

Permalink
unified use of 创建拉取请求 rather than English
Browse files Browse the repository at this point in the history
  • Loading branch information
QGrain committed Jul 13, 2024
1 parent 4358afc commit 7d1b970
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions sources/syzkaller/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ link: https://github.com/google/syzkaller/blob/master/docs/contributing.md

如果你想为该项目做出贡献,请按照下面的[指南](contributing.md#guidelines)发送拉取请求。

如果这是你第一次向 syzkaller 提交拉取请求,你需要[签署 Google CLA](https://cla.developers.google.com/)
如果这是你第一次向 syzkaller 提交拉取请求,你需要[签署 Google CLA](https://cla.developers.google.com/)
并在第一次提交时将自己添加到 [AUTHORS](/AUTHORS)/[CONTRIBUTORS](/CONTRIBUTORS) 文件中。

## 工作内容
Expand All @@ -32,7 +32,7 @@ link: https://github.com/google/syzkaller/blob/master/docs/contributing.md

所有可以合理测试的内容都应进行测试。

为其他用户使用新功能提供足够的文档
为了其他用户能方便地使用新特性,请提供足够的文档说明

保持代码、测试、注释、文档、日志/错误信息的风格与现有风格一致。

Expand All @@ -49,14 +49,12 @@ dir/path: 单行描述
您要解决的问题以及如何解决问题。
```

`dir/path` is a relative path to the main dir this commit changes
(look at examples in the [commit history](https://github.com/google/syzkaller/commits/master)).
If several packages/dirs are significantly affected, then the following format is allowed:是本次提交更改的主目录的相对路径。(参见 [commit history](https://github.com/google/syzkaller/commits/master) 中的示例)。如果多个软件包/目录受到重大影响,则允许使用以下格式:
`dir/path` 是本次提交更改的主目录的相对路径。(参见 [commit history](https://github.com/google/syzkaller/commits/master) 中的示例)。如果多个软件包/目录发生重大改动,则允许使用以下格式:
```
dir1/path1, dir2/path2: 单行描述
```
不过,如果目录仅有细微改动,则不应包括在内。
对于普遍变化,可以使用以下格式:
对于普遍的更改,可以使用以下格式:
```
all: 单行描述
```
Expand All @@ -74,12 +72,6 @@ all: 单行描述
- 如果您的提交修复了一个议题,请在提交信息中加入 `Fixes #NNN` 行(其中 `NNN` 是议题编号)。这将自动关闭议题。如果您需要提及议题,请添加 `Update #NNN`
- 对于系统调用描述,`*.const` 文件应该与 `*.txt` 的更改在同一提交中签入。

- If your commit fixes an issue, please include `Fixes #NNN` line into commit message
(where `NNN` is the issue number). This will auto-close the issue. If you need to mention
an issue without closing it, add `Update #NNN`.
- For syscall descriptions `*.const` files are checked-in with the `*.txt` changes
in the same commit.

### 拉取请求


Expand Down Expand Up @@ -111,13 +103,13 @@ in the same commit.
- 将更改提交到本地。为此,你需要对所有更改的文件运行 `git add`,例如 `git add sys/linux/sys.txt`。你可以运行 `git status` 查看有哪些文件被修改/创建。当所有文件都添加完毕后(`git status` 显示 `Changes not staged for commit` 部分没有文件,并且 `Untracked files` 部分没有相关文件),运行 `git commit` 并在你的编辑器中输入提交描述。
- 在本地运行测试(`make install_prerequisites`,然后执行 `make presubmit`)。
- 使用 `git push my-origin my-branch` 将提交推送到 github 上的分叉。
- 导航至 [github.com/google/syzkaller](https://github.com/google/syzkaller),你会看到绿色的 `Compare & pull request` 按钮,按下它。然后按 `创建拉取请求`。现在你的拉取请求应该会出现在[拉取请求页面](https://github.com/google/syzkaller/pulls)上。
- 如果你由于任何原因看不到 `创建拉取请求` 按钮,你可以手动创建拉取请求。为此,请导航至 [pull requests page](https://github.com/google/syzkaller/pulls),按下 `New pull request`,然后按下 `compare across forks` 并选择 `google/syzkaller`/`master` 作为基础,选择 `YOUR_GITHUB_USERNAME/syzkaller`/`my-branch` 作为比较,然后按下 `Create pull request`
- 导航至 [github.com/google/syzkaller](https://github.com/google/syzkaller),你会看到绿色的 `比较 & 拉取请求` 按钮,按下它。然后按 `创建拉取请求`。现在你的拉取请求应该会出现在[拉取请求页面](https://github.com/google/syzkaller/pulls)上。
- 如果你由于任何原因看不到 `创建拉取请求` 按钮,你可以手动创建拉取请求。为此,请导航至[拉取请求页面](https://github.com/google/syzkaller/pulls),按下 `新的拉取请求`,然后按下 `横叉比较` 并选择 `google/syzkaller`/`master` 作为基础,选择 `YOUR_GITHUB_USERNAME/syzkaller`/`my-branch` 作为比较,然后按下 `创建拉取请求`
- 如果在创建了拉取请求后,你决定对 `my-branch` 中的提交进行变基(例如,将它们变基到更新的 master 上),则需要执行一次强制推送:`git push -f my-origin my-branch`

### 使用 syz-env

开发 syzkaller 需要安装大量工具(Go 工具链、C/C++ 交叉编译器、golangci-lint 等)。安装所有这些工具可能会很麻烦,例如由于软件包损坏/缺失。[syz-env](/tools/syz-env) 提供了一个基于 Docker 容器的密封开发环境。如果尚未安装 Docker,请参阅[文档](https://docs.docker.com/engine/install)特别是关于启用 [sudo-less](https://docs.docker.com/engine/install/linux-postinstall) 的 Docker(Googlers 参见 go/docker)。
开发 syzkaller 需要安装大量工具(Go 工具链、C/C++ 交叉编译器、golangci-lint 等)。安装所有这些工具可能会很麻烦,例如由于软件包损坏/缺失。[syz-env](/tools/syz-env) 提供了一个基于 Docker 容器的密封开发环境。如果尚未安装 Docker,请参阅[文档](https://docs.docker.com/engine/install)特别是关于启用 [sudo-less](https://docs.docker.com/engine/install/linux-postinstall) 的 Docker(Googlers 参见 go/docker)。

建议为 `syz-env` 脚本创建别名:
```
Expand All @@ -133,7 +125,7 @@ syz-env make extract SOURCEDIR=$(readlink -f ~/linux)
```
syz-env go test -short ./pkg/csource
```
或者,你也可以只使用 `syz-env` 来在容器内运行 shell 并四处看看
或者,你也可以只使用 `syz-env` 来在容器内运行 shell 并进行查看
要将 `syz-env` 容器更新到最新版本,请执行以下操作:
Expand Down

0 comments on commit 7d1b970

Please sign in to comment.