Skip to content

fix(core): restore parcel watch for git HEAD - #41616

Open
rekram1-node wants to merge 2 commits into
v2from
git-head-watch
Open

fix(core): restore parcel watch for git HEAD#41616
rekram1-node wants to merge 2 commits into
v2from
git-head-watch

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

What

git checkout no longer updates the TUI/server branch label. #41096 stopped the recursive project watch (good) but also replaced the bounded .git Parcel watch with a Bun fs.watch on the HEAD file.

Git updates HEAD by renaming HEAD.lockHEAD. Parcel/FSEvents sees that; Bun's fs.watch does not (Node does). Vcs never refreshes, so vcs.branch.updated never fires and the boot-time branch sticks. Existing tests still passed because they write HEAD in place.

dev already does the tight version: one Parcel watch on the git dir, ignore everything except HEAD. This restores that, plus HEAD.lock, without bringing back the whole-tree watch.

Test plan

  • cd packages/core && bun test test/filesystem/watcher.test.ts test/vcs.test.ts
  • opencode2 service restart, then git checkout and confirm the TUI branch label updates

Bun fs.watch misses git's atomic HEAD.lock rename, so checkout never
refreshed the cached branch. Watch the git dir with Parcel like dev,
keeping only HEAD and HEAD.lock.
LocationWatcher only existed to republish git/hg metadata as
filesystem.changed for Vcs. Nothing else consumed those events.
Vcs now owns the Parcel watch, same as skills and config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant