Page MenuHomePhabricator

Provide a way to reference projects in Remarkup
Closed, ResolvedPublic

Description

This is mostly a discussion task, just wanted to see if you guys had any brighter ideas than what I have.

Currently, we can reference users with @user and other objects with, e.g., Dnnn, but there is no way to mention projects. I think we should build one with the eventual goal of providing integrations (e.g., tag an object by commenting with the project reference, like you can CC a user by commenting with @user).

I'm not sure how we should structure these, though. Pnnn seems bad for two reasons:

  1. Basically unusable in practice, since you need to refer to projects by name, like users.
  2. Already used by paste.

The obvious choice is probably #project; this is already in common use in a similar role on Twitter and Facebook is ostensibly implementing them too.

The drawbacks I can see are:

  • "#" is a comment character from the CLI, so this may end up with slightly awkward constructions where cmd --tag #project fails and you have to write cmd --tag '#project'.
  • Facebook uses "#" for tasks, but all task IDs are numeric so in practice this wouldn't collide.
  • "#" is a comment character when editing commit messages, but we already handle this correctly (or, at least, reasonably) because of Facebook.
  • "#" can't be used in URLs, but I don't think this is an issue.

Do you guys see any other problems with #project (either technical, or hating hashtags -- note that I hate them but consider this implementation to be ironic), or have other suggestions?

Most other reasonable characters seem awkward to me (;project), are overloaded already (!action in email, @user, ` for monospace) or occur in discussion of source code ($project, *project). I think ~, %, ^ and & could maybe be OK as alternatives. We could use \ in ironic mockery of PHP's namespace operator, but I actually hate that.

Revisions and Commits

rP Phabricator
D7882
Restricted Differential Revision

Event Timeline

epriestley added a project: Remarkup.

Hashtag works for me, you could also just use '@', but I sort of prefer hashtags with how we expect tags to work in the future.

The major remaining work here is:

  • Make Project hovercards more useful (maybe after T390).
  • Provide a mechanism for extracting Project PHIDs from Remarkup blocks, similar to how we extract files and users.
  • Use that mechanism going forward to imply "associate with this project", similar to how @username means "CC this user". T2628 is probably the first use case.
  • Allow projects to have alternate hashtag short names, so "Phabricator Public & Media Relations" can be #pr too, not just #phabricator_public_media_relations.
  • Document the feature (it's almost entirely useless right now so I've kept it unmentioned for the moment).

Currently, the regular expression which matches these tags is more restrictive than the slugifier which generates them, so projects like a:b get a:b as a slug, but #a:b isn't picked up by the regexp.

epriestley changed the visibility from "All Users" to "Public (No Login Required)".Jan 28 2014, 4:08 PM

This is about a year old, any chance this can be implemented soon using hashtag? It would be very nice to have.

(sorry not being familiar with this codebase I have no idea of the complexity to get this done)

I just discovered that basic hashtag works: Wikimedia

I guess the problems are all the other (minor? how major?) problems described at T3190#10.

Edited: I see, the project is mentioned but doesn't lead anywhere. Not optimal. :)

I assume this is complete as you can add any number of hashtags by editing your Project now:

Design Phacility High Command

(Yes, hovercard display is broken, but fixed at HEAD).

That's great, thanks for implementing this!

PS: Looks like the remarkup reference is not up-to-date yet: https://secure.phabricator.com/book/phabricator/article/remarkup/.