lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

[WIP] pkg/gui: Only suggest remote branches when creating a PR against a selected branch

Open moha-gh opened this issue 3 years ago • 5 comments

When creating a PR against a selected branch (via O = "create pull request options"), the suggestion area is now populated with all remote branches - instead of all local ones. After all, creating a PR against a branch that doesn't exist on the remote won't work.

To support "PR is not filed against 'origin' remote" use cases (e.g. when contributing via a fork that is 'origin' to a GitHub project that is 'upstream'), branches of all remotes (and not only 'origin') are listed. This also simplifies the implementation.

Fixes #1826.

moha-gh avatar Apr 22 '22 05:04 moha-gh

One thing I wonder is, would it make more sense to first choose a remote and then choose the branch, rather than select from branches across all remotes?

Definitely. I'm pretty busy right now, but hope to find some time in the next one or two weeks to incorporate the feedback and update the PR :)

moha-gh avatar May 25 '22 12:05 moha-gh

One thing I wonder is, would it make more sense to first choose a remote and then choose the branch, rather than select from branches across all remotes?

Definitely. I'm pretty busy right now, but hope to find some time in the next one or two weeks to incorporate the feedback and update the PR :)

@jesseduffield - That took a bit longer than expected :( I've changed the implementation to match the discussed approach (Select origin first, branch from that origin second). If there is only a single remote, the first step is skipped automatically. Could you have another look at the changes to see whether that's going in the right direction? If so, I'd clean up the PR for a final review.

moha-gh avatar Jun 18 '22 15:06 moha-gh

Sorry for the late re-review @moha-gh , I'm happy with the direction you've taken. Let me know when it's ready for another pass

jesseduffield avatar Sep 24 '22 06:09 jesseduffield

@jesseduffield : Thanks, no worries. I'll try to get the PR rebased and cleaned up soon'ish :)

moha-gh avatar Sep 27 '22 11:09 moha-gh

Uffizzi Ephemeral Environment deployment-19547

:cloud: https://app.uffizzi.com/github.com/jesseduffield/lazygit/pull/1889

:page_facing_up: View Application Logs etc.

What is Uffizzi? Learn more!

github-actions[bot] avatar Mar 20 '23 09:03 github-actions[bot]