-
Notifications
You must be signed in to change notification settings - Fork 346
feature: Move cache to its own directory to follow XDG standards. #2088
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
base: develop
Are you sure you want to change the base?
Conversation
|
This app supports |
|
Moreover, I believe that doing so will bring another benefit: when we want to delete |
Portable mode should still be supported is there anything I missed? |
Correct. When running on Mac or Windows everything is in a single directory. But on Linux it is two folders. The cache does not belong next to configuration files. |
…OME/SourceGit` on Linux (#2088) Old datas will be migrated automatically Signed-off-by: leo <longshuang@msn.cn>
…OME/SourceGit` on Linux (#2088) Old datas will be migrated automatically Signed-off-by: leo <longshuang@msn.cn>
|
I've pushed a commit that moves data from |
What else does source git store? It should be in .config if it's only configuration |
|
The files generated by |
On Windows? Correct But on Linux config files are in .config/appname |
|
I saw your commits you did that was basically what this PR is doing. But you are hardcoding the values of XDG dirs. They are env vars. Not static values. |
In my opinion, the TRUE configuration files (those that need to be placed in the Many modern softwares directly use
Actually, they are not the same.
Yes, this is intentional. I hope this path is preferably fixed and easy for users to find. |
…share/SourceGit` (#2088) Signed-off-by: leo <longshuang@msn.cn>
Ideally they should be edited by the GUI but it has nothing to do where the files are actually stored. It just following a standard pattern.
No. Modern software does not put itself in ~/.app_name. Even git uses ~/.config/git/config
There is no point of hardcoding the paths when there is ENV vars to use. If an advanced user has their XDG_CONFIG_HOME set to /tmp. The app should follow it. Portable mode is for Windows only. CacheDir is set to application data and same with runtime dir. See the table here: |
|
Just run |
Now, |
And? Applications are adapting the XDG standard. If you google how to edit your gitconfig everyone says edit ~/.gitconfig. But git actually supports reading from ~/.config/git/config. You can read more about the standard here: https://wiki.archlinux.org/title/XDG_Base_Directory |
Okay. If you think it is more of a data file. Then that file should be in $XDG_DATA_HOME/SourceGit. But do not assume .local/share in the code. It is a env var for a reason. Avatars is not a data file. It is a cache. So it should be in $XDG_CACHE_HOME/SourceGit/avatars/ |
Cache should not be in the same directory as the configuration. It mostly only applies to linux.
See here for what each folder maps to https://xdg-net.github.io/Xdg.Directories/docs/defaults.html