On Mon, Apr 13, 2015 at 8:42 AM, Johannes Löthberg <[email protected]> wrote: > On 13/04, Dan McGee wrote: >> >> On Mon, Apr 13, 2015 at 8:28 AM, Johannes Löthberg >> <[email protected]> wrote: >>> >>> On 13/04, Gordian Edenhofer wrote: >>>> >>>> >>>> Git has a pre-commit hook which is triggered prior to a commit and >>>> many more. Read >>>> https://www.kernel.org/pub/software/scm/git/docs/githooks.html for >>>> more detail. >>>> >>> >>> I'm aware of how git’s hooks work. You do not seem to though. Git is a >>> DVCS, >>> unlike SVN. You cannot have a pre-commit hook on the server. >> >> >> You don't sound like you are aware, because you are wrong. >> >> http://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks >> https://www.atlassian.com/git/tutorials/git-hooks/server-side-hooks >> >> http://git-scm.com/book/en/v2/Customizing-Git-An-Example-Git-Enforced-Policy >> > > Alas I am not. For one, actually look at your second link where it says that > there are 3 server-side hooks and note how none of them are pre-commit.
He mentioned "and many more"; you're gravitating toward pre-commit. I'm guessing no one here thinks you will be able to stop someone from committing locally. If you want to be pedantic, fine- you win, go buy yourself a cookie or something. If you want to be practical, there are several ways server-side hooks can solve the original problem here. Showing a message on push would be fine; Github does this exact type of thing if you don't have permissions to push to a repository there. In the case of the AUR, you would check for that, any necessary agreements on licensing, etc. and reject the push while providing a helpful "Please go visit http://example.com/tos to accept the conditions of the AUR before pushing your changes." -Dan
