Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: "Félix Piédallu" <felix@piedallu.me>
To: git@vger.kernel.org
Subject: Declutter the home directory
Date: Sun, 12 Nov 2023 13:10:41 +0100	[thread overview]
Message-ID: <cb89d863-12d4-412b-a25b-9eedce996708@piedallu.me> (raw)

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

             reply	other threads:[~2023-11-12 13:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-12 12:10 Félix Piédallu [this message]
2023-11-12 13:39 ` Declutter the home directory Dragan Simic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cb89d863-12d4-412b-a25b-9eedce996708@piedallu.me \
    --to=felix@piedallu.me \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).