๐Ÿ–ฅ๏ธCLI Basics

Command summary

Plz has 3 basic commands to help manage your reviews.

  • plz review - Our โ€œpushโ€ operation. Examines your local branch of commits and creates or updates the corresponding PRs in GitHub.

  • plz sync - Our โ€œpullโ€ operation. Updates your local branch with the state of any of the reviews in that stack from GitHub.

  • plz status - Show local state for each review in the stack.

There's also a plz auth command that you'll need to run initially in order to use the CLI. Follow the instructions provided to authorize usage of the plz CLI on your behalf.

Working with reviews

Create a new review

On a working branch, first create a commit with your code changes, then run plz review:

$ git commit -a -m 'Skip rebase when the old and new bases are the same'
  [work 0a2ea7b] Skip rebase when the old and new bases are the same
  2 files changed, 2 insertions(+)
$ plz review
  0babae5b Skip rebase when the old and new bases are the ... created https://plz.review/review/55

Examine a reviewโ€™s local state

Show the local revision and other state:

$ plz status
  0babae5b Skip rebase when the old and new bases are the ... (rev 1, current) https://plz.review/review/55

Pull the latest revision

When your PR changes, e.g. due to a base branch change, pull the changes:

$ plz sync

Amend an existing review

Amend your commit, then run plz review:

$ git commit -a --amend --no-edit
  [work 70fd803] Skip rebase when the old and new bases are the same
  2 files changed, 2 insertions(+)
$ plz review
  70fd803b Skip rebase when the old and new bases are the ... updated https://plz.review/review/55

Working with stacks

Add a review to the stack

On a working branch with an existing unmerged commit, create a second commit and run plz review:

$ git commit -a -m 'Support direction parameter for linkedRevisions'
  [work 44d4014] Support direction parameter for linkedRevisions
  1 file changed, 1 insertion(+)
$ plz review
  f7c59230 Support direction parameter for linkedRevisions    created   https://plz.review/review/57
  70fd803b Skip rebase when the old and new bases are the ... unchanged https://plz.review/review/55

Examine the stack

Show local state for each review in the stack:

$ plz status
  f7c59230 Support direction parameter for linkedRevisions    (rev 1, current) https://plz.review/review/57
  70fd803b Skip rebase when the old and new bases are the ... (rev 1, current)         https://plz.review/review/55

Sync your local state with your origin

In case youโ€™ve merged or revised an upstream review, synchronize your local state with your origin (GitHub, in our case):

$ plz sync

Modifying a review that's part of a stack

$ git rebase -i main

Now update the rebase commands to edit the appropriate commit, e.g.:

edit f8bd022 Support direction parameter for linkedRevisions
pick ef534a4 Fix exposed 0 in baseline check

Make any desired code changes, and then run:

$ git commit -a --amend --no-edit
  [detached HEAD 3927990] Support direction parameter for linkedRevisions
  Date: Sat Apr 23 10:14:50 2022 -0400
  1 file changed, 1 insertion(+)
$ git rebase --continue
  Successfully rebased and updated refs/heads/work.
$ plz review

The final plz review command will update the PR branch and any subsequent PRs in your stack.

More CLI details: Refer to the full CLI User Guide for much more detail on using plz commands.

Last updated