Re: [Wishlist] could git tell which password it is asking when asking a password.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 1, 2011, 17:50 UTC
- Message-ID
- <7vwrg1opov.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <BANLkTi=aAinh=0jxb5MoqVOdUB7zxoy2XdSqk+pdsewLXU62ZA@mail.gmail.com>
Shawn Pearce <spearce@spearce.org> writes:
Show 20 quoted lines
> On Fri, Jul 1, 2011 at 10:16, Junio C Hamano <gitster@pobox.com> wrote:
>> Junio C Hamano <gitster@pobox.com> writes:
>> diff --git a/http.c b/http.c
>> index b2ae8de..44948a7 100644
>> --- a/http.c
>> +++ b/http.c
>> @@ -209,8 +209,11 @@ static void init_curl_http_auth(CURL *result)
>> {
>> if (user_name) {
>> struct strbuf up = STRBUF_INIT;
>> - if (!user_pass)
>> - user_pass = xstrdup(git_getpass("Password: "));
>> + if (!user_pass) {
>> + strbuf_addf(&up, "Password for %s: ", user_name);
>
> The user_name by itself may not be sufficient. I may also need the URL
> to correctly answer the question. I don't always use the same password
> on every website. :-)
>
> As a human sure, I know what URL I asked Git to poke for me.I was wondering about that when I gave that quick patch. And "as a human" may not necessarily apply when you are letting submodule fetch to recurse.