@arathunku

Michal
Michal

One of my most used commands gets better and better - jj prpr.

When using “jj”, I’m on the squash/changes as TODO workflow:

  1. Always work on new change
  2. Squash into previous “described” change via jj sq, or better: jj absorb

This handles the local part, what about the PRs? I don’t want to repeat my commits in GitHub PR description. It’s already in my commits! This was how prpr was born.

  1. Make changes (per above workflow)
  2. jj prpr
  • first change on top of trunk()?

    • Prompt for interactive commit in jj. Title of the commit will be the title of PR
  • Confirm/skip AI code review for quick sanity check

  • Push bookmarks in the stack

  • No PR? Create PR via gh CLI

    • Automatically target previous bookmark for stack PRs
    • Create description out of commits on given PR
    • Snapshot description into local filesystem
  • PR exists?

    • Diff description with snapshot, show diff, ask for resolution
  • Link to draft PR is now in clipboard. PR description is created out of commit messages.

There’s a lot of asterisks here and little QoL fixes like handling multiple changes, stacking PRs and more. I freaking love it. At some point hopefully jj sync will be there and it will get even better.

I asked Claude to describe the full flow in ASCII:

desc - description of the PR


  ┌─────────────────────────────────────────┐
  │              jj prpr                    │
  └────────────────┬────────────────────────┘
          ┌────────┴────────┐
          ▼                 ▼
     ┌─────────┐       ┌─────────┐
     │  desc   │       │  prpr   │
     │ command │       │ command │
     └────┬────┘       └────┬────┘
          │                 │
          ▼                 ▼
    Show title &     ┌──────────────┐
    description      │  Get Title   │
          │          │ (1st line)   │
          ▼          └──────┬───────┘
        EXIT                │
                   ┌────────────────┐
                   │ Title exists?  │
                   └───────┬────────┘
                      NO   │   YES
                ┌──────────┴──────────┐
                ▼                     │
       ┌─────────────────┐            │
       │ Working changes │            │
       │    exist?       │            │
       └────────┬────────┘            │
           YES  │  NO                 │
         ┌──────┴──────┐              │
         ▼             ▼              │
    ┌─────────┐   ┌─────────┐         │
    │ Commit  │   │  EXIT   │         │
    └────┬────┘   └─────────┘         │
         │                            │
         └────────────────────────────┤
                           ┌──────────────────┐
                           │ Bookmark exists? │
                           └────────┬─────────┘
                              NO    │    YES
                           ┌────────┴────────┐
                           ▼                 │
                  ┌─────────────────┐        │
                  │ Create bookmark │        │
                  │   + git push    │        │
                  └────────┬────────┘        │
                           │                 │
                           ▼                 │
                  ┌─────────────────┐        │
                  │ AI Code review? │        │
                  │   (optional)    │        │
                  └────────┬────────┘        │
                           └────────┬────────┘
                         ┌──────────────────┐
                         │  Find PR for     │
                         │    bookmark      │
                         └────────┬─────────┘
                             NO   │   YES
                         ┌────────┴────────┐
                         ▼                 ▼
                ┌─────────────────┐  ┌─────────────────┐
                │   CREATE PR     │  │  Compare local  │
                │  (draft/ready)  │  │  vs remote desc │
                │                 │  └────────┬────────┘
                │  gh pr create   │           │
                │                 │     ┌─────┴─────┐
                └────────┬────────┘     ▼           ▼
                         │        ┌──────────┐ ┌──────────┐
                         │        │ Checksums│ │ Checksums│
                         │        │  DIFFER  │ │  MATCH   │
                         │        └────┬─────┘ └────┬─────┘
                         │             ▼            │
                         │     ┌─────────────┐      │
                         │     │ Show diff   │      │
                         │     └──────┬──────┘      │
                         │            ▼             │
                         │    ┌─────────────┐       │
                         │    │ Overwrite?  │       │
                         │    └──────┬──────┘       │
                         │      YES  │  NO          │
                         │    ┌──────┴──────┐       │
                         │    ▼             ▼       │
                         │  Update      Skip &      │
                         │  PR desc     EXIT        │
                         │    │                     │
                         └────┴──────────┬──────────┘
                              ┌──────────────────┐
                              │  Update PR desc  │
                              │   (if changed)   │
                              └────────┬─────────┘
                              ┌──────────────────┐
                              │   jj git push    │
                              │   -b bookmark    │
                              └────────┬─────────┘
                              ┌──────────────────┐
                              │  Save checksum   │
                              │  to local state  │
                              └────────┬─────────┘
                              ┌──────────────────┐
                              │ Copy new PR URL  │
                              │ to clipboard     │
                              └──────────────────┘

Just sharing it out there, little QoL commands that are fun and easy. I had the initial version working in bash in ~2024 but in 2025 I let Claude rewrite it in fish-shell, and add all the little improvements that really made it enjoyable.

Clicking will open your email client to send a reply