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 on my Linux machine that is set up to export a new build of a project every time a new commit occurs using a post-commit hook. I would really like to be able to provide an output message to the committer containing some status information once the hook completes. Is it possible to redirect the output of the hook to come after the standard commit messages?

For example:

owner@dev-machine:/working/dir$ svn commit
Sending FILE1
Sending FILE2
Transmissing file data ...
Committed revision 13.
Exporting project...
Successfully exported to mysite.com

The addition of the last two lines is the functionality I'm looking for.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

According to the documentation, the only way to output anything to the client from post-commit is to write to standard error and then exit with a non-zero status. However, this will result in output like the following:

Committed revision 200.

Warning: post-commit hook failed (exit code 1) with output:
Exporting project...
Successfully exported to mysite.com 
share|improve this answer
    
Well, that's a bummer, but thanks for the workaround! –  Salis Apr 13 '10 at 3:19
add comment

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.