git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Paul Tan <pyokagan@gmail.com>
To: Luis Ressel <aranea@aixah.de>
Cc: git@vger.kernel.org, Christian Couder <christian.couder@gmail.com>
Subject: Re: [GSoC microproject] Add XDG support to the credential-store helper
Date: Fri, 6 Mar 2015 16:04:39 +0800	[thread overview]
Message-ID: <CACRoPnR3i3pTyqcxm0iELP0uR9cL2kvm9fd7BQPVpbLB0UBNVw@mail.gmail.com> (raw)
In-Reply-To: <20150306004139.2dac2502@gentp.lnet>

Hi Luis,

On Fri, Mar 6, 2015 at 7:41 AM, Luis Ressel <aranea@aixah.de> wrote:
> Okay, I've had a look at Paul's patch for this. Sorry again for the
> dupe, I must've missed it before. I guess I'll attempt another
> microproject.
>
> However, I feel like my patch is really all that's neccessary; I don't
> think we should try to use both files if they exist -- I consider
> Paul's approach to be a bit overcomplicated.
>
> My patch still uses ~/.git-credentials as a default location, which
> should be sufficient for compability.

Indeed, that was my initial plan for implementation as well[1]. Matthieu,
however, wanted the behavior to follow that of git-config[2].

[1] http://article.gmane.org/gmane.comp.version-control.git/264666
[2] http://article.gmane.org/gmane.comp.version-control.git/264669

> A user that wants to use
> ~/.config/git/credentials instead has to manually create that file
> first, which he just shouldn't do if he has to stay compatible to
> previous git versions.

Yes, I totally agree. I wonder if the current behavior to read the home
config file in addition to the xdg config file is actually
useful to the end-user. (However, that behavior has been in git since 2012, so
for consistency purposes it may not be desirable to make credential-store act
differently from git-config.)

What I do believe, however, is that there *should* be a way for
credential-store to lookup, erase and (maybe) store credentials to multiple
files. This opens the door for git to be fully xdg base dir spec compliant
by supporing both $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS.
I quote from the spec[3]:

    The order of base directories denotes their importance; the first directory
    listed is the most important. When the same information is defined in
    multiple places the information defined relative to the more important base
    directory takes precedent. The base directory defined by $XDG_DATA_HOME is
    considered more important than any of the base directories defined by
    $XDG_DATA_DIRS. The base directory defined by $XDG_CONFIG_HOME is
    considered more important than any of the base directories defined by
    $XDG_CONFIG_DIRS.

[3] http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Reading from multiple credential stores could be useful, for example, if the
system administrator wanted to setup credentials for all users on the system.

Thus, if we are implementing the machinery for the XDG dir spec, it would make
sense to just add the home git-credentials file to the search path as well.

Regards,
Paul

  reply	other threads:[~2015-03-06  8:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05 20:51 [GSoC microproject] Add XDG support to the credential-store helper Luis Ressel
2015-03-05 20:53 ` [PATCH] " Luis Ressel
2015-03-05 22:10 ` [GSoC microproject] " Junio C Hamano
2015-03-05 22:38 ` Christian Couder
2015-03-05 23:15   ` Luis Ressel
2015-03-05 23:41     ` Luis Ressel
2015-03-06  8:04       ` Paul Tan [this message]
2015-03-06 17:28         ` Matthieu Moy
2015-03-06 19:21           ` Paul Tan

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CACRoPnR3i3pTyqcxm0iELP0uR9cL2kvm9fd7BQPVpbLB0UBNVw@mail.gmail.com \
    --to=pyokagan@gmail.com \
    --cc=aranea@aixah.de \
    --cc=christian.couder@gmail.com \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).