[Trac-tickets] [The Trac Project] #1242: [ER] Generalized automatic cross-references in Trac

The Trac Project noreply at edgewall.com
Thu Mar 3 05:14:03 EST 2005


#1242: [ER] Generalized automatic cross-references in Trac
-------------------------+--------------------------------------------------
       Id:  1242         |      Status:  new                     
Component:  general      |    Modified:  Thu Mar  3 05:13:58 2005
 Severity:  enhancement  |   Milestone:                          
 Priority:  normal       |     Version:  0.8                     
    Owner:  jonas        |    Reporter:  cboos at bct-technology.com
-------------------------+--------------------------------------------------
 == 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:

 {{{
 #!html
 <div>
 <strong>Backlinks:</strong>
 <a href="/trac/wiki/OutstandingPatches" title="I think that the patches
 #187, #909, #919, #944 and #948 are great!">OutstandingPatches</a>
 </div>
 }}}

 ----

 Of course, I'm willing to provide a patch for that, but I would like
 to get some feedback before.

 -- Christian

-- 
Ticket URL: <http://projects.edgewall.com/trac/ticket/1242>
The Trac Project <>


More information about the Trac-Tickets mailing list