Re: BUG: Wrong error message when access to .git directory denied

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: BUG: Wrong error message when access to .git directory denied

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:05:03

Jonas Berlin [off-list ref] writes:
Severity: Low
Impact: Confusion
;-)
Git version: 1.9.1

If I don't have permissions to access the .git folder of a non-bare
git repository, I get the following output:

  fatal: Not a git repository (or any of the parent directories): .git

Expected output:

  fatal: Permission denied while accessing .git directory
But the thing is, .git being unreadable simply means we do not know
if it is a .git directory, or a random directory that does not have
anything to do with Git that happens to have that name.

So "Not a git repository" is the best Git can say.

Re: BUG: Wrong error message when access to .git directory denied

From: Stefan Beller <hidden>
Date: 2016-06-15 23:05:03

On Fri, May 29, 2015 at 8:29 AM, Junio C Hamano [off-list ref] wrote:
Jonas Berlin [off-list ref] writes:
quoted
Severity: Low
Impact: Confusion
;-)
quoted
Git version: 1.9.1

If I don't have permissions to access the .git folder of a non-bare
git repository, I get the following output:

  fatal: Not a git repository (or any of the parent directories): .git

Expected output:

  fatal: Permission denied while accessing .git directory
But the thing is, .git being unreadable simply means we do not know
if it is a .git directory, or a random directory that does not have
anything to do with Git that happens to have that name.

So "Not a git repository" is the best Git can say.
fatal: Permission denied while accessing .git directory

does not imply we're having a git repository here at all, but rather
sounds like "We wanted to check for you if this is a git repository,
but we cannot do that as we lack permissions to do so.

So git doesn't know if it is inside a repo or not, so the actual error message
"Not a git repository" is wrong. It's just that the current permissions cannot
tell if we're in a repository or not.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help