Get web view URL to a commit without knowing the callsign?


Is there a way to get a URL to a commit without knowing the callsign of the repository?

So, for example: I know that I’ve cloned a repository that sits on, and I want to display the commit 5d54f26daca8 in a browser.

The url to the web view for the commit includes the callsign of the repository:

Is there a way to get a URL for any commit in any repo without knowing it’s callsign? I need it to add support for Phabricator to browse-at-remote.el


The easiest solution is to just run arc browse <commit hash> from somewhere inside the repository. This also works for files, tasks, an other objects.

There are 2 harder ways to handle this:

  1. Use the commit search conduit endpoint - to search for the commit by hash (identifiers).
  2. Use arc which command line tool to get know which repository you’re in, and extract the repository information from there.

There are quite a few ways to understand which repository you’re in, which is why arc which is a complicated workflow.


See also

Currently, when you type a commit hash in plain text in Remarkup, we link it only if it unambiguously resolves to a single commit.

We have code to resolve ambiguity when multiple commits in a single repository share a prefix:

Eventually, I’d like to add support for resolving commits across multiple repositories in a similar way. Then we could link raw hashes if they resolved to one or more commits in any number of repositories.

As a side effect, you could use this link target to accomplish your goal here.

This also works today, but isn’t necessarily very stable or reliable: