Repository navigation
Conversation
Serie loaded the repository only once at startup, so switching branches, committing, rebasing or fetching in another terminal left the graph stale until the user pressed the refresh key or relaunched. Add an opt-in `--watch` (`-w`) flag and `core.option.watch` config option. When enabled, a background thread polls the modification time and size of `HEAD`, `packed-refs` and everything under `refs/` (for both the git dir and the common git dir, so linked worktrees are covered). Once a change is detected it waits until the files have been quiet for 500 ms, then sends a new `AppEvent::RepositoryChanged`. The app handles that event by calling the current view's existing `refresh()`, so it reuses the manual refresh path and keeps the current selection and view where possible. Polling avoids adding a new dependency. Default behavior is unchanged. Known limitation: a change that arrives while the help view is open is not applied until the next repository change, since that view has no refresh. Closes lusingander#199
This branch has not been deployed
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.
Closes #199
Summary
Adds an opt-in
--watch(-w) flag andcore.option.watchconfig option. When enabled, Serie refreshes the graph automatically when the repository changes (branch switch, commit, rebase, fetch, ...), keeping the current selection and view as the manual refresh does. Default behavior is unchanged.How it works
src/watch.rs) polls mtime/size ofHEAD,packed-refsand everything underrefs/, for both the git dir and the common git dir (so linked worktrees work).AppEvent::RepositoryChanged.refresh(), reusing the manual refresh path.Limitations
Testing
cargo fmt --check,cargo clippy --all-targets,cargo testpass.--watch.Docs updated (command-line options and config file format).