I have a Subversion repository created with Subversion 1.6.x.

This repository has a post-commit hook, which performs an action every time a user checks in the file.

Sometimes this post-commit hook fails, and any error messages are simply sent into the ether. Can I create a post-commit hook which prints an error message for the user, so that the user knows that the post-commit hook failed?


Output to stderr from your script should be marhsalled back to the client. If you have control over the output yourself, consider appending >&2 to the relevant echoes

ref: http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.ref.reposhooks.post-commit

This will get the output as far as the svn client libraries, but I'm not sure that every client implementation will do anything with it.

  • Ah! These are messages which are not printed to stderr, nor do they generate a non-zero exit status. Maybe that is why I do not see them. – Stefan Lasiewski May 4 '12 at 22:35
  • Indeed. If the message goes to stdout, then it's lost. If you can't modify the hook directly, then wrap it in a script that captures the relevant parts of the output and echoes it to stderr. – SmallClanger May 4 '12 at 22:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.