Skip to content

Add a way to push all branches that have a remote branch #191

@Gelio

Description

@Gelio

Hey! I'm opening an issue to capture the functionality discussed in https://github.com/epage/git-stack/discussions/189#discussioncomment-2276150 that would allow git stack --push to push all branches that already have a corresponding remote branch, even if they are not considered ready.

That would help when working with stacked PRs, since I would be able to push all branches on my branches stack with a single command. At the moment, only the first branch from the stack is pushed, since that is the only one that is considered ready. Other branches are not ready, because their parent branch (the previous branch on the stack) is not merged into the protected branch yet.

To make this work, we would probably need another configuration option/flag. If enabled, git stack --push would override the existing ready check and instead treat a branch as ready if:

  1. it has no WIP commits (probably)
  2. there is a remote branch with the same name

Question to answer: for the 2nd condition, what if the local branch is named differently than the remote tracking branch? This could happen if the user manually set the remote tracking branch.
git stack --push would push to the branch under the same name anyway, ignoring the remote-tracking branch, so it seems like a tangential issue that can be handled separately. A quick note is that I believe we could use the @{push} revision to push to the remote branch according to the user's push.default and other config options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions