A CLI for stacked diffs in Perforce, bringing a Git-like stacked change workflow (e.g., Gerrit) to P4. Watch the 90s demo by me here: https://youtu.be/MKpt4zY4ptU
$ pipx install p4-stackCreates a new stacked changelist.
$ p4-stack create <PARENT_CL>$ p4-stack create 220
Created new changelist: 222
Run 'p4 change 222' to add files and edit the description.Lists all your pending stacks in a tree view.
$ p4-stack listFetching pending changes for @khoa...
Current Stacks for khoa:
└── ► 220 (pending)
├── ► 221 (pending)
└── ► 222 (pending)
Rebases an entire stack, starting from a base CL. It performs an in-memory, 3-way merge for every child CL, applying their changes on top of the new parent. If conflict, p4-stack prompts you to resolve conflict in editor just like git.
Update command uses diff3 -m -E under the hood. This appears better than p4's default merge, but weaker and slower than git's ort merge strategy.
$ p4-stack update <BASE_CL_TO_EDIT>$ p4-stack update 214
CL 215 successfully rebased
CL 216 successfully rebased
In-memory rebase successful. Committing changes to Perforce...
Stack update complete for CL 214