protect master branches except for the pecl repos against force pushes#4
protect master branches except for the pecl repos against force pushes#4Tyrael wants to merge 2 commits intophp:masterfrom
Conversation
hooks/pre-receive
Outdated
There was a problem hiding this comment.
The + operator will give the wrong behaviour when $restricted is not empty, the first filtered value will not be present in the resulting array. You'll want to use array_merge() instead or append the master ref later on.
|
You want to eventually exempt the repos listed under misc (like on http://git.php.net) too |
|
@bwoebi why/what repo? misc is not a homogen group, looking through the repos not sure if we want to excempt any of those. |
|
playground (self-explaining?), php-gtk/ (same category than the pecl repos). The other phpruntests/pftt2… no real idea what they even are … Only maybe phd.git should be protected on master too. |
|
I haven't reviewed this. But I'd suggest to change the error message. Something like -deny("You are not allowed to overwrite commits on " . implode(', ', $restricted)); (not sure we have a mailing list, should use systems@ or list specific names) |
as discussed on the mailing list it would be nice if not everybody can force push for every other repo but php-src.git.
@johannes mentioned that we should allow force pushes for the pecl repos so what I came up with is to restrict force pushes by default for the master branch on every repo except those with a name starting with pecl/.
I tried to test my changes, but testing a pre-receive hooks is a PITA manually, so it would be nice if somebody could review my change before merging it.