tags:

views:

43

answers:

2

Title is pretty much the question. I have a post-commit that has taken me ages to get permissions working correctly.

I can run it manually and it works, however, when I actually make a commit (as the same user that I know works manually) nothing happens.

Will anything be logged anywhere? Or can I set up pseudo-logging or something?

Thanks,

Adam

A: 

Try

svn help log

Unless you're talking about some other kind of logging?

apphacker
I don't think that really helps, I need some kind of indication as to why my post-commit is failing, all that seems to show is the revisions that have worked when I've run the post-commit script manually.
Adam Taylor
Hrm try your ssh logs then which on a unix/linux system would be in /var/log
apphacker
+1  A: 

Did you try debugging the hook per the subversion directions?

Why aren't my repository hooks working?

They're supposed to invoke external programs, but the invocations never seem to happen.

Before Subversion calls a hook script, it removes all variables -- including $PATH on Unix, and %PATH% on Windows -- from the environment. Therefore, your script can only run another program if you spell out that program's absolute name.

Debugging tips:

If you're using Linux or Unix, try running the script "by hand", by following these steps:

  1. Use "su", "sudo", or something similar, to become the user who normally would run the script. This might be httpd or www-data, for example, if you're using Apache; it might be a user like svn if you're running svnserve and a special Subversion user exists. This will make clear any permissions problems that the script might have.
  2. Invoke the script with an empty environment by using the "env" program. Here's an example for the post-commit hook:

          $ env - ./post-commit /var/lib/svn-repos 1234
    

Note the first argument to "env" is a dash; that's what ensures the environment is empty. 3. Check your console for errors.

Brian Gianforcaro
If I run over ssh, i.e. svn+ssh it will be invoked by the user sshing right?
Adam Taylor
Correct. If you have user@ in the URL, it will be "user".
Martin v. Löwis