Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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