change svn commit comment

Thursday, September 10, 2009

It happens sometimes, committing something in svn then realising the comment was wrongly for something completely different, or the main thing was missed out. Here's how to change it.

If you don't have the repo configured to allow post-commit changes (as per; it is off by default), then you can easily do it on the server as admin with no config changes:

sudo svnadmin setlog --bypass-hooks /path/to/repo /path/to/text-file-with-new-comment.txt -r ##

This command is documented in svn versions 1.4 to 1.6.


Trac
If Trac is being used on the project, then prompt it to re-read the repo and pick up the change by:
trac-admin /path/to/trac-project resync ##

where ## is the revision number to resync. If it is left out then all revisions will be resynchronised.