1

Subversion (VisualSVN in my case) allow you to kick off scripts at various times, such as pre-commit, post-commit etc. I want to send an email notification containing the following info when a commit occurs:

  • SVN User who comitted
  • Comment that the user entered
  • The name of the repo that was committed to
  • List of modified files
  • Transaction ID

Unfortunately the hooks only seem to provide some of this info. The post-commit hook provides the repo name and transaction ID only. The start-commit has the user and repo name, but not the transaction ID. And I can't find any hooks that provide the commit message or list of modified files.

Is there any way to make this information available to hooks? And if not, is there any other way to mail off this information on commit?

Mr. Flibble
  • 26,564
  • 23
  • 69
  • 100

1 Answers1

1

You can use svnlook command to get this information about revision: http://www.visualsvn.com/support/svnbook/ref/svnlook/

Alternatively you can use VisualSVN Server built-in email notification command in VisualSVNServerHooks.exe. Just add following command to you post-commit hook:

"%VISUALSVN_SERVER%\bin\VisualSVNServerHooks.exe" ^
     commit-notification "%1" -r %2 ^
     --from noreply@example.com --to svn-commits@example.com ^
     --smtp-server smtp.example.com

You can find more information in KB18: http://www.visualsvn.com/support/topic/00018/

Ivan Zhakov
  • 3,981
  • 28
  • 24
  • 1
    Thanks Ivan. `svnlook` is what I was looking for. I don't think VisualSVNServerHooks.exe on its own is enough, but combined with `svnlook` we're good. – Mr. Flibble Jun 09 '12 at 23:30
  • @Mr.Flibble Can you share the '..hooks.exe' plus the 'svnlook' combined code? – Ravi Ram Sep 12 '14 at 15:11