Skip to content

Mitigate watch -d breaking change - #16473

Merged
sholderbach merged 2 commits into
nushell:mainfrom
132ikl:watch-mitigate-break
Aug 19, 2025
Merged

sholderbach merged 2 commits into
nushell:mainfrom
132ikl:watch-mitigate-break

Conversation

@132ikl

@132ikl 132ikl commented Aug 19, 2025 •

Copy link
Copy Markdown
Member

This PR reverts the breaking change of short flag change of watch -d to --debounce instead of --debounce-ms. This fully prevents #16187 from being a breaking change.

Before #16187:

watch -d 1000 foo {}
# => Now watching files at "/home/rose/foo". Press ctrl+c to abort.

Before this PR (after #16187):

watch -d 1000 foo {}
# => Error: nu::parser::parse_mismatch
# => 
# =>   × Parse mismatch during operation.
# =>    ╭─[entry #15:1:10]
# =>  1 │ watch -d 1000 foo {}
# =>    ·          ──┬─
# =>    ·            ╰── expected duration with valid units
# =>    ╰────

After this PR (after #16187):

watch -d 1000 foo {}
# => Warning: nu::parser::deprecated
# => 
# =>   ⚠ Flag deprecated.
# =>    ╭─[entry #3:1:7]
# =>  1 │ watch -d 1000 foo {}
# =>    ·       ─┬
# =>    ·        ╰── watch --debounce-ms was deprecated in 0.107.0 and will be removed in 0.109.0.
# =>    ╰────
# =>   help: `--debounce-ms` will be removed in favour of  `--debounce`
# => 
# => Now watching files at "/home/rose/foo". Press ctrl+c to abort.

This PR also fixes the DeprecationEntry which incorrectly had a -- in it, which I failed to realize when reviewing #16187. We should add a debug_assert or something for this.

Rel: #16187

Release notes summary - What our users need to know

N/A

Tasks after submitting

  • Add debug_assert for DeprecationType::Flags with --

@sholderbach

Copy link
Copy Markdown
Member

Good catch!

This PR also fixes the DeprecationEntry which incorrectly had a -- in it, which I failed to realize when reviewing #16187. We should add a debug_assert or something for this.

That part is not yet committed

@132ikl

132ikl commented Aug 19, 2025

Copy link
Copy Markdown
Member Author

whoops forgot to push

@sholderbach
sholderbach merged commit 2715992 into nushell:main Aug 19, 2025
@github-actions github-actions Bot added this to the v0.107.0 milestone Aug 19, 2025
sholderbach added a commit that referenced this pull request Aug 19, 2025
Added a `debug_assert` when using `DeprecationType::Flag` to ensure that
the dashes aren't included as part of the flag name. This will hopefully
catch something like the issue discovered in #16473 from occurring.

## Release notes summary - What our users need to know
N/A

---------

Co-authored-by: Stefan Holderbach <[email protected]>
@WindSoilder WindSoilder added the notes:deprecations Noted in "Deprecations" section label Aug 22, 2025
@132ikl 132ikl added notes:ready Indicates Ready for Release notes notes:hide Noted only in "Full Changelog" section and removed notes:deprecations Noted in "Deprecations" section labels Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:hide Noted only in "Full Changelog" section notes:ready Indicates Ready for Release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants