# Unable to coax hooks into working

3 messages from 2010-04-26 to 2010-04-26. Participants: Jeremiah Foster, Michael J Gruber.
Thread: https://gitlist.dev/t/23604

## Jeremiah Foster, 2010-04-26 12:32

Subject: Unable to coax hooks into working
Message-ID: <4C764DDD-420E-40C6-9848-96E2197BE70D@pelagicore.com>
URL: https://gitlist.dev/e/4C764DDD-420E-40C6-9848-96E2197BE70D%40pelagicore.com

```
Hello,

	After reading this page: http://book.git-scm.com/5_git_hooks.html on git hooks and doing a test implementation, I cannot seem to coax my git hooks into working.

	My understanding is that the hook is in the right location, in the git repository on the remote server, when doing a hook based on a post-commit update. I have down chown and chmod, the code executes, it just doesn't execute when I update the git repo and push. I have also tested this on the local machine with a different hook for the client also without success. 

	We're using debian testing and git 1.7.0.2 with the http-smart backend.

	What should I do to get hooks working?

Regards,

Jeremiah

```

## Michael J Gruber, 2010-04-26 12:55

Subject: Re: Unable to coax hooks into working
Message-ID: <4BD58D35.1010307@drmicha.warpmail.net>
URL: https://gitlist.dev/e/4BD58D35.1010307%40drmicha.warpmail.net
In-Reply-To: <4C764DDD-420E-40C6-9848-96E2197BE70D@pelagicore.com>

```
Jeremiah Foster venit, vidit, dixit 26.04.2010 14:32:
> Hello,
> 
> 	After reading this page: http://book.git-scm.com/5_git_hooks.html on git hooks and doing a test implementation, I cannot seem to coax my git hooks into working.
> 
> 	My understanding is that the hook is in the right location, in the git repository on the remote server, when doing a hook based on a post-commit update. I have down chown and chmod, the code executes, it just doesn't execute when I update the git repo and push. I have also tested this on the local machine with a different hook for the client also without success. 
> 
> 	We're using debian testing and git 1.7.0.2 with the http-smart backend.
> 
> 	What should I do to get hooks working?

Use the right hook.

Unsurprisingly, the post-commit hook is executed after a commit. That
should give you an indication that the hook should be in the repo where
you commit. Reading the page you linked to confirms this guess. I
refrain from comments related to the "smart backend" ;)

Michael

```

## Jeremiah Foster, 2010-04-26 17:59

Subject: Re: Unable to coax hooks into working
Message-ID: <E89E12CE-5BD7-4661-9A2D-91602F0F64FA@pelagicore.com>
URL: https://gitlist.dev/e/E89E12CE-5BD7-4661-9A2D-91602F0F64FA%40pelagicore.com
In-Reply-To: <4BD58D35.1010307@drmicha.warpmail.net>

```

On Apr 26, 2010, at 2:55 PM, Michael J Gruber wrote:

> Jeremiah Foster venit, vidit, dixit 26.04.2010 14:32:
>> Hello,
>> 
>> 	After reading this page: http://book.git-scm.com/5_git_hooks.html on git hooks and doing a test implementation, I cannot seem to coax my git hooks into working.
>> 
>> 	My understanding is that the hook is in the right location, in the git repository on the remote server, when doing a hook based on a post-commit update. I have down chown and chmod, the code executes, it just doesn't execute when I update the git repo and push. I have also tested this on the local machine with a different hook for the client also without success. 
>> 
>> 	We're using debian testing and git 1.7.0.2 with the http-smart backend.
>> 
>> 	What should I do to get hooks working?
> 
> Use the right hook.

I followed that document I listed explicitly. After lining up the right command, the right hook, and the right location, including correct executable bits as well as script ownership, a functioning script was built. Yet when the corresponding git command was called, the command failed to send data to the client which leads me to believe that the hooks wasn't called.

Can I confirm that hooks work with this type of transport, that is to say with the hook invoked by git-receive-pack and the newer http-smart backend?

Thanks,

Jeremiah

```
