All development git repos have now been changed to allow dangerous changes, so that we can rebase in branches before merging.
But we do not want that to happen on master, so we need to inhibit --force pushes to master.
That should be doable using Herald rules. If so, having a global rule to that effect would be nice.
Description
Description
Event Timeline
Comment Actions
This is now implemented by H22, e.g.:
git push --force Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 281 bytes | 281.00 KiB/s, done. Total 3 (delta 1), reused 0 (delta 0) remote: *** PUSH REJECTED BY COMMIT HOOK *** remote: remote: This push was rejected by Herald push rule H22. remote: Change: branch/master remote: Rule: forbid dangerous changes to the master branch in any repository remote: Reason: dangerous changes to master branch are forbidden remote: Transcript: https://forge.softwareheritage.org/herald/transcript/58415/ remote: To ssh://forge.softwareheritage.org/source/sandbox.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'ssh://git@forge.softwareheritage.org/source/sandbox.git'
while it works when force-pushing to branches other than master.