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

Re: [PATCH] Add ERR support to smart HTTP

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Sep 6, 2010, 01:04 UTC
Message-ID
<AANLkTikGiekZGNffaraHK-waBt7wH84jujM_uh3cw46y@mail.gmail.com>
In-Reply-To
<m3pqwrnay2.fsf@localhost.localdomain>
On Mon, Sep 6, 2010 at 2:52 AM, Jakub Narebski <jnareb@gmail.com> wrote:
Show 15 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> On Sun, Sep 5, 2010 at 18:49, Ilari Liusvaara
>> <ilari.liusvaara@elisanet.fi> wrote:
>>
>> > AFAIK, HTTP errors don't have descriptions printed.
>>
>> I don't know if this applies here but HTTP error codes can come with
>> any free-form \n-delimited string:
>>
>>     HTTP/1.1 402 You Must Build Additional Pylons
>
> And you can also send more detailed description in the *body* (and not
> only HTTP headers) of HTTP response, though I don't know if git does
> that.

I'm going to try the patch that Ilari sent when I get to work but to answer this sub-thread about HTTP status codes and messages, none of that gets printed by the curl code, as Ilari pointed out. Here's a transcript:

Notice the 403 on this one... I do send that back:

06:30:37 sitaram@sita-lt:http-test $ git clone `genurl alice foo/sitaram/try1` Cloning into try1... error: The requested URL returned error: 403 while accessing http://alice:alice@127.0.0.1/git/foo/sitaram/try1/info/refs

fatal: HTTP request failed
You can see the actual message cleanly here:

06:30:46 sitaram@sita-lt:http-test $ curl http://alice:alice@127.0.0.1/git/foo/sitaram/try1/info/refs ERR R access for foo/sitaram/try1 DENIED to alice

And here you can see the text part of the HTTP/1.1 NNN status line:
06:31:04 sitaram@sita-lt:http-test $ curl -v
http://alice:alice@127.0.0.1/git/foo/sitaram/try1/info/refs
* About to connect() to 127.0.0.1 port 80 (#0)
*   Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
* Server auth using Basic with user 'alice'
Show 6 quoted lines
> GET /git/foo/sitaram/try1/info/refs HTTP/1.1
> Authorization: Basic YWxpY2U6YWxpY2U=
> User-Agent: curl/7.20.1 (i386-redhat-linux-gnu) libcurl/7.20.1 NSS/3.12.6.2 zlib/1.2.3 libidn/1.16 libssh2/1.2.4
> Host: 127.0.0.1
> Accept: */*
>
< HTTP/1.1 403 error - gitolite
< Date: Mon, 06 Sep 2010 01:02:23 GMT
< Server: Apache/2.2.16 (Fedora)
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: text/plain; charset=UTF-8
<
ERR R access for foo/sitaram/try1 DENIED to alice
* Closing connection #0
Previous: Jakub NarebskiNext: Sitaram Chamarty
Message 7 of 18 in “Add ERR support to smart HTTP”
  1. Add ERR support to smart HTTPIlari Liusvaara, Sep 5, 2010
  2. Jonathan NiederSep 5, 2010
  3. Ilari LiusvaaraSep 5, 2010
  4. Ævar Arnfjörð BjarmasonSep 5, 2010
  5. Ilari LiusvaaraSep 5, 2010
  6. Jakub NarebskiSep 5, 2010
  7. Sitaram ChamartySep 6, 2010
  8. Sitaram ChamartySep 6, 2010
  9. Ævar Arnfjörð BjarmasonSep 6, 2010
  10. Jakub NarebskiSep 6, 2010
  11. Joshua JuranSep 6, 2010
  12. Shawn O. PearceSep 6, 2010
  13. Sitaram ChamartySep 6, 2010
  14. Shawn O. PearceSep 6, 2010
  15. Sitaram ChamartySep 8, 2010
  16. Sitaram ChamartySep 6, 2010
  17. Jakub NarebskiSep 6, 2010
  18. Jonathan NiederSep 5, 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.