-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
support default config paths when RIPGREP_CONFIG_PATH isn't set #1719
Comments
This was recently discussed in #1668, but unbelievably, the user who opened that issue deleted it. Sigh. And unfortunately, my email record of it only includes the user's comments, not mine. And unfortunately, the Internet Archive does not have it. So I guess I'll re-litigate it. I've updated my notification settings so that I should now receive emails including my own replies.
I don't think it has actually. And even if it has, I'm not sure that I want to do it anyway. The
Personally, I am not sympathetic to this. My environment is littered with oodles of variables. And even so, I don't think it's a problem worth solving. That is, I don't perceive this as a real problem that many users experience.
That's a good one, but |
I certainly won't delete this thread :) I did try to search for previous incarnations but found none.
I think that's up to personal preference, but I see not being forced to litter one's global environment akin to not being forced to litter one's home directory with "dot files". This is the same reasosn why many tools are being lobbied to accept
You'd keep backwards compatibility for sure, but I also imagine that the vast majority of users would gradually switch to the default location. That seems like the best of both worlds to me :) |
As an aside, I'm very surprised that an external user can delete their thread and, by extension, delete the repo owner's comments as well. This seems like bad design. At most, they should be able to delete their own comments, but not take the entire thread down with them. Only the admins should be able to take that nuclear option. |
Hm, actually, I can't find any delete button in this issue, for example. Maybe it was a report that resulted in a deletion by GitHub staff. Have you reached out to them? |
Unfortunately this is a problem on Windows where you are limited to 32K bytes of environment variables. And I've hit that limit a few times. Although, I doubt this being a problem for most people. |
Hi @BurntSushi, at least part of the 1668 conversation is in the google cache of the gitmemory site: |
Here is a comment from @BurntSushi from there: Thanks. Yes, this is a sore topic for me. Because people continually underestimate the difficulty and complexity involved in this. Even after I told you how hard it was, you just kind of shrugged it off and pointed me to functions that get the home directory of a user, but that isn't the hard part. Not even close. Even just describing the complexity of loading configuration files takes time, because the process for it is very different across Linux, macOS and Windows. (And even that is a controversial statement, because some people would prefer that Linux and macOS use the same process!)
I mean, I created ripgrep. It and its ancestors (ack and ag) are perhaps one of the most obvious examples that defaults matter. So this argument doesn't really need to be made. The point is whether setting a default in this case is worth the benefits. I don't need to be convinced that defaults have benefits in the first place. Given that you suggested dropping a config file into a user's $HOME directory, my guess is that you just simply aren't aware of the vociferousness of people who absolutely hate this. As a practical matter, I do not want to be the target of their zeal. Similarly, building out the infrastructure to get platform specific configuration file placement correct is just not something that I'm willing to spend my free time on. Somebody else has to do it. Some folks have, to varying levels of success. The directories crate is probably the best example, but I won't use it. (Partially due to a couple technical reasons, but primarily due to non-technical ones and I won't discuss those publicly.) With that said, I'd encourage you to examine the implementation of that crate to get an idea of just how complex the task is.
This ignores the costs of having both an environment variable and support for platform specific config directories, and the complexity of maintaining both instead of one.
I don't know what you're trying to show me with this link. Like, do you think I'm unaware that many tools plop config files into a user's home directory? I don't need to be shown that. There are a few final points remaining:
|
@thepudds Thanks! I guess reading that, not all of it is directly relevant to this issue. There were some peculiarities with the previous issue that I was addressing that don't really apply to this one. I think this issue comes down to whether it's worth adding support for default platform specific configuration files. One of the problems that I've said historically is that there aren't any crates yet that solve that problem to my satisfaction (which is still true, AFAIK). But even if there were, I'm not really convinced that setting an environment variable is enough of a problem to be worth adding this. Setting random env vars is a common practice I think, and I don't really buy the comparison with littering one's |
It's hard to look at the mountain of work that was done to make ripgrep possible and think that config files are too challenging. Considering the number of config related issues created and the hours you've poured into replying For those focused on the code, I don't touch rust, but a quick search shows a few options. e.g. https://github.com/cjbassi/platform-dirs-rs |
ripgrep has support for config files.
I consider this to be a comment made in bad faith. If you do it again, you won't be welcome here.
This also feels like bad faith to me. I understand the value of platform specific default configuration directories. I even addressed it in my comments above. I just don't think they provide enough value over setting an environment variable. I personally am getting pretty close to banning all discussion of config file location from this tracker. I initially believed that delegating the decision to an environment variable would be enough to satiate users: it's simple to understand and implement, permits putting the config file anywhere and you generally don't see folks complaining about setting env vars. Most of us probably have a lot set and an established mechanism to do so, regardless of platform. But lately, I've received a number of forceful and frustrating comments from users seemingly complaining that this isn't good enough. I have yet to see any compelling reason to reverse course. For that reason, I'm closing this issue. |
Thanks for the patience, @BurntSushi. I of course was not aware of the previous deleted thread when I opened this one. I sympathize with the struggle of having to say "no" to features in large open source projects and getting reactions because of that.
At least from my point of view, it's just "it would be nice to not clutter my global environment with an extra variable". Though I get that that's not a big deal and, ultimately, a subjective choice. It's not a hard-coded limitation, after all. |
This is an extension of #772. It reads:
It seems like the main reason was because Rust didn't have good software to do the right thing on all platforms in a nice way. It's been nearly three years, so I hope that situation has changed :)
I think this could be solved without going into project-specific or PWD-relative config files. Those use cases can continue to use explicit env vars like before, for now.
My personal use case is not needing to pollute my global environment to have a global ripgrep config file. Pretty much every other tool I use already knows to look in
~/.config/<name>/somefile
by default, and I think it's reasonable to expect the same here. Another advantage would be to create a standard for where such a config file should be, making "dotfiles" repos more consistent with their ripgrep config locations.The text was updated successfully, but these errors were encountered: