git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git-credential-store does not work with a file
       [not found] ` <56HlWgfQEg1t99VKZaFZqhdcjAs279HXXP1gQ9YzZGOGcR9jEzSVYgl3flvbTiqSet2HB0gc6jotcDmYbtDipE7k0-QbdrzjgxiKZBnIK_4=@protonmail.com>
@ 2020-05-12  0:40   ` David Moseler
  2020-05-12 11:22     ` Carlo Marcelo Arenas Belón
  0 siblings, 1 reply; 3+ messages in thread
From: David Moseler @ 2020-05-12  0:40 UTC (permalink / raw)
  To: git@vger.kernel.org

Hi,

I'm using git version 2.17.1. Providing a file to git-credential-store, such as in

git config credential.helper store --file='./git-credentials'

is not working. When using this command, git writes to ~/.git-credentials in the home folder anyway.

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

* Re: git-credential-store does not work with a file
  2020-05-12  0:40   ` git-credential-store does not work with a file David Moseler
@ 2020-05-12 11:22     ` Carlo Marcelo Arenas Belón
  2020-05-13 21:53       ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Carlo Marcelo Arenas Belón @ 2020-05-12 11:22 UTC (permalink / raw)
  To: David Moseler; +Cc: git@vger.kernel.org

On Tue, May 12, 2020 at 12:40:10AM +0000, David Moseler wrote:
> Hi,
> 
> I'm using git version 2.17.1. Providing a file to git-credential-store, such as in
> 
> git config credential.helper store --file='./git-credentials'

your quoting is off, so you are passing to config only the value 'store' while
the rest is ignored.

what you really meant to use is probably :

  git config credential.helper "store --file=$PWD/git-credentials"

note that using a relative path might not be what you really want, as the
context for when that is run will not be what you expected most likely (ex:
the root of your repository)

> is not working. When using this command, git writes to ~/.git-credentials in the home folder anyway.

note that credential.helper is a multi value setting, so you probably also want
to clear the list first, if your intention was to only use that file and not the
one in ~/.git-credentials.

see `git help gitcredentials` for details

Carlo

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

* Re: git-credential-store does not work with a file
  2020-05-12 11:22     ` Carlo Marcelo Arenas Belón
@ 2020-05-13 21:53       ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2020-05-13 21:53 UTC (permalink / raw)
  To: Carlo Marcelo Arenas Belón; +Cc: David Moseler, git@vger.kernel.org

Carlo Marcelo Arenas Belón <carenas@gmail.com> writes:

> On Tue, May 12, 2020 at 12:40:10AM +0000, David Moseler wrote:
>> Hi,
>> 
>> I'm using git version 2.17.1. Providing a file to git-credential-store, such as in
>> 
>> git config credential.helper store --file='./git-credentials'
>
> your quoting is off, so you are passing to config only the value 'store' while
> the rest is ignored.

Actually it is worse than that.  If it were "the rest is ignored",
we can fix it to give an error.  But the problem is, the rest is
*not* ignored.  It is used as an argument with a meaning that the
user did not expect it to have.

The above asks "we want to update the value of credential.helper
variable(s) and set 'store' as its value, but we want to do so only
for the entries whose current value match the regular expression
given as the last argument".  

It is unlikely that a credential.helper variable defined with the
value "--file=./git-credentials", so the command silently succeeds
after replacing 0 entries.  

The same issue exists with "--replace-all", "--unset" and other
forms of "git config" that take an optional value_regex.

This is now totally offtopic for a thread about credential-store,
but we probably should fix the command line UI for this feature.

Perhaps

 1) Teach all the forms of "git config" that currently takes an
    optional value_regex to accept "--value-regexp=regex" option.
    It will be an error to give both --value-regexp parameter and
    the optional "value_regex" argument.  Wait for several releases.

 2) Update these forms to warn when the current "optional"
    value_regex syntax is used, and tell users to explicitly use the
    "--value-regexp=regex" option.  Wait for several releases.

 3) Remove support for the "optional" value_regex syntax and error
    out when it is used.

over a few years.

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

end of thread, other threads:[~2020-05-13 21:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Wc7NKqbl9k45DWha23OG_TvVA4Ftq3sOCiHScVXhmAbCPOaz8pkEqQrPXw_JBC8G7g9CrIKxwfE8pv8Nr9Dcw5J0zA7fNCAi9Mq1OnxhpMg=@protonmail.com>
     [not found] ` <56HlWgfQEg1t99VKZaFZqhdcjAs279HXXP1gQ9YzZGOGcR9jEzSVYgl3flvbTiqSet2HB0gc6jotcDmYbtDipE7k0-QbdrzjgxiKZBnIK_4=@protonmail.com>
2020-05-12  0:40   ` git-credential-store does not work with a file David Moseler
2020-05-12 11:22     ` Carlo Marcelo Arenas Belón
2020-05-13 21:53       ` Junio C Hamano

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