Modify

Opened 8 years ago

Last modified 5 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

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.

Attachments (1)

pre-revprop-change.txt (962 bytes) - added by prasand 8 years ago.
SVN Hook script.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 8 years ago by prasand

  • Owner changed from anybody to prasand
  • Priority changed from high to normal
  • Trac Release changed from 0.10 to 0.11
  • Type changed from defect to 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.

Changed 8 years ago by prasand

SVN Hook script.

comment:2 Changed 8 years ago by prasand

  • Resolution set to fixed
  • Status changed from new to 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: Changed 8 years ago by coderanger

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Trac Release changed from 0.11 to 0.10

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

comment:4 Changed 8 years ago by coderanger

  • Owner changed from prasand to anybody
  • Status changed from reopened to new

comment:5 in reply to: ↑ 3 Changed 8 years ago by prasand

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 8 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 8 years ago by prasand

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

  • Priority changed from normal to high

comment:9 Changed 8 years ago by anonymous

  • Priority changed from high to normal

comment:10 Changed 8 years ago by anonymous

  • Priority changed from normal to high

comment:11 Changed 8 years ago by coderanger

  • Priority changed from high to normal

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

comment:12 Changed 5 years ago by martin_s

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.

Add Comment

Modify Ticket

Action
as new The owner will remain anybody.
Author


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

 
Note: See TracTickets for help on using tickets.