diff --git a/PR/2023/docs/How-to-PR.md b/PR/2023/docs/How-to-PR.md new file mode 100644 index 0000000000000000000000000000000000000000..c69d9202ce80506a45fae7ac7df4b210a0888cf1 --- /dev/null +++ b/PR/2023/docs/How-to-PR.md @@ -0,0 +1,22 @@ +# How to submit a PR + + + +![PR的流程](./images/pr.png "PR的流程") + +Pull Request,在开源社区也常常被简称为PR,是自己修改源代码后,请求上游仓库采纳该修改时采取的一种行为。如上图,提交PR的流程简述如下: + +1. 贡献者从社区官方代码库中fork一份代码到自己的库; +2. 将自己社区库中的代码clone到本地开发环境上; +3. 修改代码,解决bug或开发新feature; +4. 提交修改; +5. 将本地提交push到自己的社区库中; +6. 向社区官方代码库提交PR; +7. 待maintainer review后合入社区官方代码库。 + +以下是一些参考文档的链接: + +- [openEuler开源社区贡献攻略](https://www.openeuler.org/zh/community/contribution/) +- [如何参与openEuler社区](https://gitee.com/openeuler/community/tree/master/zh/contributors) +- [PR提交指南](https://gitee.com/openeuler/community/blob/master/zh/contributors/pull-request.md) +- [Gitee工作流说明](https://gitee.com/openeuler/community/blob/master/zh/contributors/Gitee-workflow.md) \ No newline at end of file diff --git a/PR/2023/docs/images/macos-key.png b/PR/2023/docs/images/macos-key.png new file mode 100644 index 0000000000000000000000000000000000000000..2a4f999b3a8c79267d02591cb8ba3c6664d58a53 Binary files /dev/null and b/PR/2023/docs/images/macos-key.png differ diff --git a/PR/2023/docs/images/pr.png b/PR/2023/docs/images/pr.png new file mode 100644 index 0000000000000000000000000000000000000000..501ffbd1d125676afff556f174c3d51dc2b7fbee Binary files /dev/null and b/PR/2023/docs/images/pr.png differ diff --git a/PR/2023/docs/images/windows-key.png b/PR/2023/docs/images/windows-key.png new file mode 100644 index 0000000000000000000000000000000000000000..797b9a38386d98e70db41049f50ee133ba7e1b11 Binary files /dev/null and b/PR/2023/docs/images/windows-key.png differ diff --git a/PR/2023/src/main.c b/PR/2023/src/main.c index 2c93e1350a966f9f58f28c0eb6e84c26259e33bc..2737e056aca8f21c6119103bceec1d220115cea4 100644 --- a/PR/2023/src/main.c +++ b/PR/2023/src/main.c @@ -1,11 +1,21 @@ +/********* + * main.c + * + * This program runs on Linux and UNIX-like macOS. + * + * How to compile and run the program: + * $ gcc this-file + * $ ./a.out + * + *********/ + #include #include #include #include int main() { - // 将文件名设置成Gitee ID的文件将置于该源代码文件 - // 所生成可执行文件的上级目录。 + // 其名称设置成Gitee-ID的文件将置于该源代码文件的上级目录 DIR *dir = opendir(".."); if (dir == NULL) { perror("Unable to open parent directory"); @@ -15,13 +25,11 @@ int main() { struct dirent *entry; while ((entry = readdir(dir)) != NULL) { - // 1. 只处理常规文件(排除目录、软链接等)。 - // 2. 排除“.”和“..”目录项,并排除带有扩展名的文件 - // (其中包含“.”)。根据Gitee ID命名规则,其中 - // 不可能包含“.”。 - // 3. Gitee ID命名规则:只允许字母、数字或者下划线 - // (_)、中划线(-),至少 2 个字符,必须 - // 以字母开头,不能以特殊字符结尾。 + // 0. Gitee-ID命名规则:只允许字母、数字或者下划线(_)、 + // 中划线(-),至少 2 个字符,必须以字母开头, + // 不能以特殊字符结尾。 + // 1. 本程序只处理常规文件(排除目录、软链接等)。 + // 2. 本程序会排除“.”和“..”目录项,也会排除带有扩展名的文件。 if (entry->d_type == DT_REG && strchr(entry->d_name, '.') == NULL) { printf("Greetings from %s!\n", entry->d_name);