feat(canola-git): fix subdirectory signs, add watcher and porcelain highlights #37
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/canola-collection!37
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/canola-git-subdir-status"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
git status --porcelainoutputs paths relative to the repo root, butpopulate_cachefed them throughfirst_componentas-is. At the repo rootthis worked by coincidence; in any subdirectory the prefix mismatch meant
cache.statuskeys never matched entry names, so signs were silently absent.Solution
Compute the relative prefix between the browsed directory and the repo root,
strip it from each porcelain path before
first_component. Also adds threecomplementary improvements:
.gitdirectory watcher viavim.uv.new_fs_event— watches forindex/HEADchanges with 300ms debounce, only invalidates when a canolabuffer is visible. Handles worktree
.gitfiles. Provides real-timeupdates for the terminal-split workflow where neither
FocusGainednorBufEnterfires.BufEnterTTL — skips re-query if cache is <2s old, eliminatingredundant subprocess spawns on rapid buffer switching.
porcelainformat now rendersindex (X) and worktree (Y) characters with distinct highlight groups via
HlRangeTuple, e.g. staged-add + unstaged-modify showsAinDiagnosticOkandMinDiagnosticWarn.get_status()enrichment — addsindexandworktreeconveniencefields so consumers don't need to parse the raw porcelain XY pair.