Repository navigation
Question about work trees? #32
|
How would I catch file edits and/or watch file edits in a git work tree which is a completely different directory then the main repo? |
Replies: 1 comment 1 reply
|
Point # Install the optional watcher dependency in your codebase-index environment.
python -m pip install "codebase-index[watch]"
codebase-index --root /absolute/path/to/worktree index
codebase-index --root /absolute/path/to/worktree watch --debounce 500
codebase-index --root /absolute/path/to/worktree search "your query"Each checkout gets its own I checked this with 2.1.2 on macOS using a real linked worktree outside the main repository directory. Editing a Markdown file triggered an incremental update, and a search returned the new contents from the worktree's index. The check covered filesystem events and text indexing. Sources: watch installation, watcher root, root discovery. |
Point
codebase-indexat the worktree directory itself. The watcher watches its configured root recursively; starting it in the main checkout does not automatically watch other linked worktrees.--rootis a global option, so put it beforeindexorwatch. The first command builds the index; the second keeps running and updates it after edits. Query that same root:codebase-index --root /absolute/path/to/worktree search "your query"Each checkout…