-
-
Notifications
You must be signed in to change notification settings - Fork 848
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
exec: Execute batches before they get too long #1020
Conversation
Based on sharkdp/argmax#5. Currently some tests fail because they expect the arguments to be sorted. That seems hard to do. If you're okay with it, I'll fix the tests to ignore the order. |
20ad77e
to
6538190
Compare
Hmm, all the runners are failing with
I thought it was due to the git dependency on $ cargo clippy --locked --all-targets --all-features
...
Finished dev [unoptimized + debuginfo] target(s) in 0.03s Any ideas? |
I even tried running the exact workflow locally with https://github.com/nektos/act and it passed. Very confused. |
https://github.com/sharkdp/fd/runs/6596619198?check_suite_focus=true#step:5:1 I think I know what's happening: CI is testing the merge with |
te.assert_output( | ||
&["foo", "--batch-size", "0", "--exec-batch", "echo", "{}"], | ||
"./a.foo ./one/b.foo ./one/two/C.Foo2 ./one/two/c.foo ./one/two/three/d.foo ./one/two/three/directory_foo", | ||
); |
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.
Why was this removed? Because it could fail on a hypothetical platform with a very low argmax limit?
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.
Ah no, because it makes assumptions about the sort order. Ok. I guess it's not really worth the effort. This path is already tested sufficiently in other tests.
if !self | ||
.cmd | ||
.args_would_fit(iter::once(&arg).chain(&self.post_args)) | ||
{ | ||
self.finish()?; | ||
} |
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.
Very nice ❤️
Really clear implementation. I also performed some successful local tests. No questions left 😄. |
Sorry I didn't get to reviewing this sooner, but nice work @tavianator |
Thanks @tmccombs! |
Fixes #410.