Re: [PATCH] Prompt for a username when an HTTP request 401s
- From
Scott Chacon <schacon@gmail.com>
- Date
- Apr 1, 2010, 22:06 UTC
- Message-ID
- <h2vd411cc4a1004011506p4d2db46bjafbe22f702b0f869@mail.gmail.com>
- In-Reply-To
- <7v39zeoo70.fsf@alter.siamese.dyndns.org>
Hey,
On Thu, Apr 1, 2010 at 2:30 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> > Also, earlier I said "sometimes OK", because I don't know if it always OK > for us to get 401 and continue. If the end user got a 401 and then does > not have a good username or password (e.g. he realizes that the URL he > accessed was incorrect), he used to see "you are not allowed to access > this repository" with a clean failure, but now he would have to get out of > "who are you?" interaction (and how would he do that?). Would that be a > problem?
They did not get a clean failure, it looks like this:
-- $ git clone http://github.dev/defunkt/ambition.git Initialized empty Git repository in /private/tmp/svn/ambition/.git/ error: The requested URL returned error: 401 while accessing http://github.dev/defunkt/ambition.git/info/refs
fatal: HTTP request failed --
"401 while accessing X, HTTP request failed" is not really a clean failure. Most people don't know what a 401 is. With this patch, if they get prompted for a user/pass on 401 and it still fails, they see this:
-- $ ~/bin/git clone http://github.dev/defunkt/ambition.git Initialized empty Git repository in /private/tmp/svn/ambition/.git/ Username: Password: fatal: Authentication failed --
I think "Authentication failed" is a bit cleaner. I'm sending another patch with the comment format change and message update.
Scott