How to Change an SVN Commit Message Retroactively

Changing an SVN commit message retroactively involves two steps. First, the repository must have a hook enabled. Then the svn client must issue a propset command.

On the subversion server:

cd /var/www/svn/myrepository/hooks
cp pre-revprop-change.tmpl pre-revprop-change
chmod u+x pre-revprop-change
chown apache:apache pre-revprop-change

Line-by-line explanation:

Change to the subversion repository's hooks directory.
Copy the template file that is already there to a file without the .tmpl extension.
Make the file executable.
Change ownership of the file to the apache user (this is the user that Apache runs as on Fedora-like systems such as RHEL6).

Changes to log messages are now allowed.

Now an svn command can be issued on the client at the command line to revise the log message for a certain revision (in this case, revision 42):

svn propset -r 42 --revprop svn:log 'my new commit message'
property 'svn:log' set on repository revision 42

Subscribe to RSS - Subversion