git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Unable to coax hooks into working

From
Jeremiah Foster <jeremiah.foster@pelagicore.com>
Date
Apr 27, 2010, 08:33 UTC
Message-ID
<FAF218B9-D2DB-4081-88CB-BEBA08DF1229@pelagicore.com>
In-Reply-To
<v2u8c9a061004261111l429b0c8cs73cf7e1afea3d39f@mail.gmail.com>
On Apr 26, 2010, at 8:11 PM, Jacob Helwig wrote:
Show 14 quoted lines
> 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
Previous: Jacob HelwigNext: Michael J Gruber
Message 3 of 6 in “Re: Unable to coax hooks into working”
  1. Jeremiah FosterApr 26, 2010
  2. Jacob HelwigApr 26, 2010
  3. Jeremiah FosterApr 27, 2010
  4. Michael J GruberApr 27, 2010
  5. Jeremiah FosterApr 27, 2010
  6. Michael J GruberApr 27, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.