跳转到主要内容

GitHub拉取请求组合工具。

项目描述

GitHub拉取请求组合工具。

代码::

https://github.com/willkg/paul-mclendahand

问题::

https://github.com/willkg/paul-mclendahand/issues

许可证::

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 如此

  1. 创建一个新分支

    git checkout <MAIN-BRANCH>
    git checkout -b update-prs
  2. 列出打开的PR

    pmac listprs
  3. 将一些拉取请求合并到它中

    pmac add 5100 5101 5102

    使用与GitHub上相同的拉取请求编号。

    在内部,pmac 使用 git am 来应用来自拉取请求的提交。如果您遇到 git am 冲突,pmac 会通知您。您可以在另一个终端中编辑文件以手动解决冲突。然后执行

    git add FILE
    git commit
    git am --continue

    之后,您可以继续使用 pmac

  4. 完成时,将分支推送到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 (15.1 kB 查看哈希值)

上传时间

构建分布

paul_mclendahand-3.1.0-py3-none-any.whl (13.8 kB 查看哈希值)

上传时间 Python 3

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面