GitHub拉取请求组合工具。
项目描述
GitHub拉取请求组合工具。
- 代码::
- 问题::
- 许可证::
MPL v2
- 文档::
this README
安装
(推荐) 使用 pipx
pipx install paul-mclendahand
使用PyPI的pip
pip install paul-mclendahand
使用GitHub主分支的pip
pip install https://github.com/willkg/paul-mclendahand/archive/main.zip
使用克隆有开发依赖项的存储库的pip
pip install -r requirements-dev.txt
快速入门
配置pmac
pmac需要知道GitHub用户和GitHub项目。
您可以在 pyproject.toml 文件中设置配置
[tool.paul-mclendahand] github_user = "user" github_project = "project" main_branch = "git-main-branch-name"
或者您可以在 setup.cfg 文件中设置配置
[tool:paul-mclendahand] github_user=user github_project=project main_branch=git-main-branch-name
您可以使用环境变量覆盖配置变量
PMAC_GITHUB_USER=user PMAC_GITHUB_PROJECT=project PMAC_MAIN_BRANCH=git-main-branch-name
可选
您还可以使用GitHub个人访问令牌。您可以在 PMAC_GITHUB_API_TOKEN 环境变量中设置它。
例如
PMAC_GITHUB_API_TOKEN=abcdef0000000000000000000000000000000000 pmac listprs
使用pmac
在您配置了git之后,您可以使用 pmac 如此
创建一个新分支
git checkout <MAIN-BRANCH> git checkout -b update-prs
列出打开的PR
pmac listprs
将一些拉取请求合并到它中
pmac add 5100 5101 5102
使用与GitHub上相同的拉取请求编号。
在内部,pmac 使用 git am 来应用来自拉取请求的提交。如果您遇到 git am 冲突,pmac 会通知您。您可以在另一个终端中编辑文件以手动解决冲突。然后执行
git add FILE git commit git am --continue
之后,您可以继续使用 pmac。
完成时,将分支推送到GitHub并创建一个拉取请求。
pmac 可以帮助编写PR描述
pmac prmsg
pmac
Usage: pmac [OPTIONS] COMMAND [ARGS]... GitHub pull request combiner tool. pmac uses a "[tool:paul-mclendahand]" section in setup.cfg to set configuration variables. You can override these using PMAC_VARNAME environment variables. Additionally, if you want to use a GitHub personal access token, you need to provide the "PMAC_GITHUB_API_TOKEN" variable in the environment set to the token. For issues, see: https://github.com/willkg/paul-mclendahand/issues Options: --version Show the version and exit. --help Show this message and exit. Commands: add Combine specified PRs into this branch. listprs List available PRs for the project. prmsg Print out summary of commits suitable for a PR msg.
pmac listprs
Usage: pmac listprs [OPTIONS] List available PRs for the project. Options: --labels / --no-labels List labels --format [table|tab] --help Show this message and exit.
pmac add
Usage: pmac add [OPTIONS] PR... Combine specified PRs into this branch. Options: --help Show this message and exit.
pmac prmsg
Usage: pmac prmsg [OPTIONS] Print out summary of commits suitable for a PR msg. Options: --help Show this message and exit.
为什么这个项目存在呢?
主要有两个原因。
首先,GitHub不支持合并拉取请求。有关此内容的论坛帖子在这里:[链接](https://github.community/t/feature-request-combine-pull-requests/2250)
其次,dependabot(也由GitHub拥有)不支持将依赖项更新组合到单个拉取请求中。如果您有50个依赖项更新,它会创建50个拉取请求(有时更多!)我有很多项目,缺乏分组更新使得每月维护非常痛苦。有关此问题的报告:[链接](https://github.com/dependabot/dependabot-core/issues/1190)
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源分布
构建分布
paul-mclendahand-3.1.0.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0ab42ae357f14b3d44da86d6a4ddd578b08e9f6e2c03c53f59989888dfb029cb |
|
MD5 | b93d060e0abee2aa2dd651aa369be6b9 |
|
BLAKE2b-256 | e1f7d42cb1ccf920580e88351886887467742e2745660634e037a133c5e35c76 |
paul_mclendahand-3.1.0-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 27fd1f4c397bbd7ded1f133bdec37acfd32ce9dc5da1a9f929b539cd3015ea56 |
|
MD5 | 4640cb9faa729d982be12b301a7d90ec |
|
BLAKE2b-256 | fededc5b5d0c0a440a0e98e741ffbf7d959e8d8e3472e3992d1eeac9a71a5193 |