Git Mailing List Archive mirror
 help / color / mirror / Atom feed
* Declutter the home directory
@ 2023-11-12 12:10 Félix Piédallu
  2023-11-12 13:39 ` Dragan Simic
  0 siblings, 1 reply; 2+ messages in thread
From: Félix Piédallu @ 2023-11-12 12:10 UTC (permalink / raw
  To: git

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-12 13:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-12 12:10 Declutter the home directory Félix Piédallu
2023-11-12 13:39 ` Dragan Simic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).