Opened 13 years ago

# Plugin to change commit message

Reported by: Owned by: Maverick anybody normal Request-a-Hack normal 0.10

### Description

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.

### comment:1 Changed 13 years ago by Prasand J.

Owner: changed from anybody to Prasand J. high → normal 0.10 → 0.11 defect → enhancement

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.

SVN Hook script.

### comment:2 Changed 13 years ago by Prasand J.

Resolution: → fixed new → closed

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 follow-up:  5 Changed 13 years ago by Noah Kantrowitz

Resolution: fixed closed → reopened 0.11 → 0.10

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

### comment:4 Changed 13 years ago by Noah Kantrowitz

Owner: changed from Prasand J. to anybody reopened → new

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

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'.

### comment:6 Changed 13 years ago by Maverick

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

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 13 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 13 years ago by anonymous

Priority: normal → high

### comment:9 Changed 13 years ago by anonymous

Priority: high → normal

### comment:10 Changed 13 years ago by anonymous

Priority: normal → high

### comment:11 Changed 13 years ago by Noah Kantrowitz

Priority: high → normal

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

### comment:12 Changed 10 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