Windows
versora:// links
7 min read
To show a colleague a commit or a piece of code, you usually send a SHA or a path and the line
number, and they have to look everything up. A versora:// link does that on its own: whoever
receives it clicks and Versora opens right in the right place, on their machine.
- Commit: selected in the graph, with the details in the right panel.
- Branch or tag: the tip selected in the graph.
- File: the file's blame, at a fixed version, with the lines marked.
- Merge request (or pull request): the review in the app.
- Repository: just opens the repository.
The link carries the repository in two ways, because the recipient's folder is rarely the same as the sender's: the folder on the sender's machine and the remote URL. Versora tries the folder first and, if it doesn't work, looks for it by the remote.
The "Copy Versora link" item appears in the context menus (right-click):
| Where | Menu item |
|---|---|
| Commit (graph) | Copy Versora link to this commit |
| Local or remote branch (graph or left panel) | Copy Versora link to branch: … (with the branch name) |
| Tag | Copy Versora link to tag: … (with the tag name) |
| File (a commit's file list or the changes) | Copy Versora link to the file |
| Block or lines picked in blame | Copy Versora link to line 12 or Copy Versora link to lines 12–18 (with the range's numbers) |
| Merge request in the left panel's list | Copy Versora link to merge request !12 (on GitHub, to pull request #12) |
| Repository tab and Home project | Copy Versora link to the repository |
- Palette (Ctrl+P): "Copy Versora link to the repository".
- In the blame of
src/carrinho.ts, click the numbers of lines 40 to 48 to pick the range (or use a commit's block). - Right-click the range and choose Copy Versora link to lines 40–48.
- The notice "Versora link copied: versora://file?…" confirms it and shows the link.
- Paste the link in the chat or email to your colleague.
- Local branch: the name of the upstream (the branch your colleagues have) goes in, if
there is one. A
feature/pagamentobranch that tracksorigin/feature/pagamentobecomes a link tofeature/pagamentoon theoriginremote. - File from a commit: the link points to that commit's version.
- File from the local changes: the link points to the
HEADversion, which is the one your colleagues may have. - New file, not committed yet: there's nowhere to point to. The item appears disabled, as Copy Versora link to the file (not committed yet).
- Blame lines: the picked range or the commit's block. In the working directory blame, the
link points to
HEAD. - Remote: Versora finds the remote and removes the user and password from the URL before putting it in the link.
- Repository without a remote: the link carries only the folder, and the notice says "Versora link copied (it only opens on this machine: the repository has no remote)".
Each link has a "kind" in place of the address and the data in the query:
versora://commit?sha=<sha>&remote=<url>&repo=<folder>
versora://branch?name=<branch>&remote=<url>&repo=<folder>
versora://tag?name=<tag>&remote=<url>&repo=<folder>
versora://mr?iid=<number>&remote=<url>&repo=<folder>
versora://file?file=<path/in/repo>&line=12[-18]&rev=<sha>&remote=<url>&repo=<folder>
versora://repo?remote=<url>&repo=<folder>
An example:
versora://commit?sha=3f2a9c1&remote=https://git.exemplo.com/equipe/loja-web.git&repo=D:/dev/loja-web
You don't need to build links by hand: always use "Copy Versora link".
- Click the link wherever it is (browser, chat, email). Windows hands the link to Versora.
- Palette (Ctrl+P): "Open Versora link…" ("Paste a versora:// link and open the repository right where it points").
- Preferences › Command line and links › Open a link….
- Command line:
versora "versora://…"(see Command line).
Use the palette when the program the link is in doesn't let you click it, or when the versora://
protocol isn't registered on this machine.
- Click the link you received, or press Ctrl+P, choose "Open Versora link…", paste the link in the Link field and click Open.
- Versora finds the repository:
- first, the sender's folder, if it exists on this machine and has the same remote;
- otherwise, among the tabs and the Home projects, the ones that have the same remote (HTTPS and SSH count as the same).
- If more than one repository has that remote, Versora asks which one to open ("Several repositories with this remote").
- If none has it, Repository not found appears, with the options:
- Clone…: "Clones … and opens the link in the new repository." (with the remote URL) Opens the usual clone window, already with the URL. When the clone finishes, the link continues;
- Browse the disk…: "Choose the repository's folder on this machine.". If the chosen folder doesn't have the link's remote, the app asks "A different repository?" and offers Open anyway.
- The repository opens (or its tab is activated) and Versora goes to the target.
- If the commit, branch or tag doesn't exist yet on this machine, the app asks "Not in this repository" (for example, "The commit 3f2a9c1 isn't in loja-web. Fetch and look again?"). Click Fetch.
Requests are handled one at a time, in the order they arrived.
Opening a link doesn't change anything in the repository. The only possible network command is the fetch, and only when you confirm the "Fetch and look again?" question. The clone also only happens if you choose Clone….
The link comes from outside (chat, email, browser), so Versora checks everything before using it:
- Nothing that comes in the link is executed. The app only opens a repository that already exists on the machine (or that you choose to clone) and navigates to the screen.
- Branch and tag names go through git's naming rules (
git check-ref-format). - SHAs can only have hexadecimal characters.
- File paths can only be relative to the repository and can't contain
... - The remote URL loses its user and password.
- Very long links are rejected.
The installer always registers the versora:// protocol, without asking, as apps do with their
own protocol. Uninstalling removes the registration.
Preferences › Command line and links › versora:// links group › Windows registration shows the status:
- "Registered: links open this Versora.";
- "Registered for another executable: …": links open another copy of Versora (for example, an old installation). Run this version's installer;
- "Not registered. The Versora installer registers the versora:// protocol. Meanwhile, use "Open Versora link…" in the palette (Ctrl+P).".
For IT
The protocol lives in Software\Classes\versora: in the user's registry (HKCU) for the per-user
installation and in the machine's (HKLM) for the installation for all users. The registered
command is "<Versora folder>\versora.exe" "%1". See Deployment in the company.
Copying and opening a link don't change the repository: there's nothing to undo. If you cloned a repository through the link, it stays in the chosen folder, like any clone.
- "Versora link copied": the link is on the clipboard.
- "Versora link copied (it only opens on this machine: the repository has no remote)": the link only carries the folder. On a computer without that folder, it won't find the repository.
- "This isn't a Versora link (versora://…).": the pasted text doesn't start with
versora://. - "Invalid link: the … field isn't valid." and "Incomplete link: the … field is missing.": the link was cut or changed along the way. Ask them to copy it again.
- "The link doesn't say which repository (repo or remote is missing).": the link has neither a folder nor a remote.
- "The link is too long." and "The link has invalid encoded characters.": the link was damaged.
- "Unknown link type: ….": the link is of a kind this version of Versora doesn't know. Update the app.
- "No repository known to Versora on this machine has the remote ….": use Clone… or Browse the disk….
- "The folder … doesn't exist on this machine and the link has no remote to look for.": the link is from a repository without a remote, in a folder you don't have.
- "… isn't a git repository.": the folder chosen in Browse the disk… isn't a repository.
- "… still isn't in … after the fetch.": the commit, branch or tag isn't on the remote (it may have been deleted, or hasn't been pushed yet).
- "The server integration didn't recognize … in time: merge request … didn't open.": the link is for a merge request, but the repository isn't connected to a registered GitLab or GitHub server. See Git servers.
- "Versora couldn't open ….": opening the repository failed. The reason appears in an earlier notice.
- Preferences › Command line and links › versora:// links.
- The page can be hidden or made read-only by the company policy (id
deeplink). See Policy keys.