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

Re: [PATCH v2] remove the impression of unexpectedness when access is denied

From
Junio C Hamano <gitster@pobox.com>
Date
May 6, 2013, 14:02 UTC
Message-ID
<7vr4hktddq.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130504031001.GA3734@elie.Belkin>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 30 quoted lines
> I ran into this message for the first time today.
>
>  $ git fetch --all
>  Fetching origin
>  remote: Counting objects: 368, done.
> [...]
>  Fetching gitk
>  fatal: Could not read from remote repository.
>
>  Please make sure you have the correct access rights
>  and the repository exists.
>  error: Could not fetch gitk
>  Fetching debian
>  Fetching pape
> [...]
>
> The "gitk" remote refers to git://git.kernel.org/pub/scm/gitk/gitk.
> Using ls-remote to contact it produces the same result.  The message
> is correct: the repository does not exist.
>
> Impressions:
>
>  * Looking at "Could not read", it is not clear what could not read
>    and why.  GIT_TRACE_PACKET tells me the interaction was
>
> 	me> git-upload-pack /pub/scm/gitk/gitk\0host=git.kernel.org\0
> 	them> (hangup)
>
>    Would it make sense for the server to send an "ERR" packet to give
>    a more helpful diagnosis?

I think git-daemon does so (or at least attempts to do so); path_ok() uses enter_repo() to check if the given path is a repository, returns NULL to run_service(), whichh in turn calls daemon_error() that does the ERR thing.

Show 13 quoted lines
>  * The spacing and capitalization is odd and makes it not flow well
>    with the rest of the output.  I suspect it would be easier to read
>    with the error separated from hints:
>
> 	Fetching gitk
> 	fatal: the remote server sent an empty response
> 	hint: does the repository exist?
> 	hint: do you have the correct access rights?
> 	error: Could not fetch gitk
> 	Fetching debian
>
>    If a server is misconfigured and just decides to send an empty
>    response for no good reason, the output would still be true.
It does sound better. Also s/Could not fetch/could not fetch/.
>  * The error message is the same whether the server returned no
>    response or an incomplete pkt-line.  Maybe in the latter case it
>    should print the "hung up unexpectedly" thing.
OK.
Previous: Jonathan NiederNext: Jeff King
Message 12 of 13 in “lessen the impression of unexpectedness on remote hangup”
  1. lessen the impression of unexpectedness on remote hangupHeiko Voigt, Jun 10, 2012
  2. Jonathan NiederJun 10, 2012
  3. Junio C HamanoJun 11, 2012
  4. Jeff KingJun 11, 2012
  5. Heiko VoigtJun 13, 2012
  6. remove the impression of unexpectedness when access is deniedHeiko Voigt, Jun 14, 2012
  7. Heiko VoigtJun 14, 2012
  8. Junio C HamanoJun 14, 2012
  9. Heiko VoigtJun 14, 2012
  10. remove the impression of unexpectedness when access is deniedHeiko Voigt, Jun 19, 2012
  11. Jonathan NiederMay 4, 2013
  12. Junio C HamanoMay 6, 2013
  13. Jeff KingMay 7, 2013

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.