documentation/REVIEW.md · main · 2026-10-12

Review Extension

Pull requests and feedback are commits on the gitmsg/review branch (GITREVIEW.md) of the author's repository. Reviewers get them when they follow or fetch that repository.

Initialize · Pull requests · Feedback · Forks · Flows · Reference

Initialize

gitsocial review init
gitsocial review config get|set|list

init is idempotent. It creates refs/gitmsg/review/config and the gitmsg/review branch.

Pull requests

gitsocial review pr create "Add dark mode" --base '#branch:main' --head '#branch:dark-mode' \
    [--reviewers [email protected],[email protected]] [--closes <issue-ref>] [--draft] [-l area/ui] \
    [--stack | --depends-on <pr-ref>] [--allow-unpublished-head]
gitsocial review pr list [-s open]
gitsocial review pr show <ref>
gitsocial review pr edit <ref> [--title ...] [--body ...] [--reviewers ...] [--closes ...]
gitsocial review pr update <ref>                       # record the current branch tips as a new version
gitsocial review pr diff <ref> [--from <n> --to <m>]   # range-diff between two versions
gitsocial review pr sync <ref> [--strategy rebase|merge]
gitsocial review pr merge <ref> [--strategy ff|squash|rebase|merge]
gitsocial review pr close <ref>
gitsocial review pr adopt <ref>                        # adopt a registered fork's pull request into this repository
gitsocial review pr retract <ref>
gitsocial review pr draft <ref> | ready <ref>
gitsocial review pr stack <ref> | rebase-stack <ref> | sync-stack <ref>

Feedback

gitsocial review feedback approve <pr-ref> [-m "LGTM"]
gitsocial review feedback request-changes <pr-ref> -m "Why"
gitsocial review feedback comment "Consider caching this" --pr <pr-ref> --commit <sha12> --file path/to.go \
    --new-line 42 [--new-line-end 50] [--old-line 40] [--old-line-end 48] [--suggest]

Feedback applies to the version that the reviewer saw, and a later version does not dismiss it. See Versions.

Forks

gitsocial fork add <fork-url>       # also `gitsocial review fork add|list|remove`
gitsocial fetch

fork add fetches the URL that you type; fork remove accepts each form of it, because GitSocial compares URLs by identity.

Pull requests from a registered fork show in pr list and create a fork-pr notification. When you merge or close a pull request of a fork, GitSocial adopts it into this repository and keeps the identity of its author.

Flows

Same repository

    Alice                            Bob
      │                               │
      ●  push dark-mode               │
      ●  pr create, push              │
      │  base=main, head=dark-mode    │
      │                               ●  fetch
      │                               ●  post inline feedback, push
      ●  fetch, push a fix            │
      ●  pr update, push              │
      │                               ●  fetch, approve, push
      ●  fetch, pr merge              │
      ●  the linked issues close      │

Cross-forge

Alice's repository is on GitLab and Bob's is on GitHub. Either can also be a bucket, and two buckets can be on different S3 providers.

The pull request is on Alice's gitmsg/review branch, and its base URL names Bob's repository. Bob's feedback is on his own branch and references her pull request by URL.

    GitLab (alice)                    GitHub (bob)
      │                                 │
      ●  push dark-mode                 │
      ●  pr create, push                │
      │  head=gitlab.com/alice/repo     │
      │  base=github.com/bob/repo       │
      │                                 ●  fork add alice's repository, fetch
      │                                 ●  post feedback, push
      ●  follow bob's repository, fetch │
      ●  push a fix, pr update, push    │
      │                                 ●  approve
      │                                 ●  pr merge: adopts the pull request into
      │                                 │  bob's repository, keeps its author

To name a bucket as the base, use its s3:// URL or a local reference such as #branch:main. A contributor reads a public bucket through its https:// domain.

Fork discovery

    Maintainer (upstream)                  Contributor (fork)
      │                                         │
      ●  gitsocial fork add <fork-url>          │
      │                                         ●  push feature
      │                                         ●  pr create, base=#branch:main
      ●  gitsocial fetch                        │
      │  fetches the fork's gitmsg/* branches   │
      │  and the heads of its open pull requests│
      ●  pr list shows the fork's pull request  │
      ●  notification: fork-pr                  │
      ●  review, merge                          │

GitSocial finds a pull request of a fork when its base is a local reference or names the workspace URL.

Versions

    Alice                                Bob
      │                                   │
      ●  pr create, head-tip=bbb          │
      │                                   ●  request changes
      ●  push a fix                       │
      ●  pr update, head-tip=ccc          │
      │                                   ●  fetch; pr show reads
      │                                   │  changes-requested (reviewed original, current is v1, code changed) [stale]
      │                                   ●  pr diff: range-diff of the two versions
      │                                   ●  approve

pr update records base-tip and head-tip as a new version, and the edits of the pull request are its version history.

FeedbackAfter a new version
approval or change request, same head tip or same patchescurrent
approval or change request, changed codestale
inline commentkeeps its commit and lines

GitSocial does not dismiss feedback automatically.

Stacks

    Alice                                        Bob
      │                                           │
      ●  pr create PR1   main ← middleware        │
      ●  pr create PR2 --stack                    │
      │  middleware ← routes, depends-on=PR1      │
      ●  pr create PR3 --stack                    │
      │  routes ← tests, depends-on=PR2           │
      │                                           ●  pr stack: every member
      │                                           ●  approve PR1
      ●  pr merge PR1: PR2 retargets to main      │
      ●  pr sync PR2: rebases it onto main        │
      ●  pr rebase-stack PR2: rebases PR3         │
      │                                           ●  approve PR2
      ●  pr merge PR2: PR3 retargets              │

rebase-stack rebases each member above the given one, records the versions, and stops at the first conflict. sync-stack records the tips and does not rebase. pr merge refuses a member whose dependency is not merged. A stack can include pull requests on different forges. gitsocial import review finds the stacks in imported pull requests from their base and head branches.

Other flows

Reference