Comments and threads

Tier:Free, Premium, Ultimate Offering:GitLab.com, Self-managed, GitLab Dedicated
History

GitLab encourages communication through comments, threads, and suggesting changes for code. Comments supportMarkdownandquick actions.

Two types of comments are available:

  • A standard comment.
  • A comment in a thread, which you canresolve.

You cansuggest code changesin your commit diff comment, which the user can accept through the user interface.

Places you can add comments

You can create comments in places like:

  • Commit diffs
  • Commits
  • Designs
  • Epics
  • Issues
  • Merge requests
  • Snippets
  • Tasks
  • OKRs

Each object can have as many as 5,000 comments.

Mentions

You can mention a user or a group (includingsubgroups) in your GitLab instance with@usernameor@groupname.GitLab notifies all mentioned users with to-do items and emails. Users can change this setting for themselves in thenotification settings.

You can quickly see which comments involve you, because GitLab highlights mentions for yourself (the signed-in user) in a different color.

Mentioning all members

History
The availability of this feature is controlled by a feature flag. For more information, see the history.

Avoid mentioning@allin comments and descriptions.@allmentions more than just the participants of the project, issue, or merge request, but all members of that project’s parent group. All these users receive an email notification and a to-do item, and might interpret it as spam.

When you enable this feature flag, typing@allin comments and descriptions results in plain text instead of mentioning all users. When you disable this feature, existing@allmentions in the Markdown texts are unchanged, and remain as links. Only future@allmentions appear as plain text.

Notifications and mentions can be disabled in a group’s settings.

Mention a group in an issue or merge request

When you mention a group in a comment, every member of the group gets a to-do item added to their to-do list.

  1. On the left sidebar, selectSearch or go toand find your project.
  2. For merge requests, selectCode > Merge requests,and find your merge request.
  3. For issues, selectPlan > Issues,and find your issue.
  4. In a comment, type@followed by the user, group, or subgroup namespace. For example,@alex,@alex-team,or@alex-team/marketing.
  5. SelectComment.

GitLab creates a to-do item for all the group and subgroup members.

For more information on mentioning subgroups, seeMention subgroups.

Add a comment to a merge request diff

When you add comments to a merge request diff, these comments persist, even when you:

  • Force-push after a rebase.
  • Amend a commit.

To add a commit diff comment:

  1. On the left sidebar, selectSearch or go toand find your project.
  2. SelectCode > Merge requests,and find your merge request.
  3. Select theCommitstab, then select the commit message.
  4. By the line you want to comment on, hover over the line number and selectComment(). You can select multiple lines by dragging theComment() icon.
  5. Enter your comment.
  6. To add your comment immediately, selectAdd comment now,or use the keyboard shortcut:
    • macOS:Shift+Command+Enter
    • All other OSes:Shift+Control+Enter
  7. To leave your comment unpublished until you finish a review, selectStart a review,or use the keyboard shortcut:
    • macOS:Command+Enter
    • All other OSes:Control+Enter

The comment displays on the merge request’sOverviewtab.

The comment is not displayed on your project’sCode > Commitspage.

note
When your comment contains a reference to a commit included in the merge request, it’s converted to a link in the context of the merge request. For example,28719b171a056960dfdc0012b625d0b47b123196becomes28719b17that links to https://gitlab.example.com/example-group/example-project/-/merge_requests/12345/diffs?commit_id=28719b171a056960dfdc0012b625d0b47b123196.

Reply to a comment by sending email

If you have“reply by email”configured, you can reply to comments by sending an email.

  • When you reply to a standard comment, it creates another standard comment.
  • When you reply to a threaded comment, it creates a reply in the thread.
  • When yousend an email to an issue email address, it creates a standard comment.

You can useMarkdownandquick actionsin your email replies.

Edit a comment

You can edit your own comment at any time. Anyone with at least the Maintainer role can also edit a comment made by someone else.

To edit a comment:

  1. On the comment, selectEdit comment().
  2. Make your edits.
  3. SelectSave changes.

Edit a comment to add a mention

By default, when you mention a user, GitLabcreates a to-do item for them, and sends them anotification email.

If you edit an existing comment to add a user mention that wasn’t there before, GitLab:

  • Creates a to-do item for the mentioned user.
  • Does not send a notification email.

Prevent comments by locking the discussion

You can prevent public comments in an issue or merge request. When you do, only project members can add and edit comments.

Prerequisites:

  • In merge requests, you must have at least the Developer role.
  • In issues, you must have at least the Reporter role.

To lock an issue or merge request:

  1. On the left sidebar, selectSearch or go toand find your project.
  2. For merge requests, selectCode > Merge requests,and find your merge request.
  3. For issues, selectPlan > Issues,and find your issue.
  4. In the upper-right corner, selectMerge request actionsorIssue actions (), then selectLock discussion.

GitLab adds a system note to the page details.

You must unlock all locked discussions in closed issues or merge requests before you can reopen the issue or merge request.

Add an internal note

History

Use internal notes to protect information added to apublicissue, epic, or merge request. Internal notes differ from public comments:

  • Only project members with least the Reporter role can view the internal note.
  • You can’t convert internal notes to regular comments.
  • All replies to internal notes are also internal.
  • Internal notes display anInternal notebadge and are shown in a different color than public comments:

Internal notes

Prerequisites:

  • You must have at least the Reporter role for the project.

To add an internal note:

  1. On the issue, epic, or merge request, in theCommenttext box, enter a comment.
  2. Below the comment, selectMake this an internal note.
  3. SelectAdd internal note.

You can also mark an entireissue as confidential, or createconfidential merge requests.

Show only comments

In discussions with many comments, filter the discussion to show only comments or history of changes (system notes). System notes include changes to the description, mentions in other GitLab objects, or changes to labels, assignees, and the milestone. GitLab saves your preference, and applies it to every issue, merge request, or epic you view.

  1. On a merge request, issue, or epic, select theOverviewtab.
  2. On the right side of the page, from theSort or filterdropdown list, select a filter:
    • Show all activity:Display all user comments and system notes.
    • Show comments only:Display only user comments.
    • Show history only:Display only activity notes.

Change activity sort order

Reverse the default order and interact with the activity feed sorted by most recent items at the top. GitLab saves your preference in local storage and applies it to every issue, merge request, or epic you view.

To change the activity sort order:

  1. Open theOverviewtab in a merge request, issue, or epic.
  2. On the right side of the page, from theSort or filterdropdown list, select the sort order Newest firstorOldest first(default).

View description change history

Tier:Premium, Ultimate Offering:GitLab.com, Self-managed, GitLab Dedicated

You can see changes to the description listed in the history.

To compare the changes, selectCompare with previous version.

Assign an issue to the commenting user

You can assign an issue to a user who made a comment.

  1. In the comment, select theMore Actions() menu.
  2. SelectAssign to commenting user: Assign to commenting user
  3. To unassign the commenter, select the button again.

Create a thread by replying to a standard comment

When you reply to a standard comment, you create a thread.

Prerequisites:

  • You must have at least the Guest role.
  • You must be in an issue, merge request, or epic. Threads in commits and snippets are not supported.

To create a thread by replying to a comment:

  1. In the upper-right corner of the comment, selectReply to comment() to display the reply section.
  2. Enter your reply.
  3. SelectReplyorAdd comment now(depending on where in the UI you are replying).

GitLab converts the top comment to a thread.

Create a thread without replying to a comment

You can create a thread without replying to a standard comment.

Prerequisites:

  • You must have at least the Guest role.
  • You must be in an issue, merge request, commit, or snippet.

To create a thread:

  1. Enter a comment.
  2. Below the comment, to the right ofComment,select the down arrow ().
  3. From the list, selectStart thread.
  4. SelectStart threadagain.

Create a thread

Resolve a thread

History

You can resolve a thread when you want to finish a conversation.

Prerequisites:

  • You must be in an epic, issue, task, objective, key result, or merge request. For epics, your administrator must haveenabled the new look for epics.
  • You must have at least the Developer role or be the author of the issue or merge request.

To resolve a thread:

  1. Go to the thread.
  2. Do one of the following:
    • In the upper-right corner of the original comment, selectResolve thread().
    • Below the last reply, in theReplyfield, selectResolve thread.
    • Below the last reply, in theReplyfield, enter text, select theResolve threadcheckbox, and selectAdd comment now.

Additionally, in merge requests, you cando more with threads, such as move unresolved threads to an issue or prevent merging until all threads are resolved.

Summarize issue discussions with Duo Chat

Tier:Ultimate with GitLab Duo Enterprise -Start a trial Offering:GitLab.com, Self-managed, GitLab Dedicated
History

Generate a summary of discussions on an issue.

Prerequisites:

  • You must have permission to view the issue.

To generate a summary of issue discussions:

  1. In an issue, scroll to theActivitysection.
  2. SelectView summary.

The comments in the issue are summarized in as many as 10 list items. You can ask follow up questions based on the response.

Data usage:When you use this feature, the text of all comments on the issue are sent to the largelanguage model listed on the GitLab Duo page.