Skip to content

add hook to reject certain commits from being pushed to the repository #240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 20, 2020

Conversation

larsxschneider
Copy link
Member

This can be a useful pre-receive hook if you rewrote the history of a repository and you want to ensure nobody pushes the old commits again.

stoe
stoe previously requested changes May 3, 2019
Copy link
Contributor

@IAmHughes IAmHughes left a comment

Choose a reason for hiding this comment

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

This looks great @larsxschneider. I had a suggestion, but I'm okay with leaving things as they are too so I'm approving.

@IAmHughes IAmHughes dismissed stoe’s stale review May 3, 2019 14:29

Changes requested were resolved

Co-Authored-By: larsxschneider <larsxschneider@github.com>
@mzzmjd
Copy link
Contributor

mzzmjd commented May 3, 2019

Hi @larsxschneider,
This is a good idea, I am just thinking aloud about the administrator actions required ..... 🤔

Do we store this pre-receive hook script in the repository that is protected?
That way the owner of the repository can add / remove the required commits But as an admin I have to set up the pre-receive hook for them.

Was just wondering if the repo could have a list of the commits in a text file (using a standard naming convention).
There could then be a single pre-receive hook, across the whole instance, that could then use the api to get the contents of the file. Providing that they give a designated whole instance api user access to the repo. Or is that making it a bit more complicated and open to failure?

Pete (from Sheffield)

@larsxschneider
Copy link
Member Author

@mzzmjd Thanks for you feedback Pete! I get your point and that makes total sense. I'll add that option 👍

@Aa88s
Copy link

Aa88s commented Aug 10, 2019

Yes pull requests looks much better

@jonico jonico merged commit 5131b00 into master Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants