Opened 16 years ago

Last modified 13 years ago

#1374 new enhancement

Plugin to change commit message

Reported by: Maverick <maverick@…> Owned by: anybody
Priority: normal Component: Request-a-Hack
Severity: normal Keywords:
Cc: Trac Release: 0.10


Sometimes I have the problem that I enter a wrong or incorrect comment in the commit message. I usually want to change it afterwards. However, with Subversion that isn't really possible or quite a hassle. I believe you can get it done with a hook script or with svnadmin.

A plugin for Trac would really help doing this the easy way.

Attachments (1)

pre-revprop-change.txt (962 bytes) - added by Prasand J. 16 years ago.
SVN Hook script.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 16 years ago by Prasand J.

Owner: changed from anybody to Prasand J.
Priority: highnormal
Trac Release: 0.100.11
Type: defectenhancement

A hook script is still required to enable the editing of SVN properties. If the SVN property is not edited, then trac will solely edit the database. However, that potentially presents problems when running:

trac-admin <trac-env-location> resync

Since the edits were not comitted to the svn directly, a resync will over-write the values stored in the database. Which would mean the resync command would need to factor in database only edits, trac would need to store the edited values in a different location, or trac would have to operate on the SVN database directly. The latter may lead to svn data corruption.

Should a user want to change svn properties it is more reliable to enable the SVN hook, and have SVN make the changes. The trac system would just invoke:

svn <propedit|propset|propdel>

Since svn property changes are not remembered, trac would then store the previous values in the trac database. Similar ideas have been covered in the TracObjectModelProposal, and discussed in trac ticket #781. See those two items for more information.

Changed 16 years ago by Prasand J.

Attachment: pre-revprop-change.txt added

SVN Hook script.

comment:2 Changed 16 years ago by Prasand J.

Resolution: fixed
Status: newclosed

I have attached a hook script to give you an idea of what needs to be done to enable editing in SVN or through an SVN client like TortoiseSVN. The script takes it a step further from the default / example pre-revprop-change.tmpl and enables the editing of svn:log (svn comments), and svn:author (changing the username). However, the script only enables the modification of already existing properties.

Upload the file to your svn hook folder, remove the .txt extension, and chmod 755 or 775 the file (775 is the default for an svn:executable). I recommend reading about "SVN Properties".

comment:3 Changed 16 years ago by Noah Kantrowitz

Resolution: fixed
Status: closedreopened
Trac Release: 0.110.10

Saying this could be done through the command line client is not a reason to close the request.

comment:4 Changed 16 years ago by Noah Kantrowitz

Owner: changed from Prasand J. to anybody
Status: reopenednew

comment:5 in reply to:  3 Changed 16 years ago by Prasand J.

Replying to coderanger:

Saying this could be done through the command line client is not a reason to close the request.

I closed the request because it's addressed on trac (see #781), and I thought that would count it as a duplicate. I also thought that the person who filed it's issue was "However, with Subversion that isn't really possible", or the difficulty. Thus by making it possible, addressing the difficulty, and / or directing him to a relevant discussion ... where someone already plans to address it, would render this null. Additionally with the resync command issue I thought it was more relevant to trac than trac-hacks. However, in the process I neglected the fact that avid plugin coders like yourself might take interest in it, and do something about it before markus or whomever. I'm still getting used to the whole trac contributions thing, and trac in general. In hindsight, I recall you coding things which were being 'discussed'.

Please excuse my assumptions.

comment:6 Changed 16 years ago by Maverick

Thank you for your comments and explanation, prasand. I didn't notice it was already discussed on

Your explanation only mentions the use of a hook script which is not the only way. You can also use svnadmin setlog REPOS_PATH -r N FILE . There is alot discussion in the ticket about versioning the changes to the log since the previous log message is deleted when using the command. I wouldn't care about that at all if you only allow admins (for example) to change the log message.

A simple plugin which would only use the svnadmin command at the correct pages (maybe a button/link inside TracBrowser to a page for editing the log) would do the trick and help alot of people.

comment:7 Changed 16 years ago by Prasand J.

I guess part of my problem was the fact that I was factoring in issues from the other discussion (keeping trac of the changes made). However, without the added filler svnadmin would definitely simplify things. Please excuse my previous assumptions, I see now that though related the two concerns are seperate (or supplementary). Maybe if movement is made on this plugin that will motivate solutions the other factors.

comment:8 Changed 16 years ago by anonymous

Priority: normalhigh

comment:9 Changed 16 years ago by anonymous

Priority: highnormal

comment:10 Changed 16 years ago by anonymous

Priority: normalhigh

comment:11 Changed 16 years ago by Noah Kantrowitz

Priority: highnormal

Unless you want provide a bounty, leave this as normal.

comment:12 Changed 13 years ago by Martin Scharrer

This could be easily done by reading and writing the revprops files in the subversion repository. Therefore no hook files or command line client is needed, but direct read/write access to the repository. Read access is already there so the installing admin only has to give the Trac server write permissions. I already programmed a Perl module SVN::Dumpfilter to read SVN dumpfile which use the same format as the files in revprops which hold the svn:log entries. Parsing these is reasonable simple.

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain anybody.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.