#12628 closed enhancement (wontfix)
Add configuration options to CommitTicketUpdater to disable short form of ticket references
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
CommitTicketUpdater notices ticket references like #NNN
. This is usually just the right thing to do. However, if a project uses trac and GitHub, then there is confusion between whether a #NNN
reference means a trac ticket or a GitHub issue or pull request.
An easy fix is to use ticket:NNN
for trac tickets and #NNN
for GitHub items.
If CommitTicketUpdater had a config toggle that controlled whether it discovered the short form or not, it would be easy to implement this fix.
For now, I've forked CommitTicketUpdater and hacked up the code so its regexp only detects ticket:NNN
. It would be great to be able to switch back to the upstream plugin and just tweak some configuration.
Attachments (0)
Change History (2)
comment:1 by , 8 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 8 years ago
Posting a working solution back here could be very useful in case anyone else needs to solve the same problem.
Ah, but it's only useful for my limited use case. So that would clearly be a waste of time.
The configuration option would only be useful for your limited use case. If we satisfied every request like this we'd be drowning in config options.
There's a simple solution, just create a single-file plugin and drop it in your Environment
plugins
directory. In the single-file plugin, subclass CommitTicketUpdater and modifyticket_prefix
. It's unlikely to ever break and you don't have to fork the code.Disable the standard
CommitTicketUpdater
by including this in the[components]
section of trac.ini:This is untested, but I've done similar things in MultiProjectCommitTicketUpdaterPlugin. If it doesn't work as expected, that's probably due to
ticket_prefix
being a class attribute and therefore not behaving quite the way I expect. I think with a little tweaking it can be made to work.Posting a working solution back here could be very useful in case anyone else needs to solve the same problem.
For other solutions see:
gh-
prefix for GitHub issues.