git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Junio C Hamano
Message 3 of 3 in “Prompt for a username when an HTTP request 401s”
  1. Prompt for a username when an HTTP request 401sScott Chacon, Apr 1, 2010
  2. Junio C HamanoApr 1, 2010
  3. Scott ChaconApr 1, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.