-
Notifications
You must be signed in to change notification settings - Fork 4
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
Pull requests: option to disable force push once opened #53
Comments
Branch protection rules https://help.github.com/en/github/administering-a-repository/defining-the-mergeability-of-pull-requests should cover this case. |
@jeffmcaffer can you please explain how using branch protection rules I can block force pushes to someone's PR? I don't think this is possible. They own the PR branch. Thanks! |
cc @caniszczyk I would like to get this issue reopened. This is a major pain point and AFAIK there is no solution. Thanks! |
I misunderstood the scenario. Happy to reopen the issue. To help the GitHub folks, can you say a bit more about the context and scenarios where this happens and how it would work with this feature in place? |
The actual issue is that the GH code review system is completely broken when people force push in the sense that you lose any ability to see what has changed since the last time you looked. Obviously I would love this to be fixed but this is a huge issue. So in terms of context, people open PRs, and then force push during reviews, which makes reviews incredibly difficult. Blocking force pushes on open PRs is just a hack to make this super annoying scenario impossible until the review system can be fixed. |
got it. Stepping back, in your scenarios why are people force pushing and what would they do as an alternative if they could not force push? |
Usually a combination of needing to fix DCO (another major issue, this needs to be built into GH directly), being bad at git, or just not understanding the problem. We want them to merge master and add commits and never force push to avoid breaking the review experience. |
I can see value in allowing this, it definitely has to be opt-in. Force-pushing to PR branches is very valuable when the PR consists of a series of logical changes in separate commits (as it should unless it's small) and those commits should be kept when the PR is merged. Addressing review feedback involves changing the commits, not adding new commits which land on top of them, in that workflow. |
How do people get their PR rebased onto the last changes on the main branches without force pushing? That's another common reason I see for doing a force push, especially if the changes in the main branch of the project are conflicting and the rebase is needed to resolve these. |
Merge master. There is no reason to ever force push. Again, force pushing itself is not the problem, it's the broken code review system. I'm just trying to have a workaround that saves us a massive amount of pain from a project maintainer perspective. |
+1 on preventing force-pushes for a whole repo (not on a per-branch basis). The code review system doesn't track properly after a force-push. Also, we're talking about an option, not a requirement that everyone use it. Our organization uses merge-commits, and we do want to track what got changed in each commit. Addressing PR feedback is a matter of adding new commits to fix the issues, not modifying history. So this option would be highly valuable to our process. |
Can this be provided as a repo-level setting? |
What's the status of this issue? Is this being reviewed? Considered? 🙏🏻 |
I've recently noticed that next to a forced-push line in the PR, there is a "compare" button which allows to see the difference between the current version of the PR and the one before the forced push. That helps. Without that I personally keep a branch of a PR version on my machine before pulling the new forced-push version. It's annoying but it's the best I could think of. |
+1 for this feature |
it's not very usefull, but all has already been said in there... |
I just had a commit I pushed to a contributor's branch eliminated because they carelessly force-pushed over it. Would definitely appreciate an option to disable force-push in pull request branches too. |
When people force push onto PRs it removes review history and makes reviews much harder to do. It would be really nice to have an option where we can disable force pushes to PRs once they are opened against a project.
The text was updated successfully, but these errors were encountered: