2

In my .gitolite.rc file I have:

LOCAL_CODE => "$ENV{HOME}/.gitolite/local"

..then in ENABLE section of the same file I have enabled repo-specific-hooks:

ENABLE => [

# COMMANDS

# These are the commands enabled by default
    'help',
    'desc',
    'info',
    ...,
    ...,
    ...,
    'repo-specific-hooks'
    ...,
    ...,
    ...
    ]

, now, on my local machine inside gitolite-admin folder I have:

gitolite-admin
...
...

└──local/
    └── hooks/
        ├── common/
        └── repo-specific/
            └── message* <-- this one I want to call in a post-receive hook!

, and for some repo in my gitolite-admin conf file:

repo foo
RW+                       =   @all
option hook.post-receive  =   message <-- referencing script I want to call on post-receive

I did commit and push, from gitolite-admin and I can see that my message script got deployed where it should be on the server path ( that $ENV{HOME}/.gitolite/local ), with executable permsission set.

However, when I push to repo foo I don't get echoed message from my message script, which simply is a bash script:

echo "hello from message"
exit 0

Why does that post-receive is not triggering?

Also if I understood well, there should be a symbolic link in that foo repo called post-receive pointing to my message script, and there isn't one.

branquito
  • 3,864
  • 5
  • 35
  • 60
  • Is your script executable (755)? And just to be sure, can add a `set -x` in your script? (http://stackoverflow.com/a/7266869/6309) – VonC Jun 26 '14 at 18:19
  • `gitolite@remotemachine:~$ ls -l .gitolite/local/hooks/repo-specific/message` yields `-rwxr-x--- 1 gitolite gitolite 88 Jun 26 22:35 .gitolite/local/hooks/repo-specific/message` – branquito Jun 26 '14 at 18:38
  • added `set -x`, cannot see anything except standard message after `git push` – branquito Jun 26 '14 at 18:41
  • Did you forget the '`,`' after `'repo-specific-hooks'`? the '`,`' is needed. – VonC Jun 26 '14 at 19:29
  • No it's there. I checked. – branquito Jun 26 '14 at 19:33
  • What version of gitolite are you using? Basically, it all comes done to http://gitolite.com/gitolite/cust.html#rsh "create a directory called `hooks/repo-specific` in whatever location you decided to use for your non-core code (i.e., direct on the server, or within the gitolite-admin repo)"... not sure exactly *where* that `hooks/repo-specific` folder is supposed to be. – VonC Jun 26 '14 at 19:35
  • It's said that it can be anywhere, as long as you point to that location with LOCAL_CODE variable, there is even an example like the one I used – branquito Jun 26 '14 at 19:39
  • version is 3.5-something – branquito Jun 26 '14 at 19:40
  • 1
    Ok. An old one from 2013. Could you try and upgrade to 3.6.1? – VonC Jun 26 '14 at 19:43
  • Can I update by pulling from remote instead of making new clone, and how should I save changes applied by some previous patch? Because now, when I go into src dir, where I previously cloned gitolite, I have status showing modified that file I patched while ago (because of some problems relating gitweb). Should I commit those changes, and then do `git fetch origin/master`, and then `git merge origin/master`? – branquito Jun 26 '14 at 21:56
  • ok.. you were right, this feature wasn't available until version 3.6+ :) thanks again. – branquito Jun 27 '14 at 01:00
  • You can stash, pull, stash pop, and re-run `gitolite install`. I have added an answer for the release of that feature. – VonC Jun 27 '14 at 05:55
  • Yes, that was exactly how I did it, yesterday, as you didn't respond. I took the risk ;-) – branquito Jun 27 '14 at 10:36
  • 1
    Yes, sorry, I didn't respond because it was 11PM and I was asleep ;) – VonC Jun 27 '14 at 10:39
  • 1
    I do that kind of gitolite upgrade all the time, pulling and then calling the install script: https://github.com/VonC/compileEverything/blob/95a9ccfc8c1cf2848e9580b4704cd0cea07ab6cf/gitolite/install_or_update_gitolite.sh#L23-L28 – VonC Jun 27 '14 at 12:11

1 Answers1

1

As confirmed by the OP, the per repo hook is only available from gitolite late 3.5 (Oct /2013), 3.6 (2014), not early 3.5.x (2013).

'repo-specific-hooks' was:

So the very latest version of gitolite is needed here.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250