Simple PR stacking.
stack is a tool that sits on top of native git for tracking and propagating changes up PR stacks. It acts as an alternative to other stacking tools by focusing on minimizing changes made to your workflow.
(Other tools like
git-townorgraphiteoffer a much more mature and feature-rich toolset for PR stacking. Usestackif you want an easy and quick PR stacking solution.)
Stacking parallelizes your development and code review workstreams, so you don't need to wait for your previous changes to be merged before building on top of them. -
stacking.dev
If you work on a team, you're probably doing some form of PR stacking anyways! Here's a simple example with one stack.
Suppose you have a feature broken down into 3 branches:
- database-change
- backend-change
- frontend-change
You can easily manage this with stack!
# First, initialize
stack init
# Create your stack
stack checkout -c feature
# Add your first branch
stack push database-change
# Add the next
stack push backend-changeLet's say that you need to update something on the bottom of your stack.
# Propagate changes up the stack
stack rebase --onto-mainThis pulls latest changes on main, and rebases everything like so:
main ----> database-change ----> backend-change
This becomes especially useful when you have a stack of several PRs, where propagating changes is very tedious.
Some other useful commands:
# Managing stacks
stack checkout -c stack_a # create
stack checkout stack_b # move to other stack
stack delete stack_to_delete
stack list # show stacks
stack status # show current stack
# Editing stacks
stack insert in-between-change --index 1
stack remove stupid-change --index 4
stack pop # removes last
stack shift # removes first
stack pushFor Mac:
curl -L -o stack https://github.com/connortbot/stack/releases/latest/download/stack
chmod +x stack
sudo mv stack /usr/local/bin/stackFeel free to open an issue or a PR!
Bug fixes are very welcome! To keep stack minimal, the only large change planned for now is adding labels to branches in a stack.