Suggested changes
A reviewer can propose new code for lines of a pull request in a review comment. Anyone who may push to the pull request’s branch can then apply the suggestion with one click, and Arbinel commits it to that branch. Forgejo has no suggested changes.
Suggest a change
Section titled “Suggest a change”-
On the Files changed tab of the pull request, select the + button of the line to comment on. To comment on several lines, hold Shift, press the + button of the first line and drag to the last one.
-
In the comment form, select Suggest a change in the toolbar. Arbinel inserts a suggestion block with the content of the lines.
-
Edit the lines in the block, and add any text you want around it.
-
Select Start review or Add single comment.
A suggestion block is a fenced code block with the info string suggestion.
You can also type it yourself:
The block replaces all the lines the comment covers. An empty block suggests deleting them. A comment may hold more than one block, as alternatives, and each block gets its own Apply suggestion button.
Suggestions work only on the new side of the diff, so the Suggest a change button is missing on removed lines. They also work only in text files.
Apply a suggestion
Section titled “Apply a suggestion”Arbinel shows each suggestion in the comment as a diff of the current lines and the suggested ones. Select Apply suggestion to commit it to the pull request’s branch.
The button is shown to people who may push to that branch. That is the same rule that lets them edit the branch’s files from the diff, including maintainers of the base repository when the author allows edits from maintainers. Branch protection applies as for any other push.
Arbinel makes the commit as the person who applies the suggestion, with the message Apply suggestion from code review.
When the reviewer is somebody else, the message credits them with a Co-authored-by trailer.
Applying a suggestion also resolves its conversation, if the person applying it may resolve conversations.
A suggestion cannot be applied in these cases:
- Its review is still pending. Submit the review first.
- The lines changed after the comment was made, for example by a later push or another suggestion. Arbinel then marks the suggestion as outdated.
- The comment was edited after you opened the page. Reload the page to see the current suggestion.
- The file is binary, stored in Git LFS, or larger than 8 MiB.
- The owner of the pull request’s branch is over quota.
- The pull request is closed or merged, or its branch is in a mirror or an archived repository.