review
Review with Baz
Review a set of changes and report what is actually wrong with them. $ARGUMENTS carries the scope flags (all optional).
What makes this review different from reading the diff yourself: Baz's indexed search lets you check the change against code that isn't in this checkout. A signature change that looks safe here can break a caller in another repo. Finding that is the point of this command — see Step 3.
Reviewing is read-only. Do not edit files, amend commits, or push. The one exception is the --fix loop in Step 6, which runs only after the user approves specific findings.
Step 1: Resolve the scope
Parse $ARGUMENTS, then build the diff.
Resolve the base branch first, and confirm the ref actually resolves before you diff against it — --base <branch> overrides all of this. Walk the ladder in order, taking the first that resolves under git rev-parse --verify:
git symbolic-ref refs/remotes/origin/HEAD— the remote's declared default. Commonly absent in a fresh or CI clone; that is expected, fall through.origin/main, thenorigin/master.main, thenmaster(local branches, for a repo with no remote).- Nothing resolved — you are most likely in a shallow or
--single-branchclone, where the base branch simply isn't in the object store. Do not diff againstHEAD~1and hope. Rungit fetch --depth=100 origin <branch>to pull the base in, or ask the user which base to use. Say which one you did.