git-pull-request
git-pull-request copied to clipboard
[feature request] Command to push to master and close pull request
Once the pull request is reviewed and approved, our workflow is that the author should merge it. This can be done easily through GitHub UI (there is a "Squash and merge" button).
There are a couple of problems with this:
- We can't do it through command line.
- After it's done, the local branch becomes useless. Sometimes people will accidentally continue working in there, thinking it's nw at
origin/masterwhich is not the case.
Ideally, we want a command git pull-request --merge which will:
- Merge into
origin/master. - Close pull request.
- Delete local branch.
What are your thoughts?
Why don't you use https://mergify.io to do that directly from GitHub?
I still want a command line tool. Does https://mergify.io offer a command line tool to do that?
No. Why do you want a command-line tool when you can make things automatic? 🤔
When a pull request is approved, there are still some final comments left.
It is expected of the author to fix the final comments and merge it themselves (update, push the button in GitHub UI, remember to delete the local branch).
So I am interested in automating the last part.
At least this is our workflow. It would slow us down if we do another round of "request changes" for the final comments which are usually nits.
Thanks for your reply!
...By the way, this tool saves us a ton of time and we would be OK to pay for it per user per month as long as it's not too much. Perhaps you can offer it as part of your Mergify package.
Thank you, that's nice! Feel free to subscribe to Mergify anyhow, that'll support us and this tool.
I think there are 2 solutions to your issues here:
- automatic merge: that really should be Mergify job IMHO. You can do that with a rule like:
- name: automatic merge
conditions:
- label=ready-to-merge
- status-success=your ci system
- "#approved-reviews-by>=1"
actions:
merge:
method: squash
By using a label, you make sure the author has set this label when it's ready to be merged and that the CI works, etc. You can define finer-grained rules of course, but there's no need for doing anything "local" that way.
- Cleaning merged pull requests.
It's actually something I'd love to have too. That could be the job git-pull-request indeed. What'd be useful is to be able to delete local branches when their corresponding PR are merged, or even display their status. That shouldn't be too hard to implement I imagine. 🤔
It's actually something I'd love to have too. That could be the job git-pull-request indeed. What'd be useful is to be able to delete local branches when their corresponding PR are merged, or even display their status. That shouldn't be too hard to implement I imagine. 🤔
Yes, need exactly this. Sometimes developers will continue working on the local branch by accident, and make a mess locally. Maybe then a feature for git-pull-request to mark a PR with a label you suggested and delete the local branch. Then Mergify can take over.