So I'm getting the error post-commit hook failed (exit code 255) with no output.
after committing to the repository. The commit goes through fine, but the hook is obviously not working. The hook code is:
#!/bin/sh
REPOS="$1"
REV="$2"
TXN_NAME="$3"
/usr/bin/svn update --username user --password pass /var/www/clients/clientx/weby/web >&2
exit 1
I've tried changing the permission of /var/www/clients/clientx/weby/web
to 775, but that doesn't work. It's an ISPConfig installation, so the user/group that runs the commit hook is webz:clienty
, while the output folder's ownership is webx:clienty
. I've also run the code without the exit 1
and the >&2
. I just need to be able to see what the problem is, and then I can fix it, but there is no output. I've read about STDERR
and I think what I have should work.
I ran the same command, without the exit 1
and >&2
, from the command line and it worked, no problem.
I'm not sure why I can't get any output, or why the post-commit hook is returning an error.
So I figured out that the problem was that the post-commit hook was not even running. I ran the whole post-commit hook from the terminal itself, and got this error. All I needed to do was make the file Unix executable by using vim
and running the command :set fileformat=unix
. This effectively solved the issue.