MR commit tab improvement idea related to force-push
<!--IssueSummary start-->
<details>
<summary>
Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards.
</summary>
- [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=409010)
</details>
<!--IssueSummary end-->
Hello,
I would like to disallow force-push on all branches, including feature branches. I don't want to use branch protection, because it prevents branch deletion. This is effectively the same as #988, however that's a 7 year old issue and doesn't address my use case, so I thought to open a new one and explain.
Use case:
While a reviewer is reviewing an MR, a developer does a force-push on the MR branch.
The reviewer had just approved the MR, and the organization has enabled the project setting "When a commit is added: remove all approvals"; therefore the reviewer's approval was undone.
The change made in the force-push was just correcting a typo, but the overall merge request has a number of other pushes and its size is fairly large. Because the developer is able to force-push to feature branches, it makes reviews needlessly more complicated.
A reviewer must review the entire MR again (or at least the entirety of the overwritten commit history) even though it was only a typo, because there appears to be no way to simply look at the diff of the force-push against the original push in the gitlab interface. In order to see the actual diff for the force-push, a reviewer would need to go to the pipelines page, copy the first push's commit sha, check out the MR branch locally, and then `git diff` against the copied commit sha -- or if several pushes were overwritten by the force-push, the reviewer may need to check out each push in order to review them for differences.
I'd like Gitlab to be smarter about this and show the extra commit with a flag indicating that the commit was force-pushed and supercedes the original commit (perhaps even making the dangling, superceded, commit hash(es) appear greyed out or faded) so that I can see the diff of the force-push...
Additionally, I'd like have an option to just disallow force-push on feature branches without needing to enable branch protection.
issue