The gutter catches up when HEAD moves in another pane - #377
Merged
Merged
Conversation
A commit, checkout, reset or pull in another terminal pane doesn't touch the open files, so nothing told the editor to re-read HEAD and the gutter's markers stayed stale until the next save. HeadWatcher watches each open repo's git dir for HEAD and its common dir for packed-refs and refs/heads (recursively, for branches with a slash), debounced like DiskWatcher. GitRepository.Dirs resolves both from the filesystem, so a linked worktree follows its own HEAD and the shared branches. On a flush only HEAD, packed-refs and the branch HEAD names count, so `git status` rewriting the index re-reads nothing. A repo whose watch can't be set up re-reads a tab when it's shown instead. Closes #371 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
7 tasks
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 gutter now catches up by itself when
HEADmoves outside the editor. Commit, partially commit,reset --soft, switch branch or pull in another pane, and every open tab from that repo is marked against the newHEAD, including tabs that aren't showing. That works the same in a linked worktree. Tabs from other repos, and files outside any repo, aren't touched.Closes #371
Notes:
packed-refsre-reads, even agit pack-refsthat doesn't moveHEAD. Those are rare, and it's simpler than parsing the file to see whether the current branch moved.a-team try tuicode 377