4

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?

Stefan Lasiewski
  • 22,949
  • 38
  • 129
  • 184

1 Answers1

4

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.

SmallClanger
  • 8,947
  • 1
  • 31
  • 45
  • 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 04 '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 04 '12 at 22:46