-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
Fix Issue 17844 - std.process.execute should allow not capturing stderr #5742
Conversation
6f46d4e to
113d10c
Compare
|
Thanks for your pull request, @CyberShadow! Bugzilla references
|
|
Picking a good name for this flag is a bit tricky, because there is a |
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.
Ugh, I hate the way this is specified, regardless of the name. In hindsight, stderr should not have been automatically redirected without being told to do so.
When I first read passStderr without ingesting the whole change and bug report, I thought it was a way to pass a specialized stderr to the child. Really what it should be is passThroughStderr, or maybe ignoreStderr. What you are doing is leaving the stderr setup alone.
Anyway, that's my 2 cents. IMO, the default should be to ignore stderr in the output, as the bug report says, but of course, that may break people's expectations and code.
Another option is to reverse the boolean meaning and make it a positive. i.e. includeStderr. Then you make the config default value Config.includeStderr. This will only break if someone both needed to specify parameters after the config parameter (and likely passed Config.none), or they needed to specify config values to the pipe function, AND they expected stderr output to come back in the return value. Likely breaking any code is not worth considering.
Another more drastic option is to rewrite the API and change the function names, going through a deprecation cycle to get people onto the correct API.
In any case, I can live with the name as you have it, it's terrible, but not many good options.
Agreed.
Interesting you should mention those name suggestions. My initial idea was We can go with |
|
|
113d10c to
ec3e258
Compare
|
@schveiguy: |
Well, there's industry precedent with
Did you read the above discussion and bug report? If we could make it the default, we would. I'm not going to change the name again without a substantial argument. |
|
It's OK to use |
Of course I did. On average, the name will maybe be used in, what, one in every 10 000 lines of D code, at most? That's not frequent enough to try and be cute just to save those three characters.
Your initial proposal from a few comments up was
That implication is fallacious. The situation where it is confusing is not when reading code, but when writing it. You are looking for a parameter you probably remembered as "pass through stderr". Since we've by and large done quite a good job with keeping the names consistent in Phobos, you can be reasonably sure that it is going to be named The spelling "pass-thru" isn't in Merriam-Webster, while "pass-through" is. I'm not sure how there is even a discussion about this. At best, the two alternatives are equivalent (three characters saved out of If you are regularly working on code that handles subprocesses in D, you would of course remember the spelling soon enough. But when switching often between codebases and languages, it's exactly this sort of inconsistency that causes unnecessary friction. |
I don't think I would remember either name, even if I'm writing it often. Either way, it's a poor way to name it. It should really be the opposite (opt-in to receiving stderr output, not opt-out). I think we've spent too much time already debating it, just pick one and merge. |
Nobody is trying to be cute.
Nice attack on my character drawn out of an assumption. I have limited time and patience to go back-and-forth on the same nitpicking matters, as should everyone.
Neither is Meanwhile,
So was much of your post. It was very frustrating to read. Since you feel so strongly about the current name, I am going to change the name to |
ec3e258 to
71adbee
Compare
|
I'm assuming the name is good now. |
|
I realise that I am somewhat late in reviewing this now (sorry!), but I would like to add my comments anyway. And the first thing that comes to mind is that this actually changes something fundamental about Assuming it is, my second comment is that this change should be reflected in the main Thirdly, the documentation for the new flag should then specify that the flag actually has no effect on Again, sorry to be Johnny-come-lately here. |
|
All excellent points. I think the reason for using In reality, the best way to have fixed this (in hindsight) is to not have the automatic redirection of stderr to stdout, and let the user specify it in the config in the first place. But it's hard to undo that at this point. We should definitely update the docs to reflect the special nature of the new flag. |
|
Thanks Lars, good suggestions. I'll send a follow-up PR. |
|
-> #5744 |
No description provided.