Checking out and reviewing a request locally

A request's commits on your Mac: in a worktree of their own, or in the Diff Review with its threads beside the lines.

The Files tab shows the provider’s diff, which brings no commits with it. Two commands fetch the request’s commits into your repository: Check Out in Worktree… and Review Locally. Both are in the request’s ⋯ menu and in the Command Palette while the section shows a request, as Check Out Pull Request in Worktree… and Review Pull Request Locally; Review Locally is also the review button in Files.

What is fetched goes into a private ref that History and the branch lists never show, and only when it is the commit the provider reported for the request; otherwise Innesta asks you to refresh the request. At most 20 are kept.

In a worktree

Check Out in Worktree… fetches the request and opens New Worktree on it:

  • on its source branch, for an open request from this repository;
  • on a new branch named pr/<number>-<source> (mr/ on GitLab) at its head, for a fork’s request or one that is closed or merged. The name can be changed.

Either way the request’s target becomes the branch’s base, so Review Changes in that worktree compares it with the target. Once a worktree has the branch, the command reads Open Worktree instead.

GitLab deletes the ref that holds a request’s head 14 days after the request is closed or merged, and fetching it then fails with Git’s own message.

In the Diff Review

Review Locally opens the Diff Review on the request’s commits against its target. It fetches only when the commits in your repository cannot show the provider’s diff. A second after Files shows an open request, Innesta downloads its commits in the background, so a review opened from there need not wait for a fetch. That download moves none of your remote-tracking branches and asks nothing of you; when it fails, Review Locally fetches as usual.

  • Viewed marks are kept for the request, so after a push only the files the push changed lose their mark.
  • Comments, the inspector beside the diff, lists the request’s threads on its files; pointing at one shows its lines, and Show in Diff opens its file.
  • Comment… on selected lines writes a comment in the inspector and posts it at once, as in the Files tab. A file’s menu in Files has Comment in Review Locally, which opens it here.

Comments can go on the lines only while the review shows what the provider’s diff shows. After Compared with another branch, the inspector offers to compare with the target again; otherwise it asks you to refresh the request and review it again.