Opened 7 years ago

Closed 7 years ago

# Not picking up leading ticket numbers in SVN commits

Reported by: Owned by: jochenhebbrecht@… Mikael Relbe normal TracTicketChangesetsPlugin normal 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?

### comment:1 Changed 7 years ago by jochenhebbrecht@…

Reformatting doesn't work either:

diff ticket commit messages to be reformatted

0 messages to be reformatted

### comment:2 Changed 7 years ago by jochenhebbrecht@…

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

### comment:3 Changed 7 years ago by Mikael Relbe

Status: new → assigned

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 7 years ago by Mikael Relbe

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

### comment:5 Changed 7 years ago by Mikael Relbe

Type: defect → enhancement

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 7 years ago by Mikael Relbe

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

### comment:7 Changed 7 years ago by Mikael Relbe

Resolution: → worksforme assigned → closed

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