-
-
Notifications
You must be signed in to change notification settings - Fork 303
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
Xdg basedir spec #2316
Xdg basedir spec #2316
Conversation
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.
I don't think we should break existing users' setups like this. Also, please try to use consistent code style to match the existing code.
Thank you for your effort. Never break my existing setup! Nor any usr's existing setup for that matter. As @sl4mmy already mentioned there should be a soft migration path. If a usr has .taskrc leave it alone. Period. Never move usr stuff in any occasion on your own. Think of individual config environments or backup strategies, breaking badly w/o a use noticing right away! You cannot possibly know anything about local policies, decisions or prefs. Potentially destroying usr data is evil. Think of moving data or config files on a filesystem becoming full w/o proper checks or handling them atomically at all. Possibly rendering usr data unusable, corrupt or into entirely oblivious bit noise. May BOFH get hold of you if you do! |
Thanks for the migration plan ideas and the review comments in general. I'll fix the formatting stuff, please review my proposed migration plan here #2316 (comment) Also if one of you has ideas around #2316 (comment) they're most welcome |
I added support for legacy file paths as requested. Please note that the changes here shouldn't be merged in to Once the other PR is merged in, I will create a new PR in taskwarrior that upgrades libshared to the latest version. |
My last concern is around windows support - I take it windows isn't supported outside of cygwin environments? If so, I don't expect any issues on that front. |
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.
I haven't actually tried your latest changes yet, but they read nicely to me. Thanks for updating your PR and incorporating our feedback! 👍
I'm against XDG, always have been. Relocating the config file and data directory has been supported for 14 years. |
@pbeckingham indeed, there's already support for overrides, and I understand your view on the standard being nonsense. Yet this feature has been requested and thumbed up quite a few times by the community (#438 which itself references a previous issue, #1105, #2203, #2290) and 2 people have created PRs (#2248, #2316), or people are developing their own workarounds. Setting aside the quality of the standard for a moment: if you feel this PR is making the codebase dirty or goes against your vision, I get that, otherwise I'd like to request you reconsider not your opinion of the standard but the value this PR would bring to the community (and to the maintainers who wouldn't have to deal with this issue on a recurring basis!). - is there anything else I could do to help convince you that this PR is worth merging in? Apologies for insisting in this way, and thanks again for maintaining TW |
|
@jrabinow First of all, let me thank you for all the effort you put in here. To me, the discussion around supporting the XDG standard really comes down to two quite distinct issues:
While the answer to (1) can be subjective and ultimately comes down to user's preference (I for one, have no strong opinion, Paul does, and other participants that are raising the issue do as well, only the other way 🙂 ), the answer to the (2) is - yes, absolutely. I think we can currently agree the user who wants TW to comply with XDG has to jump through a couple of hoops, in particular:
That's objectively a lot of steps, especially for a wish that is likely to be encountered by first-time users (that are already trying to keep their $HOME tidy with XDG). So what could we do to be more accomodating for XDG users?
While (2) would take a bit more work, we can do (1) quite easily. Then making the transition easy would be a matter of putting the following into the default content of the
(with (1) implemented) If we manage to get environment variable support into taskrc parsing, the default content of the
(with (2) implemented) I'd be happy to help review and merge PRs implementing (1) and (if volunteers are found) (2) into the codebase. But having (1) implemented would already alleviate 80% of the pain experienced here for 20% of the effort. |
Right, so 1/ is already implemented by this PR. I used a directory This PR also changes taskwarrior to check |
No, you're right. This is the right way to do it,
Let's keep the default for new users to
Let;s remove this for now. A general environment variable mechanism in the taskrc (aka what we refer to as (2) above) would be preferred.
This will not be actually needed, we are not actually doing an override through the env-var, so the header message should not be generated. I was just mentioning that above that this is what happens if one tries to get XDG setup working with using custom
I'd also remove the message warning users about using "legacy" taskrc location if they use ~/.taskrc, as the aim of (1) as discussed above is not to deprecate current directory layout, but to provide better support for XDG-driven alternative. Thank you for the patience! |
@jrabinow Any chance of addressing the above? Given that I'd be happy to merge this :) |
Hi @tbabej sorry I wanted to get to it this week-end, but unfortunately that proved optimistic on my end... will get to it this coming week-end at latest. Hopefully I can find some time this evening or tomorrow evening, but no promises |
@tbabej ready for review :-)
|
@jrabinow Julien, thanks for the hard work here. Tested and works as expected. |
Hi @tbabej thank you for reviewing and merging (and sorry about the formatting 😬 ) I have a question about this commit. To quote the spec: To me, with the added commit, this reads as if I explicitly set As a result I believe this last commit deviates from the spec and should be reverted - or am I missing something? |
The commit fixes a bug (another instance of falling for GothenburgBitFactory/libshared#32), but introduces another, as you correctly point out 😅 Fixed in f0e34a7. |
Got it, makes sense. Good catch! |
I'm sorry for necroing this but how would one go about using the features implemented here? Currently I still have to export |
https://github.com/GothenburgBitFactory/taskwarrior/blob/2.6.0/ChangeLog#L27 this changeset has not shipped yet. If you'd like to have the goods right away, the simplest option is probably to clone the repo and build the |
Got it, thanks @jrabinow. |
Description
Implements XDG Base Directory Specification
Motivation: https://farbenmeer.de/de/blog/the-power-of-the-xdg-base-directory-specification
I'm aware of this PR already being open. But it looks like it doesn't implement the full spec and seems to be going into limbo, so I gave this a shot.
With these changes, taskwarrior still supports the current file locations, but make the new locations the default for new users. As suggested by @corbolais here, if files exist in both old and new locations, taskwarrior will print a warning and uses the old locations.
This is the first C++ code I've ever written -> improvement suggestions welcome.
Additional information...