All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
Cc: David Moseler <davidmoseler@protonmail.com>,
	"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: git-credential-store does not work with a file
Date: Wed, 13 May 2020 14:53:41 -0700	[thread overview]
Message-ID: <xmqq1rnnsdqy.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: 20200512112201.GA10049@Carlos-MBP

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.

      reply	other threads:[~2020-05-13 21:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]

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=xmqq1rnnsdqy.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=carenas@gmail.com \
    --cc=davidmoseler@protonmail.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.