Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 10 years ago

#3644 closed defect (duplicate)

PATCH: allow source: TracLinks with line number but no revision

Reported by: hyugaricdeau@… Owned by: Christian Boos
Priority: normal Milestone:
Component: version control Version: devel
Severity: minor Keywords: traclinks
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Currently, to include a line number in a link, the revision also has to be specified, for example: [source:/path/to/file@3#L5]. However, a link like [source:/path/to/file#L5] will end up linking to the file at revision 5. This is just a simple change to the regexp used.

Attachments (1)

trac-source-links.patch (435 bytes ) - added by hyugaricdeau@… 18 years ago.

Download all attachments as: .zip

Change History (8)

by hyugaricdeau@…, 18 years ago

Attachment: trac-source-links.patch added

comment:1 by Christian Boos, 18 years ago

Component: generalversion control
Owner: changed from Jonas Borgström to Christian Boos
Version: devel

The idea was to make the revision mandatory on purpose, as a line numbers aren't good for permanent reference, i.e. what's at line 100 at rev. 1000 will probably have nothing to do with what's at line 100 at rev. 2000.

If you really want to refer to the last revision of a file, you can use @head.

But I'm open to other opinions.

Note also that at least for 0.10, we must still support the source:file#rev (deprecated) syntax.

comment:2 by hyugaricdeau@…, 18 years ago

I see—I had some users complaining about this, and thought it might be a bug, as I wasn't sure about the rationale. But this makes sense, and I'll pass your points along. I also didn't realize that source:file#rev was actually correct, albeit deprecated syntax.

I still wonder if there isn't a better solution. But I'll have to think about it.

comment:3 by Christian Boos, 18 years ago

We could support source:file#rev and source:file#Lxyz (with xyz a line number) at the same time, and in the latter case use the youngest rev, so it's not a technical issue, it's more that we don't want to encourage creating links that will most certainly become non-sense over time.

In the few cases where you're pretty sure the meaning of a line number will remain the same over time (near top of the file, source file below /tags, or nearly frozen branches, etc.), you could still use @head.

Someone also proposed being able to link to function name or class names within source files, and I think that's a good idea, which I still keep in mind for doing later, when we implement the necessary infrastructure to post-process the result of code highlighters (see #1520 and #1292).

comment:4 by Christian Boos, 18 years ago

Resolution: duplicate
Status: newclosed

The way to allow source: TracLinks with line number but no revision suggested in #3745 addresses the concerns I've expressed above, so I'm closing this one as duplicate.

comment:5 by Ryan J Ollos, 10 years ago

Keywords: traclinks added; TracLinks removed

comment:6 by Ryan J Ollos, 10 years ago

Keywords: traclink added; traclinks removed

comment:7 by Ryan J Ollos, 10 years ago

Keywords: traclinks added; traclink removed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.