Wiki:help/howtos/development/developer_information/post_commit_hook

Trac Hooks

trac-post-commit-hook

The trac-post-commit-hook script searches commit messages for text in the form of:

command #1
command #1, #2
command #1 & #2
command #1 and #2

You can have more then one command in a message. The following commands are supported. There is more then one spelling for each command, to make this as user-friendly as possible.

closes, fixes
  • The specified issue numbers are closed with the contents of this commit message being added to it.
references, refs, addresses, re
  • The specified issue numbers are left in their current status, but the contents of this commit message are added to their notes.

A fairly complicated example of what you can do is with a commit message of:

Changed blah and foo to do this or that. Fixes #10 and #12, and refs #12.
  • This will close #10 and #12, and add a note to #12.

trac-post-revprop-change-hook

With the trac-post-revprop-change-hook script one could change the svn:log property. The syntax is:

1. svn propset svn:log --revprop -r <REVISION> "My corrected log message" <URL>
2. svn propset svn:log --revprop -r <REVISION> -F <file-with-corrected-log-message.txt> <URL>
3. svn propedit svn:log --revprop -r <REVISION>

For easy usage add a "svn comment edit" alias to your .bash_profile:

export SVN_EDITOR=vi (or whatever)
alias svnceF='svn propedit svn:log --revprop http://svn.freetz.org/ -r'

Your editor will start after

svnceF <REVISION>