git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BUG: Wrong error message when access to .git directory denied
@ 2015-05-29  7:47 Jonas Berlin
  2015-05-29 15:29 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Jonas Berlin @ 2015-05-29  7:47 UTC (permalink / raw)
  To: git

Hi,

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

Steps to reproduce:

  mkdir foo
  cd foo
  git init
  chmod 000 .git
  git log

- xkr47

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BUG: Wrong error message when access to .git directory denied
  2015-05-29  7:47 BUG: Wrong error message when access to .git directory denied Jonas Berlin
@ 2015-05-29 15:29 ` Junio C Hamano
  2015-05-29 16:45   ` Stefan Beller
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2015-05-29 15:29 UTC (permalink / raw)
  To: Jonas Berlin; +Cc: git

Jonas Berlin <xkr47@outerspace.dyndns.org> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BUG: Wrong error message when access to .git directory denied
  2015-05-29 15:29 ` Junio C Hamano
@ 2015-05-29 16:45   ` Stefan Beller
  2015-05-29 17:06     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Beller @ 2015-05-29 16:45 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jonas Berlin, git@vger.kernel.org

On Fri, May 29, 2015 at 8:29 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Jonas Berlin <xkr47@outerspace.dyndns.org> 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.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BUG: Wrong error message when access to .git directory denied
  2015-05-29 16:45   ` Stefan Beller
@ 2015-05-29 17:06     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2015-05-29 17:06 UTC (permalink / raw)
  To: Stefan Beller; +Cc: Jonas Berlin, git@vger.kernel.org

Stefan Beller <sbeller@google.com> writes:

>> 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.

Fair enough.  Patches ;-)?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-29 17:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-29  7:47 BUG: Wrong error message when access to .git directory denied Jonas Berlin
2015-05-29 15:29 ` Junio C Hamano
2015-05-29 16:45   ` Stefan Beller
2015-05-29 17:06     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).