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

Close pull-requests #1151

Closed
Brett55 opened this issue Mar 28, 2016 · 11 comments
Closed

Close pull-requests #1151

Brett55 opened this issue Mar 28, 2016 · 11 comments

Comments

@Brett55
Copy link

Brett55 commented Mar 28, 2016

Is there a way to close pull requests via hub?

@mislav
Copy link
Owner

mislav commented Mar 29, 2016

No, not right now unfortunately. We're working on improving the hub issue set of commands #1099 and my plan is to follow it up with a similar set of commands to manipulate (and close/reopen) PRs.

@nicholasruunu
Copy link

nicholasruunu commented Nov 28, 2017

Would be awesome to have this to be able to make a github-flow utility similar to Hubflow

@michaellady
Copy link

hey @mislav how difficult would this be for a new contributor?

@mislav
Copy link
Owner

mislav commented Aug 6, 2018

@michaellady It shouldn't be too hard if you're willing to study the GitHub API a bit and also how existing HTTP operations are implemented in github/client.go. But what are you planning to implement exactly—closing of PRs? How would that command be used on the command-line? Would one also be able to close issues? It's good to define things in detail before you proceed with trying out an implementation.

@brianjmurrell
Copy link

Is this on a roadmap of any kind given that it's almost 2 years old and given that #1099 has landed?

@mislav
Copy link
Owner

mislav commented Jan 29, 2019

@brianjmurrell Editing issues and PRs (which includes closing them too) is planned for the next feature release; until then you can use the latest stable release to close them like so:

hub api -XPATCH repos/{owner}/{repo}/issues/1234 -f state=closed

where "1234" is the issue or PR number you want to close.

@mbasmanova
Copy link

@mislav Mislav, it would be very helpful if hub command supported closing PRs. You mentioned that this is coming in the next feature release. Do you have a sense of a timeline? When can we expect it to become available?

CC: @oerling @nezihyigitbasi

@mislav
Copy link
Owner

mislav commented Apr 3, 2019

@mbasmanova No clear timeline for editing/closing PRs and issues yet, sorry! Contributions welcome. In the meantime, you can use hub api like above to implement a simple script that will help you close issues/PRs.

@moul
Copy link

moul commented Aug 31, 2019

hub api -X PATCH /repos/:user/:repo/pulls/:pr-id -F state=closed

@VincentCastelli
Copy link

I found an additional workaround here. If you delete the branch associated with the PR it will close the PR.

git push origin -d <branchname>

@mislav mislav closed this as completed in 57b8337 Jan 21, 2020
@mislav
Copy link
Owner

mislav commented Jan 21, 2020

In hub master, this can now be done via hub issue update <NUMBER> -s closed #2432

(GitHub pull requests can be treated the same as issues for the most part)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants