-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deprecate glob --not
in favor of glob --exclude
#10827
deprecate glob --not
in favor of glob --exclude
#10827
Conversation
I like |
i do not use i've talked to 3 dev persons and one non-dev to have some insight and here are four ideas
i could live with option 3 but
|
I'd vote for |
let's go with |
glob --not
in favor of glob --prune
glob --not
in favor of glob --exclude
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
let's go with this then, hopefully a bit clearer 😇 |
follow-up to - #10827 > **Important** > wait for between 0.87 and 0.88 to land this # Description after deprecation comes removal... this PR removes `glob --not` in favor of `glob --exclude`. # User-Facing Changes `glob --not` will stop working. # Tests + Formatting # After Submitting i didn't find any use of `glob --not` in the `nu_scripts` so no update required there 👍
related to - nushell/nushell#10827 - nushell/nushell#10839 ## description `glob --not` has been deprecated in nushell/nushell#10827 and will be removed in nushell/nushell#10839 before 0.88.0 in favor of `glob --exclude`. this PR performs the change in `nu-git-manager`. Co-authored-by: Mel Massadian <melmassadian@gmail.com>
# Description looking at the [Wax documentation about `wax::Walk.not`](https://docs.rs/wax/latest/wax/struct.Walk.html#examples), especially > therefore does not read directory trees from the file system when a directory matches an [exhaustive glob expression](https://docs.rs/wax/latest/wax/trait.Pattern.html#tymethod.is_exhaustive) > **Important** > in the following of this PR description, i talk about *pruning* and a `--prune` option, but this has been changed to *exclusion* and `--exclude` after a discussion with @fdncred. this looks like a *pruning* operation to me, right? 😮 i wanted to make the `glob` option `--not` clearer about that, because > -n, --not <List(String)> - Patterns to exclude from the results from `help glob` is not very explicit about whether the search is pruned when entering a directory matching a pattern in `--not` or just removing it from the output 😕 ## changelog this PR proposes to rename the `glob --not` option to `glob --prune` and make it's documentation more explicit 😋 ## benchmarking to support the *pruning* behaviour put forward above, i've run a benchmark 1. define two closures to compare the behaviour between removing patterns manually or using `--not` ```nushell let where = { [.*/\.local/.*, .*/documents/.*, .*/\.config/.*] | reduce --fold (glob **) {|pat, acc| $acc | where $it !~ $pat} | length } ``` ```nushell let not = { glob ** --not [**/.local/**, **/documents/**, **/.config/**] | length } ``` 2. run the two to make sure they give similar results ```nushell > do $where 33424 ``` ```nushell > do $not 33420 ``` 👌 3. measure the performance ```nushell use std bench ``` ```nushell > bench --verbose --pretty --rounds 25 $not 44ms 52µs 285ns +/- 977µs 571ns ``` ```nushell > bench --verbose --pretty --rounds 5 $where 1sec 250ms 187µs 99ns +/- 8ms 538µs 57ns ``` 👉 we can see that the results are (almost) the same but `--not` is much faster, looks like pruning 😋 # User-Facing Changes - `--not` will give a warning message but still work - `--prune` will work just as `--not` without warning and with a more explicit doc - `--prune` and `--not` at the same time will give an error # Tests + Formatting this PR fixes the examples of `glob` using the `--not` option. # After Submitting prepare the removal PR and mention in release notes.
follow-up to - nushell#10827 > **Important** > wait for between 0.87 and 0.88 to land this # Description after deprecation comes removal... this PR removes `glob --not` in favor of `glob --exclude`. # User-Facing Changes `glob --not` will stop working. # Tests + Formatting # After Submitting i didn't find any use of `glob --not` in the `nu_scripts` so no update required there 👍
follow-up to - nushell#10827 > **Important** > wait for between 0.87 and 0.88 to land this # Description after deprecation comes removal... this PR removes `glob --not` in favor of `glob --exclude`. # User-Facing Changes `glob --not` will stop working. # Tests + Formatting # After Submitting i didn't find any use of `glob --not` in the `nu_scripts` so no update required there 👍
Description
looking at the Wax documentation about
wax::Walk.not
, especiallythis looks like a pruning operation to me, right? 😮
i wanted to make the
glob
option--not
clearer about that, becausefrom
help glob
is not very explicit about whether the search is pruned when entering a directory matching a pattern in--not
or just removing it from the output 😕changelog
this PR proposes to rename the
glob --not
option toglob --prune
and make it's documentation more explicit 😋benchmarking
to support the pruning behaviour put forward above, i've run a benchmark
--not
👌
3. measure the performance
👉 we can see that the results are (almost) the same but
--not
is much faster, looks like pruning 😋User-Facing Changes
--not
will give a warning message but still work--prune
will work just as--not
without warning and with a more explicit doc--prune
and--not
at the same time will give an errorTests + Formatting
this PR fixes the examples of
glob
using the--not
option.After Submitting
prepare the removal PR and mention in release notes.