Conversation
This changes the watch logic to watch sources of the chosen task's dependencies as well as its own sources. If you set `skip_deps`, we follow the old behaviour and only watch the task's own sources.
There was a problem hiding this comment.
Code Review
This pull request updates the watch command to include task dependencies when determining which files to monitor. It introduces a skip_deps check and uses the Deps utility to aggregate sources from all relevant tasks. Feedback suggests optimizing the glob collection by deduplicating source patterns and using more efficient iterator patterns to avoid unnecessary allocations.
Greptile SummaryThis PR extends Confidence Score: 5/5Safe to merge — the change is additive, backward-compatible, and follows existing patterns. No P0 or P1 issues found. The logic inversion (!self.glob.is_empty()) is correct, skip_deps correctly preserves prior behaviour, Deps::new is an existing constructor already used for the same task graph resolution elsewhere, and .unique() is a harmless deduplication improvement. tasks.clone() ensures the owned tasks vec is still available for the later task_args construction. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[mise watch starts] --> B{--glob provided?}
B -- Yes --> C[Use --glob patterns directly]
B -- No --> D{--skip-deps set?}
D -- Yes --> E[Collect sources from root tasks only]
D -- No --> F[Deps::new - build full dependency graph]
F --> G[deps.all - iterate all nodes including transitive deps]
G --> H[Collect and deduplicate all sources]
E --> I[unique deduplicate]
C --> J[Pass -f globs to watchexec]
I --> J
H --> J
J --> K[watchexec watches files and re-runs mise run on change]
Reviews (3): Last reviewed commit: "Merge branch 'main' into watch-deps" | Re-trigger Greptile |
This changes the watch logic to watch sources of the chosen task's dependencies as well as its own sources.
If you set
skip_deps, we follow the old behaviour and only watch the task's own sources.If you want this implemented some other way, let me know as i'm happy to rework as needed. The lack of this currently means the
watchtask is often too "dumb" (unaware of the graph) to be useful. If we can give it context, it means dev servers and other long running tasks become a lot more useful.If you're not interested, let me know and we can close 👍