Ticket #1242 (assigned enhancement)
[ER] Generalized automatic cross-references in Trac
| Reported by: | cboos@… | Owned by: | cboos |
|---|---|---|---|
| Priority: | normal | Milestone: | experimental |
| Component: | general | Version: | 0.8 |
| Severity: | normal | Keywords: | xref |
| Cc: | robert.pollak@…, emilk@…, nick+trac@…, martin.marcher@… |
Description
Problem
Trac provides a fast, easy and flexible way to relate Trac objects together, by the use of TracLinks in the WikiFormatting.
However, there's no automatic support for back-linking. This lack has been noticed in several circumstances:
- BackLinks for Wiki pages (tickets #611 and #646, the latter containing a [http:/trac/ticket/646#change_4 note] which also highlights the genericity of the problem)
- Related Changesets for a given Ticket (ticket #508)
- Ticket dependencies and other relationships (tickets #31 and #226)
Instead, the backlinking is done manually. For example, when closing a ticket with a resolution of duplicate, the convention is to comment the closing of the ticket by saying this is a duplicate of #xyz and to mention the existence of the duplicate ticket on the original #xyz ticket. With a generalized backlinking facility, this would cease to be necessary.
Solution
What I would propose is that every relationship that gets detected while parsing new wiki content is recorded. Then, each wiki, changeset and ticket page could contain a See also: section at the end, listing the other objects that contain TracLinks targeting it, along with a bit of context, to catch the semantic of the link as well.
Example given:
Consider the following wiki OutstandingPatches page:
= Outstanding Patches page = I think that the patches #187, #909, #919, #944 and #948 are great!
Then, each time this page is edited, the content of an XREF (source, target, context table would be cleared for this page:
delete from XREF where source = 'wiki:OutstandingPatches'
and when the content is processed, each time a TracLink is detected, the table would be filled:
insert into XREF values ('wiki:OutstandingPatches',
'ticket:187',
'I think that the patches #187, #909, #919, #944 and #948 are great!')
Then, while browsing #187, one could easily get the backlinks:
select source, context from XREF where target='ticket:187'
in order to create the following output at the end of the ticket page:
Of course, I'm willing to provide a patch for that, but I would like to get some feedback before.
-- Christian


