node-gh / gh

(DEPRECATED) GitHub CLI made with NodeJS. Use the official https://cli.github.com/ instead.
http://nodegh.io
Other
1.71k stars 217 forks source link

Add support for merging PRs remotely without pulling down commits locally #467

Open gamerson opened 7 years ago

gamerson commented 7 years ago

I would like to see a new feature that would let you use gh to perform a merge of a PR remotely, by that I mean just like clicking actions in this UI below:

screen shot 2017-01-25 at 8 16 17 pm

My idea would be to add a new flag that is -g or --github that would signal we are executing actions that happen remotely using github api, no commits are downloaded locally.

So in the screenshot you see we actually have 3 actions that could be performed. Here is how we could map them to gh

Just performing the default merge operation in the UI we could do that like this:

$ gh pr 112 -g --merge

Then we could also check for other args like '--merge' or '--rebase'.

So if i wanted 'gh' to perform a 'merge' or PR 112 on github.com directly, we would say

$ gh pr 112 -g --merge

If I wanted to do a rebase and merge on github.com directly I could do

$ gh pr 112 -g --merge --rebase

If I wanted to do a 'squash and merge' it would be

$ gh pr 112 -g --merge --squash
protoEvangelion commented 5 years ago

@gamerson I was recently pondering why we currently have a gh pr --fetch 1 --merge if all it does is merge locally.

After all this really isn't a git tool but a GitHub tool ahah.

I would like to leverage those existing commands for --merge, --rebase and repurpose them to merge and rebase remotely.

gamerson commented 5 years ago

Actually I've never used those commands :) --fetch --merge for the pr command. Also, does github even do a remote rebase? I thought that feature was removed a long time ago.

On Sat, Jan 5, 2019 at 3:57 PM Ryan Garant notifications@github.com wrote:

@gamerson https://github.com/gamerson I was recently pondering why we currently have a gh pr --fetch 1 --merge if all it does is merge locally.

After all this really isn't a git tool but a GitHub tool ahah.

I would like to leverage those existing commands for --merge, --rebase and repurpose them to merge and rebase remotely.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/node-gh/gh/issues/467#issuecomment-451694169, or mute the thread https://github.com/notifications/unsubscribe-auth/AAkVFdHbZV1V_62w_GlX2cplefBTXL9qks5vAR-tgaJpZM4LuPCg .

-- Greg Amerson Liferay Developer Tools Liferay, Inc. www.liferay.com

protoEvangelion commented 5 years ago

It looks like you can squash, merge, or rebase remotely with this octokit method: https://octokit.github.io/rest.js/#api-Pulls-merge

gamerson commented 5 years ago

Oh i see, rebase for the PR. I was thinking rebase (fast-forward) for a remote fork which I don't think exists anymore.

On Mon, Jan 7, 2019 at 10:01 AM Ryan Garant notifications@github.com wrote:

It looks like you can squash, merge, or rebase remotely with this octokit method: https://octokit.github.io/rest.js/#api-Pulls-merge

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/node-gh/gh/issues/467#issuecomment-451983628, or mute the thread https://github.com/notifications/unsubscribe-auth/AAkVFbbVNB-nfkhzYT8HDqjc2airED9nks5vA29qgaJpZM4LuPCg .

-- Greg Amerson Liferay Developer Tools Liferay, Inc. www.liferay.com