Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a git-stack command #6

Open
camh- opened this issue Apr 5, 2020 · 0 comments
Open

Create a git-stack command #6

camh- opened this issue Apr 5, 2020 · 0 comments

Comments

@camh-
Copy link
Member

camh- commented Apr 5, 2020

Sometimes you have multiple PRs in flight at once where one PR depends on another. You can manage this by setting the base branch of a PR to the branch of the first PR, but you need to remember to set that back to master after the first PR is merged. Sometimes you even have a third PR stacked.

I call these "stacked branches" because the underlying model in git is one branch on another on another. PRs are just associated with those branches.

If the first PR is changed in a destructive way (editing commits via --amend, or git rebase or other similar commands), the stack of branches on it also needs to be rebased.

When you create a second PR on a branch that already has an open PR, the second one needs to have a base branch set to the branch of the first.

When you merge a PR to master, you need to rebase the other branches and set the base branch of the lowest remaining PR in the stack to master.

These things can all be scripted to automate them. Perhaps give this some thought to come up with a cohesive model and set of standard operations, and build it all into git-stack.

This may need hub pr (hub pull-request) to be aware of stacks so when you create a PR it sets the base branch properly.

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

No branches or pull requests

1 participant