All of lore.kernel.org
 help / color / mirror / Atom feed
From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Fredrik Gustafsson <iveqy@iveqy.com>,
	Federico Lucifredi <federico@canonical.com>,
	git@vger.kernel.org
Subject: Re: Git Bug report
Date: Thu, 6 Oct 2011 02:33:18 +0200	[thread overview]
Message-ID: <20111006003318.GA9015@goldbirke> (raw)
In-Reply-To: <7vlisz8jur.fsf@alter.siamese.dyndns.org>

On Wed, Oct 05, 2011 at 09:49:00AM -0700, Junio C Hamano wrote:
> Fredrik Gustafsson <iveqy@iveqy.com> writes:
> 
> > On Tue, Oct 04, 2011 at 05:24:03PM -0400, Federico Lucifredi wrote:
> >>  Found a minor bug in git today - the error message reported is not
> >> correct when trying to access a repo that is not accessible
> >> permission-wise:
> >> 
> >> > federico@skyplex:/etc$ git log
> >> > fatal: Not a git repository (or any of the parent directories): .git
> >> 
> >> with correct access permissions, everything works as expected.
> >
> > So if:
> > .git/ is a directory with not enought permissions.
> > ../.git/ is a directory with enought permissions.
> >
> > git would today use ../.git. You suggest that git instead would die
> > because a .git/ exists? (I'm not saying this is wrong or right).
> 
> For that matter, if you have .git/ that is a directory but is not a
> repository, and ../.git/ that is, the same situation would arise. I do not
> think we should die because .git/ is not a git repository. I do not know
> if we should even warn about it.

And what about unreadable .git files?

~/tmp/git/outside$ git init
Initialized empty Git repository in /home/szeder/tmp/git/outside/.git/
~/tmp/git/outside$ mkdir inside repo
~/tmp/git/outside$ cd inside/
~/tmp/git/outside/inside$ git init --separate-git-dir=../repo
Initialized empty Git repository in /home/szeder/tmp/git/outside/repo/
~/tmp/git/outside/inside$ git rev-parse --git-dir
/home/szeder/tmp/git/outside/repo
~/tmp/git/outside/inside$ chmod a-r .git
~/tmp/git/outside/inside$ git rev-parse --git-dir
fatal: Error opening '.git': Permission denied

Or a non-gitfile .git file?

~/tmp/git/outside/inside$ chmod a+r .git
~/tmp/git/outside/inside$ echo foo >.git
~/tmp/git/outside/inside$ git rev-parse --git-dir
fatal: Invalid gitfile format: .git

Shouldn't these also be ignored?


Best,
Gábor

  parent reply	other threads:[~2011-10-06  0:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04 21:24 Git Bug report Federico Lucifredi
2011-10-05  6:11 ` Johannes Sixt
2011-10-05  8:17   ` [PATCH] Report errors related to .git access during repository discovery Nguyễn Thái Ngọc Duy
2011-10-05 18:32   ` Git Bug report Federico Lucifredi
2011-10-05  7:22 ` Fredrik Gustafsson
2011-10-05 16:49   ` Junio C Hamano
2011-10-05 21:56     ` Nguyen Thai Ngoc Duy
2011-10-06  0:33     ` SZEDER Gábor [this message]
2011-10-06  0:44       ` Junio C Hamano
2011-10-06  1:09         ` SZEDER Gábor
     [not found]           ` <CABURp0qCsKG2oOxLw4BfU8UM=9V+pigd69ZK=TZVwetBPqjuiA@mail.gmail.com>
2011-10-06 16:22             ` Junio C Hamano
2011-10-06 16:26               ` Matthieu Moy
2011-10-06 16:54               ` Phil Hord
2011-10-06 22:57               ` Aaron Schrab
2011-10-06 16:48           ` Phil Hord
  -- strict thread matches above, loose matches on Subject: below --
2022-04-14  7:22 Git Bug Report Randall Alfaro
2022-10-10 23:09 Git bug report Camden Narzt
2023-08-04 16:46 git " Paul Watson
2023-08-04 17:28 ` rsbecker
2023-08-08 17:07 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111006003318.GA9015@goldbirke \
    --to=szeder@ira.uka.de \
    --cc=federico@canonical.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=iveqy@iveqy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.