2

I just set up Trac and Gitosis and wanted to control the ticket workflow with the commit messages. Unfortunately my post-commit hook is not executed. If I execute it on command line (as gitosis user) everything is like charm.

My post-commit is rather simple:

#!/bin/sh
touch /tmp/commited
echo 'Cant touch this!'

Any suggestions on that?

Thanks in advance & cheers Martin

Martin Röbert
  • 664
  • 8
  • 25
  • Trying using Gitolite (http://stackoverflow.com/a/7044873/6309) instead of gitosis: everything works better. You can use the non-root method to install your Gitolite: http://stackoverflow.com/questions/9339272/gitolite-can-connect-via-ssh-cant-clone/9340778#9340778 – VonC Feb 18 '12 at 14:45
  • I've set up gitolite - the hook is not executed. – Martin Röbert Feb 20 '12 at 07:42
  • Is it still working when you are executing the commit with the command-line? – VonC Feb 20 '12 at 07:49
  • 1
    Ouch - the answer is really simple and if I had thought about it a minute, I don't had to ask it. All I wanted was the post-receive hook, not post-commit. Shame on me! – Martin Röbert Feb 20 '12 at 08:24
  • Good point. I have added references in an answer below for more visibility. – VonC Feb 20 '12 at 08:39

1 Answers1

3

The OP realized in the comment there was a difference between;

See Pro Git book for more.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • See also http://stackoverflow.com/questions/5623208/how-to-execute-a-command-right-after-a-fetch-or-pull-command-in-git/5623947#5623947 for more on the post-receive hook. – VonC Feb 20 '12 at 08:42