WorktreeWatcher

Says which files of the lanes' worktrees changed, for the change record.

Inherits QObject
Group libtrove

In the namespace octomy::trove::workspace. Declared in src/libs/libtrove/trove/workspace/WorktreeWatcher.hpp.

Detailed description

trove-unified-ui §TUI-D-8: the change record lists a file of a lane's worktree that a session changes. The watcher watches folders, not files, and only the folders that hold a tracked file, with their parents. A build folder that git ignores is never watched, and nothing under .git is. Phase 0 measured 4 079 such folders in a worktree of this repository, against a limit of 1 014 654 watches on y8 (§TUI-K-4.5).

What a folder watch hears

Qt watches a folder for an added, a removed, a moved and a renamed entry, and for a change of its attributes. It does not watch for a write into a file (the inotify mask of qfilesystemwatcher_inotify.cpp has no IN_MODIFY for a folder). So a file that a program writes in place makes no event, and a file that an editor saves through a rename does. The board calls scan() at the end of each turn of a session, which finds the writes in place.

A change is a difference from the last state of the folder: a file that is new is "added", a file that is gone is "removed", and a file whose time of change or size differs is "changed". A file in a watched folder that git does not track counts too: it is a change of the worktree, as a new source file that the session did not add yet.

A worktree that does not fit

When the folders of a worktree exceed the watches that are left, or the system refuses a watch, that worktree is watched by scan() only, and usesFallback() says so.

See also ChangeRecordModel.

In this section