Skip to content

Mitigate watch -d breaking change#16473

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

Mitigate watch -d breaking change#16473
sholderbach merged 2 commits intonushell:mainfrom
132ikl:watch-mitigate-break

Conversation

@132ikl
Copy link
Copy Markdown
Member

@132ikl 132ikl commented Aug 19, 2025

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
Copy link
Copy Markdown
Member Author

132ikl commented Aug 19, 2025

whoops forgot to push

@sholderbach sholderbach merged commit 2715992 into nushell:main Aug 19, 2025
16 checks passed
@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 <sholderbach@users.noreply.github.com>
@WindSoilder WindSoilder added the notes:deprecations Include the release notes summary in the "Deprecations" section label Aug 22, 2025
@132ikl 132ikl added notes:ready The "Release notes summary" section of this PR is ready to be included in our release notes. notes:hide This PR should only appear in the "Full Changelog" section and removed notes:deprecations Include the release notes summary in the "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 This PR should only appear in the "Full Changelog" section notes:ready The "Release notes summary" section of this PR is ready to be included in our release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants