Stacked pull requests for jj on Forgejo, with no branches to manage.
Ferry works, but the source isn't public yet.
main is your commit, and jj sees your change land instead of a copy of it.ferry upload # push the stack; create or update one PR per change
ferry status # show the stack with each PR's state
ferry land # merge ready changes, bottom-upHighlights at a Glance#
One PR per Change
No Branches
Lands Bottom-Up, Fast-Forward Only
land merges the bottom change once it has its approvals and passing CI, and --all keeps going up the stack. The PRs above shrink by themselves; nothing is re-pushed.Stack Comments for Reviewers
Status at a Glance
status shows the stack like jj log, with each PR’s state: needs upload or up to date, approvals, CI. It warns when your trunk is behind and finds PRs whose change is gone.No State of Its Own
Why Ferry?#
Branch-based tools for stacked PRs have to translate jj’s model (stable changes, cheap rewrites) into the forge’s model (named branches, base and head pairs). Most of their complexity is in that translation: inventing bookmark names, retargeting PR bases, and reconciling the stack after a squash merge gives a commit a new identity.
Ferry avoids the translation instead of managing it. One PR per change, keyed by the change ID. Every PR targets main, so there are no bases to retarget. And landing keeps the commit, so jj never sees a stranger’s copy of your change on main.
How It Works#
1. Upload#
Ferry checks the stack first: every change needs a description, the stack must be linear, and no change may be empty, conflicted, or divergent. Then it pushes each change bottom-up as an AGit pull request with topic ferry/<change ID>, skipping changes whose PR already has the commit. --draft marks the PRs as work in progress.
2. Review#
Every PR targets main, so its diff includes the changes below it; the stack comment points reviewers at the one commit that’s theirs.
3. Land#
land merges the bottom change if its PR is ready: up to date, not a draft, approved as the branch requires, and CI green. Otherwise it says why and stops. If main has moved, it rebases the stack, uploads it again, and lets CI run before merging. If anything changes between its checks and the merge, it starts over.
Configuration#
Ferry has no config file. Its settings live in jj’s config under ferry., per repository: the remote, the target branch, the Forgejo API URL, and the environment variable holding the API token. To run it as jj ferry, add an alias in jj’s user config.
Limitations#
- Forgejo only. AGit flow is specific to Forgejo (and Gitea, untested).
- Linear stacks, single author. A Forgejo AGit PR belongs to whoever pushed it.
- No interdiffs between PR revisions; Forgejo can’t show them for AGit PRs.
- Signing: commits signed by jj as it creates them work;
git.sign-on-pushdoesn’t yet.
Technology Stack#
- Language: Go 1.27, buildable with
go buildor Bazel - jj: read through JSON templates, never human-readable output (tested with jj 0.46)
- Forgejo: AGit flow over git push, plus the Forgejo API for PRs, comments and merges (tested with v16)