All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Jeremiah Foster <jeremiah.foster@pelagicore.com>
Cc: git@vger.kernel.org
Subject: Re: Unable to coax hooks into working
Date: Tue, 27 Apr 2010 10:52:12 +0200	[thread overview]
Message-ID: <4BD6A5BC.3010708@drmicha.warpmail.net> (raw)
In-Reply-To: <FAF218B9-D2DB-4081-88CB-BEBA08DF1229@pelagicore.com>

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

  reply	other threads:[~2010-04-27  8:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BD6A5BC.3010708@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=jeremiah.foster@pelagicore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.