{"thread":{"id":"33078","subject":"Git hook commit similar to subversion start-commit hook","startedAt":"2013-03-05T21:14:42Z","lastAt":"2013-03-05T21:31:02Z","messageCount":2,"participants":["Jose Garcia Juanino","John Keeping"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"210656","messageId":"20130305211440.GA9929@banach","threadId":"33078","inReplyTo":null,"subject":"Git hook commit similar to subversion start-commit hook","fromName":"Jose Garcia Juanino","fromEmail":"jjuanino@gmail.com","sentAt":"2013-03-05T21:14:42Z","receivedAt":"2013-03-05T21:14:42Z","isPatch":false,"sender":{"key":"jjuanino@gmail.com","avatar":null},"body":"Hello,\n\nIs there any hook in Git similar to start-commit subversion hook? The\nrequirements would be:\n\n1- A hook on the server side (as pre-receive)\n2- It will execute the actions *before* the begin of transaction\n(pre-receive hook needs the references already pushed before).\n\nFor example, it would be useful to refuse a push if the server has a\nhigh load.\n\nI have read man githook, but there is nothing similar.\n\nBest regard, and excuse my poor english.\n\n"},{"id":"210659","messageId":"20130305213102.GW7738@serenity.lan","threadId":"33078","inReplyTo":"20130305211440.GA9929@banach","subject":"Re: Git hook commit similar to subversion start-commit hook","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-03-05T21:31:02Z","receivedAt":"2013-03-05T21:31:02Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Tue, Mar 05, 2013 at 10:14:42PM +0100, Jose Garcia Juanino wrote:\n> Is there any hook in Git similar to start-commit subversion hook? The\n> requirements would be:\n> \n> 1- A hook on the server side (as pre-receive)\n> 2- It will execute the actions *before* the begin of transaction\n> (pre-receive hook needs the references already pushed before).\n> \n> For example, it would be useful to refuse a push if the server has a\n> high load.\n\nIf you are using Gitolite[1] then a PRE_GIT trigger could do this.\n\nWith plain Git you can achieve the same by specifying a custom shell for\nthe users logging in and performing the custom check when\ngit-receive-pack is being executed.\n\n\n[1] http://gitolite.com/gitolite\n\nJohn\n"}]}