Modify

Opened 14 years ago

Closed 14 years ago

#7734 closed enhancement (worksforme)

Not picking up leading ticket numbers in SVN commits

Reported by: jochenhebbrecht@… Owned by: Mikael Relbe
Priority: normal Component: TracTicketChangesetsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

We have several commits with ticket numbers in them ( #123 - foo bar ). The Trac timeline is picking them very good up, but not the TracTicketChangesetsPlugin.

It always says: "0 tickets related to 0 changesets".

Any idea's where to start searching?

Attachments (0)

Change History (7)

comment:1 Changed 14 years ago by jochenhebbrecht@…

Reformatting doesn't work either:

diff ticket commit messages to be reformatted

0 messages to be reformatted

comment:2 Changed 14 years ago by jochenhebbrecht@…

Just to be sure, this is an example of a commit message: #192: Installatie CKEditor op live

comment:3 Changed 14 years ago by Mikael Relbe

Status: newassigned

I apologize for not answering this for so long time.

Currently (r8135), the commit message needs to state a prefix word before the ticket-id to create an association between the changeset and ticket. The keywords are configurable, e.g.:

[ticket-changesets]
commands.close = close closed closes fix fixed fixes
commands.refs = addresses re refs references see ticket tickets

I myself do not use the automatic closing feature, so in my case I have:

[ticket-changesets]
commands.close = 
commands.refs = close closed closes fix fixed fixes
                addresses re refs references see ticket tickets

I say "currently", because your wish means that any stated ticket-id in the commit message should create an association between the changeset and ticket-id. This is currently not possible.

To accomplish this, we could add a new option commands.default_action.

The following would be the default settings:

[ticket-changesets]
commands.default_action =
commands.close = close closed closes fix fixed fixes
commands.refs = addresses re refs references see ticket tickets

where

  • commands.default_action defines the default action to apply for any stated ticket-id, no-matter the prefix text in the commit message:
    • (empty): action is only performed when the ticket-id is prefixed with a keyword (command) according to the options commands.close and commands.refs.
    • close: close any ticket-id that is stated in the commit message by default
    • refs: associate any ticket-id that is stated in the commit message by default.

This would satisfy your request while still be backwards compatible in a sensible manner, I think.

comment:4 Changed 14 years ago by Mikael Relbe

The option name should perhaps be "default_action" and not "commands.default_action".

comment:5 Changed 14 years ago by Mikael Relbe

Type: defectenhancement

A better idea would be to recognize a leading ticket id in a commit message as a ticket reference, without a keyword.

[ticket-changesets]
commands.leading_ticket_id = false | refs | close

Leading ticket ids would be ignored when set to false (which perhaps should be the default value). (See how TracTicketChangelogPlugin handles commit messages, for an example.)

(This is not a defect, rather a feature request.)

comment:6 Changed 14 years ago by Mikael Relbe

Summary: Not picking up ticket numbers in SVN commitsNot picking up leading ticket numbers in SVN commits

comment:7 Changed 14 years ago by Mikael Relbe

Resolution: worksforme
Status: assignedclosed

I just realized that the following configuration will solve the problem:

[ticket-changesets]
commands.refs = <ALL>

You may now supply commit message like

#123: Changed something...

to create a reference in ticket 123 without altering its state.

Tickets can be closed as well, but will require a prefix word:

[ticket-changesets]
commands.close = close closed closes fix fixed fixes
commands.refs = <ALL>

Example:

Fixed #123: Changed something...

will close ticket 123.

Thus, no change is needed I think.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Mikael Relbe.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.