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

Allow to reopen pull requests after a force push #361

Open
cirosantilli opened this Issue Feb 21, 2015 · 23 comments

Comments

Projects
None yet
@cirosantilli
Collaborator

cirosantilli commented Feb 21, 2015

If I close a pull request, force push to the branch, and then try to reopen it, the "Reopen pull request button" is deactivated and the on hover tooltip says "The XXX branch was force pushed or recreated".

Why does it behave like this, considering that you can force push open pull requests and it all works as expected?

This is a reasonably common use case, e.g. if I make a pull request, notice it is not good enough, close not to waste reviewer's time, then update.

Sample: plasticboy/vim-markdown#176

Update: GItHub replied:

We're blocking the pull request reopen if the current head isn't a descendant of the stored head sha (which is what the head was when the pull request was closed). We are not allowing the reopen in that case, because there is no good way to tell what changes have happened while a pull request was closed and the head branch has changed.

But I still don't understand what is the difference between that case and the case where the PR is open.

@stuartpb

This comment has been minimized.

stuartpb commented Feb 25, 2015

Yeah, that's weird. I can't think of any reason why that should happen. Maybe it's supposed to force people to keep from re-using pull requests for multiple merges (like a pull request can only be merged once)?

Did you email GitHub about this? What was their response?

@cirosantilli

This comment has been minimized.

Collaborator

cirosantilli commented Feb 25, 2015

@stuartpb I've emailed them as usual, but no reply so far. When they do reply I'll update.

@cirosantilli

This comment has been minimized.

Collaborator

cirosantilli commented Feb 27, 2015

github replied

@jayphelps

This comment has been minimized.

jayphelps commented Apr 2, 2015

👍 I don't understand how this is different either. I've literally done hundreds (if not thousands) of force pushes to PRs, without issue, but if it's closed a force push seals it shut forever no matter what.

@kenbier

This comment has been minimized.

kenbier commented Jun 2, 2015

+1 on this issue, any resolution?

@nhooey

This comment has been minimized.

nhooey commented Jun 22, 2015

@cirosantilli What did GitHub say in their reply?

@stuartpb

This comment has been minimized.

stuartpb commented Jun 22, 2015

From the OP:

We're blocking the pull request reopen if the current head isn't a descendant of the stored head sha (which is what the head was when the pull request was closed). We are not allowing the reopen in that case, because there is no good way to tell what changes have happened while a pull request was closed and the head branch has changed.

@stuartpb

This comment has been minimized.

stuartpb commented Jun 22, 2015

I think their point is that Github tracks a reflog of every HEAD change while the PR is open (for... some reason?), but doesn't do this tracking when the pull request is closed, so they can't construct a history between what the branch's HEAD was when the PR was last open and what the HEAD of the PR's branch is now.

I agree with @cirosantilli that this is ridiculous, since they don't use this kind of history tracking anywhere (at least not in the public-facing UI) or even reference old HEADs except in "outdated diff" comments, which are already associated to a specific commit and point in time when the comment is posted (unless they're only associating the comment with a blob position and a point in time and then reconstructing the commit the comment would have been on post-facto using forensics on the aforementioned reflog, which, if so, is a hack, and needs to be refactored).

@stuartpb

This comment has been minimized.

stuartpb commented Jun 22, 2015

And, if I understand their complaint correctly, it should be possible to work around this by saving the PR's branch's current HEAD, re-force-pushing the HEAD it had when the PR was closed, re-opening the PR, then re-force-pushing the HEAD it was at before re-opening. (Which is completely stupid to have to do.)

@alexmuller

This comment has been minimized.

alexmuller commented Jul 2, 2015

This would be useful to have (and I'm sure it used to work).

I think the use case that @cirosantilli has is quite common. After receiving feedback on a pull request it's nice to be able to close it to indicate that it's not ready to be merged, and then modify the commits and force push to keep the history tidy.

@paulp

This comment has been minimized.

paulp commented Jul 11, 2015

The practice of updating PRs in place with force pushes should be reconsidered anyway. It was inevitable that practices which amount to telling lies for a more palatable history would carry consequences (just like in real life.)

@stuartpb

This comment has been minimized.

@cirosantilli

This comment has been minimized.

Collaborator

cirosantilli commented Jul 11, 2015

let's not flamewar to rebase or not to rebase.

It's all just electrons moving around inside our CPUs in the end.

😄

@mtbc

This comment has been minimized.

mtbc commented Jan 6, 2016

Yes, force-pushing the original HEAD doesn't seem to help, the PR still can't be reopened. From our own fork GH should be assuming that we know what we're doing.

@Spongman

This comment has been minimized.

Spongman commented Feb 1, 2018

why force me to jump through all these hoops when i should just be able to click on the reopen button?

this is so obvious it has to be against someone's belief system, philosophy, or some other nonsense.

@FeepingCreature

This comment has been minimized.

FeepingCreature commented Jun 29, 2018

Force pushing the previous head commit, reopening, then force pushing the new commit worked fine for me. No gymnastics needed.

@virtualdxs

This comment has been minimized.

virtualdxs commented Oct 26, 2018

This is ridiculous. I closed a PR, and I needed to retroactively sign my commit, so I rebased and force pushed, and then I ran into this.

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