{"thread":{"id":"39455","subject":"BUG: Wrong error message when access to .git directory denied","startedAt":"2015-05-29T07:47:43Z","lastAt":"2015-05-29T17:06:27Z","messageCount":4,"participants":["Jonas Berlin","Junio C Hamano","Stefan Beller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"262395","messageId":"20150529104743.6220a11f@outerspace.dyndns.org","threadId":"39455","inReplyTo":null,"subject":"BUG: Wrong error message when access to .git directory denied","fromName":"Jonas Berlin","fromEmail":"xkr47@outerspace.dyndns.org","sentAt":"2015-05-29T07:47:43Z","receivedAt":"2015-05-29T07:47:43Z","isPatch":false,"sender":{"key":"xkr47@outerspace.dyndns.org","avatar":null},"body":"Hi,\n\nSeverity: Low\nImpact: Confusion\nGit version: 1.9.1\n\nIf I don't have permissions to access the .git folder of a non-bare git repository, I get the following output:\n\n  fatal: Not a git repository (or any of the parent directories): .git\n\nExpected output:\n\n  fatal: Permission denied while accessing .git directory\n\nSteps to reproduce:\n\n  mkdir foo\n  cd foo\n  git init\n  chmod 000 .git\n  git log\n\n- xkr47\n"},{"id":"262424","messageId":"xmqq1thzfll9.fsf@gitster.dls.corp.google.com","threadId":"39455","inReplyTo":"20150529104743.6220a11f@outerspace.dyndns.org","subject":"Re: BUG: Wrong error message when access to .git directory denied","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-29T15:29:54Z","receivedAt":"2015-05-29T15:29:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonas Berlin <xkr47@outerspace.dyndns.org> writes:\n\n> Severity: Low\n> Impact: Confusion\n\n;-)\n\n> Git version: 1.9.1\n>\n> If I don't have permissions to access the .git folder of a non-bare\n> git repository, I get the following output:\n>\n>   fatal: Not a git repository (or any of the parent directories): .git\n>\n> Expected output:\n>\n>   fatal: Permission denied while accessing .git directory\n\nBut the thing is, .git being unreadable simply means we do not know\nif it is a .git directory, or a random directory that does not have\nanything to do with Git that happens to have that name.\n\nSo \"Not a git repository\" is the best Git can say.\n"},{"id":"262437","messageId":"CAGZ79kZPTpJjLsKSd6E8vQ0HFuSeCH5Hr_LBhSjx9=SQdQhOBQ@mail.gmail.com","threadId":"39455","inReplyTo":"xmqq1thzfll9.fsf@gitster.dls.corp.google.com","subject":"Re: BUG: Wrong error message when access to .git directory denied","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2015-05-29T16:45:13Z","receivedAt":"2015-05-29T16:45:13Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Fri, May 29, 2015 at 8:29 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Jonas Berlin <xkr47@outerspace.dyndns.org> writes:\n>\n>> Severity: Low\n>> Impact: Confusion\n>\n> ;-)\n>\n>> Git version: 1.9.1\n>>\n>> If I don't have permissions to access the .git folder of a non-bare\n>> git repository, I get the following output:\n>>\n>>   fatal: Not a git repository (or any of the parent directories): .git\n>>\n>> Expected output:\n>>\n>>   fatal: Permission denied while accessing .git directory\n>\n> But the thing is, .git being unreadable simply means we do not know\n> if it is a .git directory, or a random directory that does not have\n> anything to do with Git that happens to have that name.\n>\n> So \"Not a git repository\" is the best Git can say.\n\nfatal: Permission denied while accessing .git directory\n\ndoes not imply we're having a git repository here at all, but rather\nsounds like \"We wanted to check for you if this is a git repository,\nbut we cannot do that as we lack permissions to do so.\n\nSo git doesn't know if it is inside a repo or not, so the actual error message\n\"Not a git repository\" is wrong. It's just that the current permissions cannot\ntell if we're in a repository or not.\n\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"262439","messageId":"xmqqwpzrcnzg.fsf@gitster.dls.corp.google.com","threadId":"39455","inReplyTo":"CAGZ79kZPTpJjLsKSd6E8vQ0HFuSeCH5Hr_LBhSjx9=SQdQhOBQ@mail.gmail.com","subject":"Re: BUG: Wrong error message when access to .git directory denied","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-29T17:06:27Z","receivedAt":"2015-05-29T17:06:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n>> So \"Not a git repository\" is the best Git can say.\n>\n> fatal: Permission denied while accessing .git directory\n>\n> does not imply we're having a git repository here at all, but rather\n> sounds like \"We wanted to check for you if this is a git repository,\n> but we cannot do that as we lack permissions to do so.\n>\n> So git doesn't know if it is inside a repo or not, so the actual error message\n> \"Not a git repository\" is wrong. It's just that the current permissions cannot\n> tell if we're in a repository or not.\n\nFair enough.  Patches ;-)?\n"}]}