Skip to content

abustany/jjpr

Repository files navigation

jjpr

jjpr is a small command line tool for creating and updating GitHub pull requests from Jujutsu changes.

It finds the jj change you want to publish, creates or reuses a local bookmark, pushes it, and opens a GitHub pull request with gh pr create. When the change is already linked to an open pull request, jjpr pushes the updated bookmark instead of creating a new PR.

jjpr supports stacked PRs: it walks the ancestors of the PR head and stops either at the first commit that is linked to an existing PR or at the first commit which is in the default branch.

Maintenance status: I use jjpr daily and it works for me.

Usage

# Find the nearest non-empty first-parent ancestor and create/update a PR
jjpr push

# Optionally specify the PR description/labels
jjpr push -m 'Add login' --label feature abcdef # where abcdef is a jj change id


# Push local bookmarks and update base branches for open GitHub pull requests,
# useful after rebasing things so PRs stay correctly stacked:
jjpr sync # add --dry-run if you want to see first what would get pushed

Installation

With nix

Run directly from the flake:

nix run github:abustany/jjpr -- push

Install into your user profile:

nix profile install github:abustany/jjpr

For local development, run commands through the repository's dev shell:

nix develop -c cargo fmt
nix develop -c cargo check
nix develop -c cargo clippy

From source

A cargo build should do the trick.

Usage as a jj subcommand

Print the jj alias configuration for running jj pr:

jjpr setup # only prints instructions, does not touch any files

About

Simple CLI to sync Github PRs with jj changes

Topics

Resources

License

Stars

Watchers

Forks

Contributors