Fix Rename events in watch#18115
Merged
cptpiepmatz merged 9 commits intonushell:mainfrom Apr 26, 2026
Merged
Conversation
IntoValue was not widely implemented for std types at the time of initial implementation, and an intermediate type was necessary.
Also refactor WatchEvent's TryFrom impl for conciseness
Previous values worked on linux and windows, but for some reason caused failures on macOS in CI
77bd72a to
1471088
Compare
cptpiepmatz
requested changes
Apr 25, 2026
Member
|
This also needs the notes for the changelog. |
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.
Description
watchWatchEventRecordtype previously used for easier conversion toValue.TryFrom<DebouncedEvent> for WatchEventand fix the order of paths inRenameevents.Renameevents where the source or destination path is outside of the watched directory.User-facing changes (Release notes)
Order of the paths reported for
Renameevents are now correct, whereas previously they were reported as if$new_pathwas renamed to$path.Additionally if one of these paths happened to be outside of the watched directory, previously the event was not reported at all, now they are reported with the path outside of the watched directory as
null.Additional notes
We should think about deprecating the optional closure parameter and only supporting the streaming version. The closure form
Removing the closure parameter would also make it possible to have a rest parameter which could be used to watch multiple paths.