Philosophy
Understanding PrStack's approach to PR stack management
Philosophy: Freedom from Fixed Stacks
Unlike traditional PR stack tools like Git Machete and Graphite, PrStack doesn't require you to pre-define or maintain a fixed stack structure. Instead, it dynamically discovers your current stack by tracing from your current position back to the trunk branch.
How PrStack Differs
Git Machete
Git Machete requires you to explicitly define your branch relationships in a .git/machete file before you can manage your stack. This works well for planned, linear development but becomes cumbersome when you need to pivot, explore alternatives, or work on multiple features simultaneously. Every time your branching strategy changes, you must manually update the machete file to reflect the new structure.
Graphite
Graphite takes a more opinionated approach with explicit stack management commands. While powerful, it enforces a structured workflow where you must think about stack operations upfront. You create stacks, manage them explicitly, and follow Graphite's mental model of how development should flow. This can feel restrictive when inspiration strikes and you want to branch off in a new direction.
PrStack's Approach
PrStack embraces the chaos of real development. Instead of forcing you to pre-plan your branching strategy, it dynamically discovers your current stack by tracing from wherever you are back to the trunk. Want to branch off your feature branch to try a different approach? Just do it. Need to go back and create a hotfix branch three commits ago? No problem. PrStack adapts to whatever shape your development tree has taken, making stack management feel effortless rather than burdensome.
How It Works
PrStack embraces a branch-anywhere philosophy:
- Work naturally: Create branches wherever you need them in your development tree
- Dynamic discovery: Run
prstack syncfrom any branch to automatically discover the stack from your current position to trunk - Adaptive management: Switch to any other branch and run sync again - PrStack adapts to the new context
- Automatic PR creation: Missing PRs are identified and can be created with a single prompt
Example Workflow
# Branch off main for feature A
jj new -m "Feature A"
jj bookmark create feature-a
# Branch off feature-a for feature B
jj new -m "Feature B"
jj bookmark create feature-b
# Branch off feature-b for hotfix
jj new -m "Critical hotfix"
jj bookmark create hotfix
# From hotfix: sync discovers hotfix → feature-b → feature-a → main
prstack sync
# Switch to feature-a and branch off for feature C
jj edit feature-a
jj new -m "Feature C"
jj bookmark create feature-c
# From feature-c: sync discovers feature-c → feature-a → main
prstack sync
VCS Agnostic Design
PrStack supports multiple version control systems:
- Jujutsu: First-class support for the branchless VCS
- Git: Traditional Git workflow support (coming soon)
Since Jujutsu is branchless by design, PrStack continues this philosophy by constantly adapting to the current shape of your development tree, rather than forcing you into rigid branch structures.