Annotate diff lines while reviewing changes in magit — commits, staged and unstaged alike. Annotations are saved to REVIEW.md in the repo root.
> Code review:
> Annotations in the following format: <path>:<line>: [<sha>] Annotation
> C-c on a line to go to it (on HEAD)
## Committed
path/to/file:123: [a348a942] My annotation
## Staged (uncommitted; SHA is HEAD at time of annotation)
path/to/file:45: [a348a942] Another note
## Unstaged (uncommitted; SHA is HEAD at time of annotation)
Entries land in the section matching where you annotated. Range diffs (e.g. main..feature) record the range as-is instead of a SHA.
Press RET on any annotation line to jump to the file and line.
In packages.el:
(package! magit-review
:recipe (:host github :repo "YOUR_USER/magit-review"))In config.el:
(use-package! magit-review
:after magit)Then doom sync and restart.
- Show a diff: a commit from
magit-log(RET), the staged/unstaged hunks right in the status buffer, or a diff buffer (d s,d u,d r). - Move point to a diff line.
- Press
d nto annotate. - Type your note and hit
RET.
REVIEW.md opens in a side window; focus stays in magit.
Press d N from any magit buffer to open REVIEW.md.
| Key | Command | Description |
|---|---|---|
d n |
magit-review-annotate |
Annotate line at point |
d N |
magit-review-open |
Open REVIEW.md |
| Variable | Default | Description |
|---|---|---|
magit-review-file |
"REVIEW.md" |
Output file name |
magit-review-sha-length |
8 |
SHA abbreviation width |
make testBatch ERT suite. Dependencies are loaded from your straight.el build directory; point MAGIT_REVIEW_BUILD_DIR elsewhere to override.