Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Conversation

@Tyrael
Copy link
Contributor

@Tyrael Tyrael commented Aug 9, 2015

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ofc, thanks!

@bwoebi
Copy link
Member

bwoebi commented Aug 9, 2015

You want to eventually exempt the repos listed under misc (like on http://git.php.net) too

@Tyrael
Copy link
Contributor Author

Tyrael commented Aug 9, 2015

@bwoebi why/what repo? misc is not a homogen group, looking through the repos not sure if we want to excempt any of those.

@bwoebi
Copy link
Member

bwoebi commented Aug 9, 2015

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.

@johannes
Copy link
Member

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));
+deny("You are not allowed to overwrite commits (force push) on " . implode(', ', $restricted) . ". Please contact PHP Git admins");

(not sure we have a mailing list, should use systems@ or list specific names)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants