git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Stefan Naewe <stefan.naewe@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Michael J Gruber <git@drmicha.warpmail.net>,
	git@vger.kernel.org
Subject: Re: [ANNOUNCE] Git 1.7.8.rc0
Date: Wed, 2 Nov 2011 14:10:41 -0400	[thread overview]
Message-ID: <20111102181041.GA5366@sigill.intra.peff.net> (raw)
In-Reply-To: <20111102180327.GA30668@sigill.intra.peff.net>

On Wed, Nov 02, 2011 at 02:03:27PM -0400, Jeff King wrote:

> Without using a configured remote, try this (with .netrc configured):
> 
>   git push https://github.com/user/repo.git :refs/heads/nothing
> 
> which should work, and then this:
> 
>   git push https://user@github.com/user/repo.git :refs/heads/nothing
> 
> which will do the "must hit enter to accept password" thing.
> 
> That fails even with v1.7.7. I didn't bisect, but it has been there
> quite a while (v1.6.6 has it, but v1.6.5 has a weird error, so I didn't
> bisect further).

OK, I see the issue.

The logic is "if we have a username, but not a password, then ask for
the password before trying any http" (this is what avoids the extra
round trip).

But if you are using netrc, we don't parse it ourselves. We just tell
curl "when you are making the request, check netrc, too".

So the ideal logic is:

  1. look in netrc

  2. If we have a username and no password, ask for password

  3. Otherwise, try it and see if we get a 401.

But we can't do that, because (1) and (3) happen atomically inside of
curl.

The simplest thing is to just drop the behavior in (2), and let it drop
to a 401. The extra round trip probably isn't that big a deal.

The other option is to start parsing netrc ourselves, or do the extra
round trip if we detect ~/.netrc or something. But that last one is
getting pretty hackish.

-Peff

  reply	other threads:[~2011-11-02 18:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-31  5:00 [ANNOUNCE] Git 1.7.8.rc0 Junio C Hamano
2011-10-31 14:17 ` Stefan Näwe
2011-10-31 17:19   ` Junio C Hamano
2011-11-01  9:53   ` Stefan Näwe
2011-11-01 18:12     ` Junio C Hamano
2011-11-01 18:19       ` Jeff King
2011-11-01 20:06       ` Stefan Naewe
2011-11-01 20:18         ` Stefan Naewe
2011-11-02 10:27           ` Michael J Gruber
2011-11-02 18:03           ` Jeff King
2011-11-02 18:10             ` Jeff King [this message]
2011-11-02 19:13               ` Junio C Hamano
2011-11-02 20:09                 ` Jeff King
2011-11-03 23:02                   ` Junio C Hamano
2011-11-01 21:53         ` Stefan Naewe
2011-11-02  8:52       ` [RFC/PATCH] http-push: don't always prompt for password (Was Re: [ANNOUNCE] Git 1.7.8.rc0) Stefan Näwe
2011-11-02 14:08         ` Michael J Gruber
2011-11-02 17:13         ` [RFC/PATCH] http-push: don't always prompt for password Junio C Hamano
2011-11-02 17:23           ` Jeff King
2011-11-02 17:40             ` Junio C Hamano
2011-11-04  7:03               ` [PATCH] " Stefan Naewe
2011-11-04 16:48                 ` Junio C Hamano
2011-11-04 17:43                   ` Jeff King
2011-11-04 19:06                     ` Junio C Hamano
2011-11-04 18:34                   ` Stefan Naewe
2011-11-05  6:45                     ` Junio C Hamano

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=20111102181041.GA5366@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=stefan.naewe@gmail.com \
    /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 NNTP newsgroup(s).