Search code examples
svnsvn-hookspost-commit-hook

Post-commit hook not executing


The problem

I am using SVN for revision control.
I would like to use the post-commit hook in order to get a script executed, but for some reason it does not trigger.

Any ideas what might be the reason?


Additional information

  • My server is a Windows Server 2012
  • I am using VisualSVN Server 2.7.4
  • I have changed the post-commit.tmpl file in the hooks folder to post-commit.bat
  • I am using the http protocol in order to access the server.

What have I tried so far

  • I have modified the post-commit.bat file to create an empty file in c:\ for validating that the hook was executed (it did not...)
  • The script works perfectly from command line.
  • I changed the protocol to file:// (and shared the folder of the repo) - no good...

Solution

As @bahrep and @Dialecticus pointed out, it was not smart on my side to create the test file on root c:. after creating it within a subfolder with full permissions for everybody, the file was created, e.g. the hook was triggered after all.


Solution

  • Try to create the empty file in C:\Temp folder. Writing to the root of C: requires special privileges that you may have, but the account under which SVN server is running may not have.

    Also, try another test, just in case. Make pre-revprop-change.bat hook with a sole line of code "exit 0", and try to change some revision's log message, or even author, and see if that works.