Page MenuHomePhabricator

Provide a way to link to Diffusion files
Closed, ResolvedPublic

Assigned To
Authored By
jparise
Nov 5 2015, 5:03 PM
Tags
Referenced Files
None
Tokens
"Like" token, awarded by kerberizer."Like" token, awarded by petr.biza."Like" token, awarded by 20after4.

Description

We already have ways to link to (or embed) many kind of objects, but the one I miss is file-level linking.

When writing code review feedback, I sometimes want to say "Please also update some/filename.txt", and it would be even more useful if there was a shorthand syntax that would linkify filename references to their Diffusion browsing links.

Some things to consider:

  • Could the file's repository be implied or must it always be explicitly specified?
  • Should the syntax support linking to a specific line (range) or revision?

Event Timeline

jparise updated the task description. (Show Details)
jparise added a project: Remarkup.
jparise added a subscriber: jparise.
epriestley added a subscriber: epriestley.

This should probably also wait for (or happen concurrently with / be considered alongside) the repository monogram changes which occur with T4245, although I think it doesn't limit the reasonable syntax available to us very much.

I think the most natural syntax (and the one I tried before discovering it didn't work!) would be to allow one to basically copy-paste the existing path at the top of file pages (the one inside the phui-header-header element), so that for example, a link to Diffusion's readme file on here would be: rP/README.md
And to link to, say, a specific line of a specific revision: rPbe0e84a81abc/README.md$17
And likewise for ranges: rPbe0e84a81abc/README.md$5-13

I would assume the parser would just have to look ahead after an object link and see if it's followed by a slash, then parse everything up to the next whitespace character as a path.

eadler added a project: Restricted Project.Sep 15 2016, 6:08 PM
epriestley claimed this task.

I'm going to close this in favor of T13291. Referencing files by full URI currently works, and relative references and other behavior is planned.