Hi,
I'm new on this mailing list so please tell me if the subject was
already discussed.
The Freedesktop XDG Base Directory specification
(https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)
aims to declutter the home directory by moving files where they should
be more logically located. Here i'll be talking about some directories:
* $XDG_CACHE_HOME, that defaults to the well-known $HOME/.cache
* $XDG_CONFIG_HOME, that defaults to the also well known $HOME/.config
* $XDG_RUNTIME_DIR, that should contain non-essential runtime files
such as socket files
For now 4 kind of files are put in the $HOME directory by git:
* .gitconfig | .config/git/config
it defaults to .gitconfig
* .git-credentials | .config/git/credentials from the credential-store
it also defaults to .git-credentials
* .cache/git/credentials | .git-credential-cache/ from credential-cache
this one defaults to .cache/git/credentials/
* .git-fsmonitor-%s for Darwin file system monitor.
I have 3 propositions:
## Move runtimes files to $XDG_RUNTIME_DIR
* .cache/git/credential/ -> $XDG_RUNTIME_DIR/git/credential/
* .git-fsmonitor-%s -> $XDG_RUNTIME_DIR/git/fsmonitor/%s
Those file shall be deleted at the end of the user session, so this is
the good place to store them.
## Move ~/.config/git/credentials to ~/.cache/git/credentials
Indeed this might contain sensitive information that some users don't
want to be backed up or synchronized.
A possibility would be to read ~/.cache/git/credentials,
~/.config/git/credentials, ~/.git-credentials, and to use the first
existing one.
## Default to XDG paths instead of home directory
It would just swap the priority of the two possible paths. It would also
only impact new installations as, if ~/.gitconfig exists, it would keep
being used.
The goal of those propositions is to declutter the home directory, and
ease the cleanup, backup and synchronisation of user settings.
Thanks for reading me.
Félix Piédallu