UI: Make accidential squashing of protected branches harder
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Squashing on protected branches leaves a kind of problematic git history. I would love to prohibit squashing of protected branches, because it messes up any future merges. There is already an issue raised that goes into this direction: https://gitlab.com/gitlab-org/gitlab-ce/issues/52057
However, the problem of accidentially squashing merges from a protected branch is amplified by the UI.
Normally the left most checkbox asks me to delete the source branch:
However, for a protected branch it is not possible to delete the source branch. The current UI therefore hides the checkbox to delete the branch, the left-most checkbox is "squash commits":
I built up some muscle memory to delete the source branch, because oftentimes people forget to pre-fill that checkbox. This means when merging a protected branch I could see that the left-most checkbox is unchecked and I would click it right before merging, even though I intended something different.
A UI-side fix to this problem would be to show the checkbox, but disable it. This makes sure that users can safely remember which checkbox is at which place and still indicates that protected branches can't be removed. Mockup:
Does this make sense?