Skip to content

[WIP] Add land-pr command#76

Draft
keith wants to merge 2 commits intomainfrom
ks/stacks
Draft

[WIP] Add land-pr command#76
keith wants to merge 2 commits intomainfrom
ks/stacks

Conversation

@keith
Copy link
Owner

@keith keith commented Feb 2, 2026

This command makes working with dependent PR stacks a bit easier. When you use it to merge a PR, it squash merges it, pulls, and rebases all the PRs (that are mirrored as local commits) that depended on the landed PR (recursively). Since github automatically changes the base of the dependent PRs, this is all that is needed to drop the merged commit from their diff after github does that.

@keith
Copy link
Owner Author

keith commented Feb 2, 2026

the first version of this used git notes to store the URLs / dependencies between commits. This had too many issues unfortunately. As the commits changed with rebases the notes could potentially be lost (either way setting dependent), it also doesn't easily allow you to cherry pick a commit into another worktree (from a PR directly) and use the related commands.

the second version of this uses the gh cli to find things based on the known branch names instead. currently this only rebases prs based on commits that are also in the local worktree, we could use the gh cli's update-branch command to rebase ones that aren't also local, I'm not sure if that's a good idea or not.

this command combined with a submitpr wrapper that automatically manages --onto when submitting a whole stack is really all we need i think to make this workflow pretty nice. the biggest difference to what we would end up with here vs stack-pr oriented tools would be the default would still be unrelated prs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant