Repository navigation
feat(review): say in the footer when the diff changed on disk - #170
Merged
Merged
Conversation
backnotprop
force-pushed
the
feat/review-disk-notice
branch
from
November 20, 2026 01:27
f5ca9fe to
194613d
Compare
Every few seconds a worker thread takes a cheap stamp of what the scope's diff depends on: one git status (porcelain v2, --no-optional-locks, so it never takes the index lock) and the mtime and size of each file it lists. When the stamp differs from the one taken after the last capture, the footer says "the diff changed on disk · r refreshes". Nothing reloads by itself. One check at a time, never alongside a reload's capture, none while the comment box is open or within 1.5 s of a key, and a slow repository is checked less often (50 times the last check's duration, at least 3 s). Commit and pull request reviews have nothing on disk to watch and start no thread.
backnotprop
force-pushed
the
feat/review-disk-notice
branch
from
November 20, 2026 01:41
194613d to
d8dc722
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The code review screen now says in the footer when the diff changed on disk, for example after an agent edits files:
the diff changed on disk · r refreshes. Nothing reloads by itself.rrefreshes as before, and notes follow their lines exactly as they do withrtoday.How it checks
Repo::disk_stamp(scope)(newstampmodule inplannotator-tui-review) runs onegit --no-optional-locks status --porcelain=v2 -z --branch --untracked-files=all --no-renames. It hashes HEAD's commit, the records, and the mtime and size of each listed file. The mtimes catch a changed file that changes again, which status alone reports the same way. With--no-optional-locks, status never takesindex.lockand never rewrites the index, so it cannot get in the way of the agent's own git commands.ghcall to the network every few seconds, which is not cheap.rstill recaptures it.When it checks (
review/watch.rs)Measured (
disk_stampon the uncommitted scope, release build, median of 20, Apple silicon):r)Most of the time in a large repository is the untracked-file scan (sentry: 30 ms with
--untracked-files=no). Repositories that enablecore.untrackedCacheorcore.fsmonitorget faster checks automatically.Tests: stamps against real repositories (a second edit of a changed file, an untracked file and its removal, a commit, staged versus work tree, no watch for commits and PRs). Screen flows: the notice appears and
rclears it with the note moved, no check starts while the comment box is open or right after a key, and a commit review starts no checks.Docs: README (code review section and key table) and the
?help screen.Checked by hand in tmux on a scratch repository: a note, an edit from outside, the notice about 2 s later,
rwith the note moved. With the comment box open, an edit from outside caused no check for 8 s. The notice appeared about 2 s after the box closed.