Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed svn server with apache 2 on ubuntu 10

i have created a with a single 2 lines of code


date > /tmp/post-commit.log

nothing is written to that file can anyone assist please?

share|improve this question
up vote 1 down vote accepted

From here:


post-commit — Notification of a successful commit.


The post-commit hook is run after the transaction is committed, and a new revision created. Most people use this hook to send out descriptive emails about the commit or to notify some other tool (such as an issue tracker) that a commit has happened. Some configurations also use this hook to trigger backup processes.

The output from, and exit value returned by the post-commit hook program are ignored.

What you want is a pre-commit hook (kind of obvious once you think about those names):


pre-commit — Notification just prior to commit completion.


The pre-commit hook is run just before a commit transaction is promoted to a new revision. Typically, this hook is used to protect against commits that are disallowed due to content or location (for example, your site might require that all commits to a certain branch include a ticket number from the bug tracker, or that the incoming log message is non-empty).

If the pre-commit hook program returns a non-zero exit value, the commit is aborted, the commit transaction is removed, and anything printed to stderr is marshalled back to the client.

Also, make sure to make the script file executable, and use the exact name pre-commit or post-commit, i.e. without file name extension!

share|improve this answer
@Jason Did you make it executable? chmod +x repository/hooks/ Also, try removing the .sh file name extension, I'm not sure if it works with these. – Daniel Beck Apr 23 '11 at 10:49
correct had to remove the .sh – Jason Apr 23 '11 at 10:59
Re quote #1: The post-commit script itself does not output anything; the output made by date is redirected internally. – grawity Apr 23 '11 at 12:47
@grawity He redirects manually to a file. While stdout and stderr are probably discarded/redirected, I don't think this output is removed. Otherwise these scripts will have a hard time doing anything. – Daniel Beck Apr 23 '11 at 12:50

Try renaming the script to repository/hooks/post-commit. The should be no extension in the filename. Read the repository/hooks/post-commit.tmpl file for more information (specifically the first paragraph which states:

The post-commit hook is invoked after a commit. Subversion runs this hook by invoking a program (script, executable, binary, etc.) named 'post-commit'

share|improve this answer

Your Answer


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.