Inspection
Links in messages, co-authors and Signed-off-by
3 min read
Commit messages often mention issues (#123), merge requests (!45), Jira keys (PROJ-56) and
addresses. Versora turns these references into links that open in the browser. You go from the
message straight to the issue, without copying and pasting.
Links appear:
- in the commit panel (summary and description);
- in a blame block's card and menu (Open link);
- in the lists of file history, folder history, comparison and the other inspection screens;
- in the commit list of the merge request review.
Each link's tooltip says "Open <address> in the browser".
| Remote's service | Recognized references |
|---|---|
| GitLab | #123 (issue), !45 (merge request) and group/project#123 |
| GitHub | #123, GH-123 and owner/repo#123 |
| Jira | This repository's project key, for example PROJ-123 |
| Any | http:// and https:// addresses written in the message |
Automatic links depend on the server registered in Git servers (for GitLab and GitHub) and on the Jira project key in Preferences › Issues. See Servers and accounts and Issues.
For security, only http(s) addresses become links: the message may come from anyone who
committed to the repository.
When the team uses another ticketing system, create a rule: a regular expression that finds the reference in the message and the address it opens. Custom rules apply before the automatic ones.
- Preferences › Links in messages (Ctrl+,).
- Open Preferences › Links in messages.
- Under Custom rules, click Add rule.
- Fill in:
- Name (optional): for example
Chamados; - Regular expression: in JavaScript syntax, without the slashes. Example:
CHAMADO-(\d+); - Address (https://…): with
$0for the whole match and$1…$9for the groups. Example:https://chamados.exemplo.com/ver/$1.
- Name (optional): for example
- Check it in Test with some text. The field already has a sample ("Fixes #12 and !34 (PROJ-56); see https://example.com/doc (opens another site)"); replace it with any text you want and see the links the rule generates.
- Use the rule's box ("Rule enabled") to turn it off without deleting it, and Remove to delete it.
Changes take effect right away.
| Option | What it does | Default |
|---|---|---|
| Automatic links for GitLab, GitHub and Jira | Turns on links for issues, MRs/PRs and Jira keys based on the remote's service. Below it, the screen says which ones apply to the open repository. | On |
| http(s) addresses written in the message | Turns on links for bare addresses in the message. | On |
| Custom rules | Regular expression and address, in list order. | None |
The link preferences apply to all repositories.
- "Write the expression.": the rule has no regular expression.
- "Invalid regular expression.": the syntax isn't valid JavaScript. Check parentheses and backslashes.
- "The expression matches empty text: it would mark the whole message.": the expression matches
nothing at all, for example
\d*. Use\d+. - "The address must start with http:// or https://.": other schemes aren't accepted.
- "Turned off.": automatic links are turned off.
- "This repository has no recognized GitLab, GitHub or Jira. Add the server in Git servers or the Jira project key in Preferences › Issues.": the remote isn't on a registered server.
- "No links in this text.": the test text has no recognized reference.
The Co-authored-by and Signed-off-by trailers at the end of the message appear as people, with
a colored initial, name and email, not as loose text:
- Co-author or Co-authors: who made the commit together with the author
(
Co-authored-by); - Signed-off-by: who signed off the commit, "certifying where the code comes from".
They appear in the commit panel, below the description, and in a blame block's card. The description shown leaves these lines out. In blame, a commit with co-authors gets +N next to the author, with the tooltip "With <names>".
Example message:
feat(pedido): calculate shipping by region
Uses the new ZIP code range table.
Co-authored-by: Bruno Lima <[email protected]>
Signed-off-by: Ana Souza <[email protected]>
To add co-authors while writing a commit, see Co-authors.
Links and trailers only change how the message is shown. To remove a custom rule, use Remove.
- Preferences › Links in messages: everything on this page.
- The company policy can hide this Preferences page or make it read-only, with the id
inspectPlus.linksin thepreferences_hiddenandpreferences_lockedkeys. In that case, the page shows "set by your company". See Policy keys.