docs/new-pr.md
Use this when you want to create and iterate on a PR with Flow while keeping jj state clean.
Create a PR from a queued commit/bookmark, avoid accidental extra commits, and keep PR metadata easy to edit.
# 1) Start from repo root
cd ~/code/org/linsa/linsa
# 2) Sync trunk
f sync
# 3) Ensure jj is initialized (first time in repo)
f jj init
# 4) Create/track a feature bookmark (once per feature)
f jj bookmark create <bookmark-name> --track
# 5) Make changes, run checks, then queue commit (no push)
f commit --queue -m "<what changed>"
# 6) Create PR from queued commit (no new commit)
f pr --no-commit --base main
# 7) Edit PR title/body locally and auto-sync on save
f pr open edit
Important formatting rule:
\n.f pr open edit) or gh pr edit --body-file <file>.# After additional changes
f commit --queue -m "<follow-up>"
f pr --no-commit --base main
f pr open edit
Paste this in requests when you want PR creation handled consistently:
Use Flow + jj PR workflow in this repo:
1. Run `f sync`.
2. Ensure jj is initialized (`f jj init`) and bookmark is tracked.
3. Commit with `f commit --queue` (no direct push).
4. Create/update PR with `f pr --no-commit --base main`.
5. Open PR editor with `f pr open edit` and sync title/body.
6. Report exact commands run and the final PR URL.
Constraints:
- Keep unrelated local changes untouched.
- Do not use destructive git commands.
- Do not create duplicate commits when creating PRs.
f pr without --no-commit will stage/commit before creating the PR.f commit --queue is the safest default for a review-first loop.main, always pass --base <branch>.f jj sync --bookmark <bookmark-name> to fetch/rebase/push bookmark state.