Skip to main content

Tool for combining GitHub pull requests.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Tool for combining GitHub pull requests.

Code:

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

Issues:

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

License:

MPL v2

Documentation:

this README

Status

2024-12-19: No longer maintained.

Install

(Recommended) With uv:

uv tool install paul-mclendahand

With pip from PyPI:

pip install paul-mclendahand

Quick start

Configure pmac

pmac needs to know the GitHub user and GitHub project.

You can set configuration in the pyproject.toml file:

[tool.paul-mclendahand]
github_user = "user"
github_project = "project"
main_branch = "git-main-branch-name"

Or you can set configuration in the setup.cfg file:

[tool:paul-mclendahand]
github_user=user
github_project=project
main_branch=git-main-branch-name

You can override the configuration variables with environment variables:

PMAC_GITHUB_USER=user
PMAC_GITHUB_PROJECT=project
PMAC_MAIN_BRANCH=git-main-branch-name

Optional

You can also use a GitHub personal access token. You set it in the PMAC_GITHUB_API_TOKEN environment variable.

For example:

PMAC_GITHUB_API_TOKEN=abcdef0000000000000000000000000000000000 pmac listprs

Configure git

When cherry-picking commits, pmac sometimes causes Git to push you to resolve the same issue multiple times. For this reason, we encourage you to set rerere.enabled to true.

Globally:

$ git config --global rerere.enabled true

Local to the git repository you’re in:

$ git config rerere.enabled true

git will keep track of resolutions and re-apply them.

Using pmac

After you’ve configured git, then you can use pmac like this:

  1. Create a new branch:

    git checkout <MAIN-BRANCH>
    git checkout -b update-prs
  2. List open PRs:

    pmac listprs
  3. Combine some pull requests into it:

    pmac add 5100 5101 5102

    Use the same pull requests numbers as on GitHub.

    Internally, pmac uses git am to apply commits from pull requests. If you hit a git am conflict, pmac will tell you. You can edit the file in another terminal to manually resolve the conflict. Then do:

    git add FILE
    git commit
    git am --continue

    After that, you can continue with pmac.

  4. When you’re done, push the branch to GitHub and create a pull request.

    pmac can help with the PR description:

    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.

Why does this project exist?

Two main reasons.

First, GitHub doesn’t support combining pull requests. There is a forum post about it here: https://github.community/t/feature-request-combine-pull-requests/2250

Second, dependabot (also owned by GitHub) doesn’t support grouping dependency updates into a single pull request. If you have 50 dependency updates, it creates 50 pull requests (sometimes more!). I have a lot of projects and lack of grouping updates makes monthly maintenance miserable. There’s an issue for this: https://github.com/dependabot/dependabot-core/issues/1190

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paul_mclendahand-3.2.1.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paul_mclendahand-3.2.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file paul_mclendahand-3.2.1.tar.gz.

File metadata

  • Download URL: paul_mclendahand-3.2.1.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.0

File hashes

Hashes for paul_mclendahand-3.2.1.tar.gz
Algorithm Hash digest
SHA256 17396fd754639a4c2ac723af23001da3dde930a55ab62226ddd469d83812b0e0
MD5 8738a68f39062a42628daa16403b57cc
BLAKE2b-256 335be706a7b4a8d9a03d2bc0fff049621bd05ff1c9fd9809759cc365d33cca40

See more details on using hashes here.

File details

Details for the file paul_mclendahand-3.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for paul_mclendahand-3.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 acd891f928f82f36de853ecf942825293ca7e49927f2f22870c293e0cf6a74a4
MD5 fd7ec00b0ba85525b1f38aca6aefbbb4
BLAKE2b-256 3ade8c4fb5c4a62c0df04ead84f013f7f90ffb008e3eaed74fe943e315ed7d82

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page