-
Notifications
You must be signed in to change notification settings - Fork 426
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
Conform to XDG directory specification #286
Comments
Hey @rpdelaney! Just want to confirm something. Can't we consider
Then,
Or even if the
Cache data should not be expected to be there. They are temp files after all. I am not sure if the Also, out of curiosity, why do you split |
Hey, thanks for the comments.
Yes, work-arounds like this are possible. But that's a client side work-around, not conformity with the freedesktop.org spec. I move my dotfiles around a lot. Consequently, apps that don't support the spec force me to do stuff like this: if [ -d "$XDG_CONFIG_HOME/gnupg/" ] ; then
export GNUPGHOME="$XDG_CONFIG_HOME/gnupg/"
else
echo "GNUPGHOME not found." >&2
fi My shellrc is full of stuff like this. Your approach would work too, but it has the same problem: apps that support the spec don't force me to do that at all. Also, they don't force me to fill up
...because the spec requires that such things be stored in a completely different directory. Since Or just to get a shell open:
Etc. Maintaining all those hacks for the pile of cli tools I use that don't support the spec is overhead that interferes with getting work done using these tools that people are so kindly providing. So the upshot of this is that yes, I can use tricks in the shell to emulate conformity to the spec, but that's extra work that would be obviated if tools like grip just conformed on their own without any manual intervention.
One of us is misunderstanding the other. I agree that cache data should not be expected to be there -- nevertheless, it is there. That's why I'm raising this issue.
Perhaps I'm misusing the term "state", but I don't want to win support for a particular interpretation of when we should decide to use the word "state". The point is that user configuration data (excluding authentication credentials) can be safely stored in
The cache data you mentioned. Or do you mean you would like a tarball of what I found? |
I fully understand this. I have myself a lot of env variables to deal with this.
Just to be sure about this, when you run
The
I might suggest for the next version to just include the XDG path, warning users to do the migration themselves. We may not need the Hi @joeyespo! Could provide a input here? This is a simple change, so I could submit a MR soon. Just want to be sure the dev sees this with good eyes. |
I'm not sure it's necessary to force people to migrate. You can just implement the spec and then fall back to old behavior. See this PR for Edit: It would be a drawback to lose support for |
It looks like Moving the cache, I don't see how to do that yet |
Sure! No problem! The important thing is to get rid of
Here is the thing. I think that since we are using a single config file
Here you need to be somewhat carefully. You can support the XDG with this like I did on my comment. But you would also change the expected behaviour if you allow this and change Anyways, do as you wish. I really would like to help you more, but I am more busy now than I expected. |
@joeyespo care to weigh in? I'm inclined to maintain backward compatibility, but there are other opinions. |
I'm open to it. I need to think more about it before committing though. Will revisit soon. |
I'd be in favor of maintaining backwards compatibility, and I do think following the XDG spec is important.
Agreed. |
I'm still interested in this and happy to put a PR together. I would like to get some sort of green light from @joeyespo first though, to ensure that it would have a decent chance of being accepted. |
I just finished a similar feature in one of my own projects. Respect XDG with built-in upgrade capability: alichtman/shallow-backup@3189723 You're welcome to rip whatever from that commit you'd like to @rpdelaney. |
Looks like there's already a PR for this in #292 |
Oh, sweet. Any idea if/when it'll get merged? @joeyespo |
I find that configuration and state data is stored in
$HOME/.grip/
, including (but not limited to) in these files:~/.grip/cache-*
Users who do not expect state data to be stored here may accidentally back it up and synchronize it across systems improperly. Configuration data are fine, but prefer storing state data somewhere in
$XDG_DATA_HOME
and configuration data to$XDG_CONFIG_HOME
to conform to the freedesktop.org / XDG standard.Reference: https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
To implement a painless migration for existing users, you can consider reading
$XDG_CONFIG_HOME/grip/config.py
first, then falling back to$HOME/.grip/
. Likewise for cache data.The text was updated successfully, but these errors were encountered: