git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Unable to coax hooks into working
@ 2010-04-26 12:32 Jeremiah Foster
  2010-04-26 12:55 ` Michael J Gruber
  0 siblings, 1 reply; 9+ messages in thread
From: Jeremiah Foster @ 2010-04-26 12:32 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Unable to coax hooks into working
  2010-04-26 12:32 Jeremiah Foster
@ 2010-04-26 12:55 ` Michael J Gruber
  2010-04-26 17:59   ` Jeremiah Foster
  0 siblings, 1 reply; 9+ messages in thread
From: Michael J Gruber @ 2010-04-26 12:55 UTC (permalink / raw)
  To: Jeremiah Foster; +Cc: git

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Unable to coax hooks into working
  2010-04-26 12:55 ` Michael J Gruber
@ 2010-04-26 17:59   ` Jeremiah Foster
  0 siblings, 0 replies; 9+ messages in thread
From: Jeremiah Foster @ 2010-04-26 17:59 UTC (permalink / raw)
  To: git


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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Unable to coax hooks into working
@ 2010-04-26 18:04 Jeremiah Foster
  2010-04-26 18:11 ` Jacob Helwig
  0 siblings, 1 reply; 9+ messages in thread
From: Jeremiah Foster @ 2010-04-26 18:04 UTC (permalink / raw)
  To: git



>> 	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.

Here is so more information on the http backend I was referring to: progit.org/2010/03/04/smart-http.html
And the manual page: www.kernel.org/pub/software/scm/git/docs/git-http-backend.html

Can I confirm that hooks work with this type of transport? 

Jeremiah

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Unable to coax hooks into working
  2010-04-26 18:04 Unable to coax hooks into working Jeremiah Foster
@ 2010-04-26 18:11 ` Jacob Helwig
  2010-04-27  8:33   ` Jeremiah Foster
  0 siblings, 1 reply; 9+ messages in thread
From: Jacob Helwig @ 2010-04-26 18:11 UTC (permalink / raw)
  To: Jeremiah Foster; +Cc: git

On Mon, Apr 26, 2010 at 11:04, Jeremiah Foster
<jeremiah.foster@pelagicore.com> wrote:
>
>
>>>      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.
>
> Here is so more information on the http backend I was referring to: progit.org/2010/03/04/smart-http.html
> And the manual page: www.kernel.org/pub/software/scm/git/docs/git-http-backend.html
>
> Can I confirm that hooks work with this type of transport?
>
> Jeremiah
>

The real problem is that you're using a post-commit hook (or at least
everything you said in your original email implies you are).
post-commit hooks are only triggered in your _local_ repository, since
this is the only place you actually commit.  Doesn't matter which
transport you're using, post-commit will never be triggered by a push.

You want one of the receive, or update hooks, if you're putting this
in a central place, where it needs to be triggered by someone doing a
push in to the repo.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Unable to coax hooks into working
  2010-04-26 18:11 ` Jacob Helwig
@ 2010-04-27  8:33   ` Jeremiah Foster
  2010-04-27  8:52     ` Michael J Gruber
  0 siblings, 1 reply; 9+ messages in thread
From: Jeremiah Foster @ 2010-04-27  8:33 UTC (permalink / raw)
  To: git


On Apr 26, 2010, at 8:11 PM, Jacob Helwig wrote:

> On Mon, Apr 26, 2010 at 11:04, Jeremiah Foster
>> 
>> 
>> Can I confirm that hooks work with this type of transport?
> 
> The real problem is that you're using a post-commit hook (or at least
> everything you said in your original email implies you are).
> post-commit hooks are only triggered in your _local_ repository, since
> this is the only place you actually commit.  Doesn't matter which
> transport you're using, post-commit will never be triggered by a push.
> 
> You want one of the receive, or update hooks, if you're putting this
> in a central place, where it needs to be triggered by someone doing a
> push in to the repo.

Thanks Jacob. I'd just like to confirm that I am, in fact, using the update hook. I logged into the server holding the git repo, cd'd to the .git/hooks/ directory. Moved the update.sample to update. Changed the code to something trivial that would echo back to the client for testing. I checked permissions, checked ownership, ran the code as the git repo owner. I logged out, did a trivial change in the client repo, ran git commit -a -m "foo" and expected that the trivial update script to run on the server would produce output to the client. This never occurred. I further tested the client hooks which also did not run. 

I wonder if git is not seeing the scripts or if the backend mechanism has changed in some manner from one version of git to another? Any insight is welcome. I'll run the  hooks in the client with strace to see if I can get any information on what is happening.

Jeremiah

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Unable to coax hooks into working
  2010-04-27  8:33   ` Jeremiah Foster
@ 2010-04-27  8:52     ` Michael J Gruber
  2010-04-27  9:08       ` Jeremiah Foster
  0 siblings, 1 reply; 9+ messages in thread
From: Michael J Gruber @ 2010-04-27  8:52 UTC (permalink / raw)
  To: Jeremiah Foster; +Cc: git

Jeremiah Foster venit, vidit, dixit 27.04.2010 10:33:
> 
> On Apr 26, 2010, at 8:11 PM, Jacob Helwig wrote:
> 
>> On Mon, Apr 26, 2010 at 11:04, Jeremiah Foster
>>> 
>>> 
>>> Can I confirm that hooks work with this type of transport?
>> 
>> The real problem is that you're using a post-commit hook (or at
>> least everything you said in your original email implies you are). 
>> post-commit hooks are only triggered in your _local_ repository,
>> since this is the only place you actually commit.  Doesn't matter
>> which transport you're using, post-commit will never be triggered
>> by a push.
>> 
>> You want one of the receive, or update hooks, if you're putting
>> this in a central place, where it needs to be triggered by someone
>> doing a push in to the repo.
> 
> Thanks Jacob. I'd just like to confirm that I am, in fact, using the
> update hook. I logged into the server holding the git repo, cd'd to

That used to be different ;) update hook on the server is good.

> the .git/hooks/ directory. Moved the update.sample to update. Changed
> the code to something trivial that would echo back to the client for
> testing. I checked permissions, checked ownership, ran the code as
> the git repo owner. I logged out, did a trivial change in the client
> repo, ran git commit -a -m "foo" and expected that the trivial update
> script to run on the server would produce output to the client. This

But this is the same problem backwards. Again: Please try to understand
what commit does, and what push does, in terms of where (local repo vs.
server) a change happens:

As long as you only commit in your local repo nothing changes on the
server (remote repo), so no hook is triggered there.

> never occurred. I further tested the client hooks which also did not
> run.

Which ones?

committing locally triggers post-commit on your local repo.
pushing to remote triggers post-update (and others) on the remote
server's repo.

Michael

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Unable to coax hooks into working
  2010-04-27  8:52     ` Michael J Gruber
@ 2010-04-27  9:08       ` Jeremiah Foster
  2010-04-27 10:47         ` Michael J Gruber
  0 siblings, 1 reply; 9+ messages in thread
From: Jeremiah Foster @ 2010-04-27  9:08 UTC (permalink / raw)
  To: git


On Apr 27, 2010, at 10:52 AM, Michael J Gruber wrote:
> Jeremiah Foster venit, vidit, dixit 27.04.2010 10:33:
>> 
>> On Apr 26, 2010, at 8:11 PM, Jacob Helwig wrote:
>>> 
>>> You want one of the receive, or update hooks, if you're putting
>>> this in a central place, where it needs to be triggered by someone
>>> doing a push in to the repo.
>> 
>> Thanks Jacob. I'd just like to confirm that I am, in fact, using the
>> update hook. I logged into the server holding the git repo, cd'd to
> 
> That used to be different ;) update hook on the server is good.
> 
>> the .git/hooks/ directory. Moved the update.sample to update. Changed
>> the code to something trivial that would echo back to the client for
>> testing. I checked permissions, checked ownership, ran the code as
>> the git repo owner. I logged out, did a trivial change in the client
>> repo, ran git commit -a -m "foo" and expected that the trivial update
>> script to run on the server would produce output to the client. This
> 
> But this is the same problem backwards. Again: Please try to understand
> what commit does, and what push does, in terms of where (local repo vs.
> server) a change happens:

I think I do. The commit pushes the change onto the index. The index is local. It gets pushed to the remote server when I do a git push. I should have been more explicit - I am in fact pushing the code to the remote server in such a manner that git-receive-pack is run. My understanding from the documentation is that this is the trigger which update gets called. Yet no information from that update script is produced in the logs or in the client.
> 
> As long as you only commit in your local repo nothing changes on the
> server (remote repo), so no hook is triggered there.
> 
>> never occurred. I further tested the client hooks which also did not
>> run.
> 
> Which ones?
> 
> committing locally triggers post-commit on your local repo.

These did not work.

> pushing to remote triggers post-update (and others) on the remote
> server's repo.

These also did not work. In short, the triggers that the documentation defines for both client and remote hooks fail to produce information in the client. Any idea on why?

Jeremiah

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Unable to coax hooks into working
  2010-04-27  9:08       ` Jeremiah Foster
@ 2010-04-27 10:47         ` Michael J Gruber
  0 siblings, 0 replies; 9+ messages in thread
From: Michael J Gruber @ 2010-04-27 10:47 UTC (permalink / raw)
  To: Jeremiah Foster; +Cc: git

Jeremiah Foster venit, vidit, dixit 27.04.2010 11:08:
> 
> On Apr 27, 2010, at 10:52 AM, Michael J Gruber wrote:
>> Jeremiah Foster venit, vidit, dixit 27.04.2010 10:33:
>>> 
>>> On Apr 26, 2010, at 8:11 PM, Jacob Helwig wrote:
>>>> 
>>>> You want one of the receive, or update hooks, if you're
>>>> putting this in a central place, where it needs to be triggered
>>>> by someone doing a push in to the repo.
>>> 
>>> Thanks Jacob. I'd just like to confirm that I am, in fact, using
>>> the update hook. I logged into the server holding the git repo,
>>> cd'd to
>> 
>> That used to be different ;) update hook on the server is good.
>> 
>>> the .git/hooks/ directory. Moved the update.sample to update.
>>> Changed the code to something trivial that would echo back to the
>>> client for testing. I checked permissions, checked ownership, ran
>>> the code as the git repo owner. I logged out, did a trivial
>>> change in the client repo, ran git commit -a -m "foo" and
>>> expected that the trivial update script to run on the server
>>> would produce output to the client. This
>> 
>> But this is the same problem backwards. Again: Please try to
>> understand what commit does, and what push does, in terms of where
>> (local repo vs. server) a change happens:
> 
> I think I do. The commit pushes the change onto the index. The index
> is local. It gets pushed to the remote server when I do a git push. I
> should have been more explicit - I am in fact pushing the code to the
> remote server in such a manner that git-receive-pack is run. My

Before you said you committed locally and expected the server to run a
hook in response to that!

I'm sorry but I'm giving up at this point, your description of what
you've done is to volatile for my nerves.

If you still want help please provide a line by line transcript of what
commands you're running and what respone you get.

> understanding from the documentation is that this is the trigger
> which update gets called. Yet no information from that update script
> is produced in the logs or in the client.
>> 
>> As long as you only commit in your local repo nothing changes on
>> the server (remote repo), so no hook is triggered there.
>> 
>>> never occurred. I further tested the client hooks which also did
>>> not run.
>> 
>> Which ones?
>> 
>> committing locally triggers post-commit on your local repo.
> 
> These did not work.
> 
>> pushing to remote triggers post-update (and others) on the remote 
>> server's repo.
> 
> These also did not work. In short, the triggers that the
> documentation defines for both client and remote hooks fail to
> produce information in the client. Any idea on why?
> 
> Jeremiah-- To unsubscribe from this list: send the line "unsubscribe
> git" in the body of a message to majordomo@vger.kernel.org More
> majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-04-27 10:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-26 18:04 Unable to coax hooks into working Jeremiah Foster
2010-04-26 18:11 ` Jacob Helwig
2010-04-27  8:33   ` Jeremiah Foster
2010-04-27  8:52     ` Michael J Gruber
2010-04-27  9:08       ` Jeremiah Foster
2010-04-27 10:47         ` Michael J Gruber
  -- strict thread matches above, loose matches on Subject: below --
2010-04-26 12:32 Jeremiah Foster
2010-04-26 12:55 ` Michael J Gruber
2010-04-26 17:59   ` Jeremiah Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).