Skip to content
Versora

Manual

Issues

Branch issue and reference in the commit

4 min read

On this page

When the name of the checked-out branch references an issue (such as feature/123-fix-login or feature/PROJ-123-fix-login), Versora shows that issue in the changes panel and helps you reference it in the commit and in the merge request. Referencing the issue in the right place makes GitLab and GitHub link the commit to the issue and close the issue when the commit reaches the default branch; in Jira, the key in the summary links the commit to the issue.

The rules for recognizing the issue from the branch name are in Issues.

The issue bar in the changes panel

Where to find it

  • Right panel (changes), above the commit box: the bar with the issue icon, the key, the title and the state of the current branch's issue.
  • Palette (Ctrl+P): "Open the current branch's issue" (the detail shows the key and the title).

What you can do

  • Clicking the key or the title opens the issue in the browser (the tooltip shows the key, the title and the address).
  • The open in browser button does the same (tooltip: "Open the issue in the browser").
  • Right-clicking the bar: Open in browser, Copy link and Copy #123.

Bar states

  • While the issue loads: "#123 loading…".
  • If the query failed: "Couldn't load issue #123." with Try again.
  • If the number in the name isn't that of an existing issue (for example, 2024-planos), the bar doesn't appear.
  • Without an issue source in the repository, or with a branch that doesn't reference an issue, the bar doesn't appear either.

Adding the reference to the commit message

Where to find it

  • Commit box: the button with the reference text (for example, Closes #123 or PROJ-123), with the tooltip "Add "Closes #123" at the end of the description (Alt+I)".
  • Shortcut: Alt+I, with the changes panel open; it also works with the focus on the commit message. It doesn't act with a dialog open. You can change the key in Preferences › Keyboard shortcuts (see Customization).

Step by step

  1. Write the commit's summary and description as usual.
  2. Click the reference button or press Alt+I.
  3. The reference goes into the message, in the place set for the repository. The button then shows "#123 in message" and is disabled (tooltip: "The message already references #123").
  4. Make the commit (see Commits).

Where and how the reference goes in

The format and the place follow Preferences › Issues › Reference in the commit message. The defaults depend on the source:

SourceDefault formatDefault placeExample
GitLab, GitHubCloses #123at the end of the descriptionblank line and Closes #123 as the last line
JiraPROJ-123 (just the key)at the start of the summaryPROJ-123 Fix the login validation

The possible formats are Closes #123, Refs #123 and just the key (#123 or PROJ-123). "Closes" closes the issue when the commit reaches the default branch; "Refs" only links the commit to the issue.

The app doesn't write the reference again if the message already references the issue, in the summary or in the description.

Merge request already filled in with the issue

When you open the Create merge request (or Create pull request) form from a branch that has an issue, the app waits a few seconds for the issue and adjusts the text suggested from the commits:

  • GitLab and GitHub: the title becomes the issue's title, and the description gets Closes #123 on the first line (if it doesn't reference the issue yet);
  • Jira: the title becomes PROJ-123 Issue title, and the description starts with the link to the issue, in Markdown: Jira issue: [PROJ-123](https://empresa.atlassian.net/browse/PROJ-123).

A title or a description you've already edited in the form isn't replaced. See Create merge request.

What Versora does in git

Nothing beyond the usual commit: the reference is just text in the message. It's the server that closes the issue, when the commit with "Closes" reaches the project's default branch.

How to undo

The reference goes into the message field, before the commit: delete the text if you don't want it. After the commit, the message can be fixed with amend or with the interactive rebase (see History).

Caveats and messages

  • "The name of feature/login doesn't reference an issue (e.g., feature/123-…, PROJ-123-…).": appears when you use "Open the current branch's issue" on a branch that doesn't reference an issue.
  • "Couldn't load PROJ-123.": the referenced issue couldn't be read (no access, nonexistent or server down).
  • In the palette, "Open the current branch's issue" is unavailable with the reason: "detached HEAD: no branch", "the name of feature/login doesn't reference an issue" or "this repository has no issue source (see Preferences › Issues)".

Tip

With Jira, set the project key in Preferences › Issues. That way a branch with just the number (feature/123-…) is also recognized as PROJ-123.

  • Preferences › Issues › Reference in the commit message: format and place. See Configuring issues per repository.
  • Preferences › Keyboard shortcuts: the key for the "Add the issue reference to the message" action (default Alt+I).

See also