Ticket #1374 (new enhancement)

Opened 2 years ago

Last modified 1 year ago

Plugin to change commit message

Reported by: Maverick <maverick@dedicational.com> Assigned to: 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

pre-revprop-change.txt (0.9 kB) - added by prasand on 04/01/07 19:29:19.
SVN Hook script.

Change History

04/01/07 19:26:37 changed by prasand

  • owner changed from anybody to prasand.
  • priority changed from high to normal.
  • type changed from defect to enhancement.
  • release changed from 0.10 to 0.11.

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.

04/01/07 19:29:19 changed by prasand

  • attachment pre-revprop-change.txt added.

SVN Hook script.

04/01/07 19:34:19 changed by prasand

  • status changed from new to closed.
  • resolution set to fixed.

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

(follow-up: ↓ 5 ) 04/01/07 21:42:28 changed by coderanger

  • release changed from 0.11 to 0.10.
  • status changed from closed to reopened.
  • resolution deleted.

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

04/01/07 21:42:40 changed by coderanger

  • owner changed from prasand to anybody.
  • status changed from reopened to new.

(in reply to: ↑ 3 ) 04/01/07 23:26:07 changed 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.

04/02/07 02:17:30 changed 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.

04/02/07 08:00:50 changed 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.

04/03/07 00:48:53 changed by anonymous

  • priority changed from normal to high.

04/03/07 09:50:37 changed by anonymous

  • priority changed from high to normal.

04/03/07 11:51:26 changed by anonymous

  • priority changed from normal to high.

04/03/07 12:01:59 changed by coderanger

  • priority changed from high to normal.

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


Add/Change #1374 (Plugin to change commit message)




Change Properties
Action