# Git hook commit similar to subversion start-commit hook

2 messages from 2013-03-05 to 2013-03-05. Participants: Jose Garcia Juanino, John Keeping.
Thread: https://gitlist.dev/t/33078

## Jose Garcia Juanino, 2013-03-05 21:14

Subject: Git hook commit similar to subversion start-commit hook
Message-ID: <20130305211440.GA9929@banach>
URL: https://gitlist.dev/e/20130305211440.GA9929%40banach

```
Hello,

Is there any hook in Git similar to start-commit subversion hook? The
requirements would be:

1- A hook on the server side (as pre-receive)
2- It will execute the actions *before* the begin of transaction
(pre-receive hook needs the references already pushed before).

For example, it would be useful to refuse a push if the server has a
high load.

I have read man githook, but there is nothing similar.

Best regard, and excuse my poor english.


```

## John Keeping, 2013-03-05 21:31

Subject: Re: Git hook commit similar to subversion start-commit hook
Message-ID: <20130305213102.GW7738@serenity.lan>
URL: https://gitlist.dev/e/20130305213102.GW7738%40serenity.lan
In-Reply-To: <20130305211440.GA9929@banach>

```
On Tue, Mar 05, 2013 at 10:14:42PM +0100, Jose Garcia Juanino wrote:
> Is there any hook in Git similar to start-commit subversion hook? The
> requirements would be:
> 
> 1- A hook on the server side (as pre-receive)
> 2- It will execute the actions *before* the begin of transaction
> (pre-receive hook needs the references already pushed before).
> 
> For example, it would be useful to refuse a push if the server has a
> high load.

If you are using Gitolite[1] then a PRE_GIT trigger could do this.

With plain Git you can achieve the same by specifying a custom shell for
the users logging in and performing the custom check when
git-receive-pack is being executed.


[1] http://gitolite.com/gitolite

John

```
